Language: C

<?php

$N = trim(fgets(STDIN));

$array = [];
$tmp = '';

for($i = 0;$i < $N;$i++) {
	$tmp = trim(fgets(STDIN));
  $hoge = [];

  for($j = 0;$j < strlen($tmp);$j++) {
    $hoge[] = $tmp[$j];    
  }

  $array[] = implode("", bubble_sort($hoge));
}

$counter = 0;
for($k = 1;$k < $N;$k++) {
  for($m = 0;$m < $N;$m++) {
    if($m === $k) continue;
    if(strcmp($array[$k], $array[$m]) == 0) {
      $counter++;
    }
  }
}

echo $counter."\n";

function bubble_sort($array)
{
    // 要素数回繰り返し
    for($i = 0; $i < count($array); $i++)
    {
        // 要素数-1回繰り返し
        for($n = 1; $n < count($array); $n++)
        {
            // 隣接要素を比較し大小が逆なら入替える
            if($array[$n-1] > $array[$n])
            {
                $temp = $array[$n];
                $array[$n] = $array[$n-1];
                $array[$n-1] = $temp;
            }
        }
    }
    return $array;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before '<' token
    1 | <?php
      | ^
main.c:5:1: warning: data definition has no type or storage class
    5 | $array = [];
      | ^~~~~~
main.c:5:1: error: type defaults to 'int' in declaration of '$array' [-Wimplicit-int]
main.c:5:10: error: expected expression before '[' token
    5 | $array = [];
      |          ^
main.c:6:8: error: empty character constant
    6 | $tmp = '';
      |        ^~
main.c:8:1: error: expected identifier or '(' before 'for'
    8 | for($i = 0;$i < $N;$i++) {
      | ^~~
main.c:8:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 | for($i = 0;$i < $N;$i++) {
      |               ^
main.c:8:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 | for($i = 0;$i < $N;$i++) {
      |                      ^~
main.c:19:1: warning: data definition has no type or storage class
   19 | $counter = 0;
      | ^~~~~~~~
main.c:19:1: error: type defaults to 'int' in declaration of '$counter' [-Wimplicit-int]
main.c:20:1: error: expected identifier or '(' before 'for'
   20 | for($k = 1;$k < $N;$k++) {
      | ^~~
main.c:20:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   20 | for($k = 1;$k < $N;$k++) {
      |               ^
main.c:20:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   20 | for($k = 1;$k < $N;$k++) {
      |                      ^~
main.c:29:1: error: unknown type name 'echo'
   29 | echo $counter."\n";
      | ^~~~
main.c:29:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   29 | echo $counter."\n";
      |              ^
main.c:31:1: error: unknown type name 'function'; did you mean 'union'?
   31 | function bubble_sort($array)
      | ^~~~~~~~
      | union
main.c: In function 'bubble_sort':
main.c:31:10: error: type of '$array' defaults to 'int' [-Wimplicit-int]
   31 | function bubble_sort($array)
      |          ^~~~~~~~~~~
main.c:34:9: error: '$i' undeclared (first use in this function)
   34 |     for($i = 0; $i < count($array); $i++)
      |         ^~
main.c:34:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:22: error: implicit declaration of function 'count' [-Wimplicit-function-declaration]
   34 |     for($i = 0; $i < count($array); $i++)
      |                      ^~~~~
main.c:37:13: error: '$n' undeclared (first use in this function)
   37 |         for($n = 1; $n < count($array); $n++)
      |             ^~
main.c:42:17: error: '$temp' undeclared (first use in this function)
   42 |                 $temp = $array[$n];
      |                 ^~~~~