> Can you provide details as to what is wrong with it or how it could be done better? # Starting the counter length doesn't consider multi-byte characters As was mentioned in a comment, The `for` loop calls `strlen($str)` to calculate the first value of `$i`. Per [the documentation of `strlen()`][1]: > **Note**: > > **`strlen()`** returns the number of bytes rather than the number of characters in a string. For multi-byte strings this will not work well as some characters may be broken up. One could use [`mb_strlen()`][2] to get the length of a multi-byte string and [`mb_substr()`][3] to get multi-byte characters at given indexes. # Use idiomatic spacing While this is purely subjective, most idiomatic PHP follows standards like [PSR-12][4], which has many recommendations on styling and other code conventions. The line which stands out as the most incongruent with such conventions is the loop declaration: > for($i=strlen($str)-1;$i>=0;$i--){ Idiomatic PHP code would have more spaces after the keyword `for`, the semi-colons and the closing parenthesis, as well as surrounding binary operators: for ($i = strlen($str)-1; $i>=0; $i--) { The php.net documentation often has idiomatic code. For example, the [documentation for the `for` keyword][5] contains this example (one of four): > <?php > /* example 1 */ > > for ($i = 1; $i <= 10; $i++) { > echo $i; > } > ... # Appending strings can be done with `.=` This may or may not be what the evaluators were looking for- one could append the strings using [double quoted strings][6] with [variable parsing][7]. # Iteration style can be simpler with `foreach` One could split the string using a function like [`preg_split()`][8] and then iterate over the characters using `foreach`. This allows for the elimination of the iterator variable. $characters = preg_split('//u', $str); foreach ($characters as $character) { $reversed = "{$character}{$reversed}"; } [1]: https://www.php.net/manual/en/function.strlen.php#refsect1-function.strlen-notes [2]: https://www.php.net/mb_strlen [3]: https://www.php.net/mb_substr [4]: https://www.php-fig.org/psr/psr-12/ [5]: https://www.php.net/for [6]: https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double [7]: https://www.php.net/manual/en/language.types.string.php#language.types.string.parsing [8]: https://php.net/preg_split