3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr_database = array("V1", "V2", "V5", "V6", "V7", "V10"); $arr_custom = array("V1", "V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9", "V10"); $arr_output = array_diff($arr_custom, $arr_database); echo json_encode($arr_output);
Output for 5.2.0 - 5.6.24, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
{"2":"V3","3":"V4","7":"V8","8":"V9"}
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/UB0oQ on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/UB0oQ on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/UB0oQ on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/UB0oQ on line 7