3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = ["a","b","c"]; var_dump(json_encode($arr1)); $arr2 = [1=>"A", 4=>"b", 10=>"c"] var_dump(json_encode($arr2)); $arr3 = [1=>"A", 14=>"b", 10=>"c"] var_dump(json_encode($arr2));
Output for 8.0.0 - 8.0.3
Parse error: syntax error, unexpected identifier "var_dump" in /in/mCqpN on line 9
Process exited with code 255.
Output for 7.3.0 - 7.3.28, 7.4.0 - 7.4.16
Parse error: syntax error, unexpected 'var_dump' (T_STRING) in /in/mCqpN on line 9
Process exited with code 255.

preferences:
150.67 ms | 457 KiB | 5 Q