3v4l.org

run code in 300+ PHP versions simultaneously
<?php $item = mb_convert_encoding( '¨l', 'ISO-8859-1', 'UTF-8' ); $encoding = 'UTF-8'; $ret = ''; $max = mb_strlen($item ?? '', $encoding); for ($i = 0; $i < $max; $i++) { $char = mb_substr($item, $i, 1, $encoding); $up = mb_strtoupper($char, $encoding); $low = mb_strtolower($char, $encoding); $ret .= ($up != $low) ? '[' . $up . $low . ']' : $char; } var_dump(utf8_encode($ret));
Output for 8.4.1 - 8.4.2
Deprecated: Function utf8_encode() is deprecated since 8.2, visit the php.net documentation for various alternatives in /in/d3U1V on line 19 string(5) "?[Ll]"
Output for 8.3.2 - 8.3.15
Deprecated: Function utf8_encode() is deprecated in /in/d3U1V on line 19 string(5) "?[Ll]"
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.1
Deprecated: Function utf8_encode() is deprecated in /in/d3U1V on line 19 string(6) "¨[Ll]"
Output for 8.1.0 - 8.1.31
string(6) "¨[Ll]"

preferences:
42.97 ms | 409 KiB | 5 Q