3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr['color_list'] = []; $var[0][0] = 1; $var[0][1] = 2; $var[1][0] = 2; $var[1][1] = 2; $arr['color_list'] = $var; echo json_encode($arr,JSON_PRETTY);
based on XHMP8
Output for 7.2.0
Warning: Use of undefined constant JSON_PRETTY - assumed 'JSON_PRETTY' (this will throw an Error in a future version of PHP) in /in/iMPDY on line 10 Warning: json_encode() expects parameter 2 to be integer, string given in /in/iMPDY on line 10
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant JSON_PRETTY - assumed 'JSON_PRETTY' in /in/iMPDY on line 10 Warning: json_encode() expects parameter 2 to be integer, string given in /in/iMPDY on line 10
Output for 5.5.0 - 5.6.28
Notice: Use of undefined constant JSON_PRETTY - assumed 'JSON_PRETTY' in /in/iMPDY on line 10 Warning: json_encode() expects parameter 2 to be long, string given in /in/iMPDY on line 10