3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mbStringToArray ($string) { $strlen = mb_strlen($string); while ($strlen) { $array[] = mb_substr($string,0,1,"UTF-8"); $string = mb_substr($string,1,$strlen,"UTF-8"); $strlen = mb_strlen($string); } return $array; } $a = "बिक्रम"; $lol = mbStringToArray($a); $yo = "\u0945"; echo iconv('UCS-2', 'UTF-8', $yo) $test = json_decode('"\u093F"'); function overall (){ $hindi = array("\u093E","\u093F","\u0945","\u0946","\u0947","\u0948","\u0949","\u094A","\u094B","\u094C","\u094D"); for($i = 0; $i<count($hindi); $i++){ echo json_decode('$hindi[$i]'); } } echo $test."---".$lol[1]; if($test == $lol[1]){ echo "Game"; } else echo "No game"; //overall(); ?>
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '$test' (T_VARIABLE), expecting ',' or ';' in /in/h7Ggs on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /in/h7Ggs on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /in/h7Ggs on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/h7Ggs on line 15
Process exited with code 255.

preferences:
211.19 ms | 1395 KiB | 124 Q