3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = '😍'; echo bin2hex($input) . PHP_EOL; echo json_encode($input) . PHP_EOL; echo json_encode($input[0]); echo json_encode($input[1]); echo json_encode($input[2]); echo json_encode($input[3]);
Output for 5.5.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
f09f988d "\ud83d\ude0d"
Output for 5.2.7 - 5.3.13, 5.3.15 - 5.4.45
f09f988d "\ud83d\ude0d" nullnullnullnull
Output for 5.3.14
f09f988d "\ud83d\ude0d" Warning: json_encode(): Invalid UTF-8 sequence in argument in /in/HuKpg on line 8 Warning: json_encode(): Invalid UTF-8 sequence in argument in /in/HuKpg on line 9 Warning: json_encode(): Invalid UTF-8 sequence in argument in /in/HuKpg on line 10 Warning: json_encode(): Invalid UTF-8 sequence in argument in /in/HuKpg on line 11
Output for 5.2.0 - 5.2.6
f09f988d "\ud83d\ude0d" """"""""
Output for 5.0.2 - 5.1.6
f09f988d Fatal error: Call to undefined function json_encode() in /in/HuKpg on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/HuKpg on line 4 f09f988dPHP_EOL Fatal error: Call to undefined function json_encode() in /in/HuKpg on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
f09f988d Fatal error: Call to undefined function: json_encode() in /in/HuKpg on line 6
Process exited with code 255.
Output for 4.3.10 - 4.4.4
f09f988d Fatal error: Call to undefined function: json_encode() in /in/HuKpg on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/HuKpg on line 4 f09f988dPHP_EOL Fatal error: Call to undefined function: json_encode() in /in/HuKpg on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/HuKpg on line 4 f09f988dPHP_EOL Fatal error: Call to undefined function: json_encode() in /in/HuKpg on line 6