3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array ( 1 => array ( 'index' => 0, 'codec_name' => 'h264', 'codec_long_name' => 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10', 'profile' => 'Constrained Baseline', 'codec_type' => 'video', 'codec_time_base' => '1/5000', 'codec_tag_string' => 'avc1', 'codec_tag' => '0x31637661', 'width' => 480, 'height' => 272, 'has_b_frames' => 0, 'sample_aspect_ratio' => '0:1', 'display_aspect_ratio' => '0:1', 'pix_fmt' => 'yuv420p', 'level' => 21, 'timecode' => 'N/A', 'id' => 'N/A', 'r_frame_rate' => '25/1', 'avg_frame_rate' => '25/1', 'time_base' => '1/2500', 'start_pts' => 0, 'start_time' => '0.000000', 'duration_ts' => 25000, 'duration' => '10.000000', 'bit_rate' => 677610, 'nb_frames' => 250, 'nb_read_frames' => 'N/A', 'nb_read_packets' => 'N/A', 'DISPOSITION:default' => 0, 'DISPOSITION:dub' => 0, 'DISPOSITION:original' => 0, 'DISPOSITION:comment' => 0, 'DISPOSITION:lyrics' => 0, 'DISPOSITION:karaoke' => 0, 'DISPOSITION:forced' => 0, 'DISPOSITION:hearing_impaired' => 0, 'DISPOSITION:visual_impaired' => 0, 'DISPOSITION:clean_effects' => 0, 'DISPOSITION:attached_pic' => 0, 'TAG:creation_time' => '2011-06-13 13:28:54', 'TAG:language' => 'eng', 'TAG:handler_name' => 'Module de gestion vid?o', ), 2 => array ( 'index' => 1, 'codec_name' => 'aac', 'codec_long_name' => 'AAC (Advanced Audio Coding)', 'profile' => 'unknown', 'codec_type' => 'audio', 'codec_time_base' => '1/44100', 'codec_tag_string' => 'mp4a', 'codec_tag' => '0x6134706d', 'sample_fmt' => 'fltp', 'sample_rate' => 44100, 'channels' => 2, 'bits_per_sample' => 0, 'id' => 'N/A', 'r_frame_rate' => '0/0', 'avg_frame_rate' => '0/0', 'time_base' => '1/44100', 'start_pts' => 0, 'start_time' => '0.000000', 'duration_ts' => 441344, 'duration' => '10.007800', 'bit_rate' => 122597, 'nb_frames' => 431, 'nb_read_frames' => 'N/A', 'nb_read_packets' => 'N/A', 'DISPOSITION:default' => 0, 'DISPOSITION:dub' => 0, 'DISPOSITION:original' => 0, 'DISPOSITION:comment' => 0, 'DISPOSITION:lyrics' => 0, 'DISPOSITION:karaoke' => 0, 'DISPOSITION:forced' => 0, 'DISPOSITION:hearing_impaired' => 0, 'DISPOSITION:visual_impaired' => 0, 'DISPOSITION:clean_effects' => 0, 'DISPOSITION:attached_pic' => 0, 'TAG:creation_time' => '2011-06-13 13:28:54', 'TAG:language' => 'eng', 'TAG:handler_name' => 'Module de gestion sonore', ), ); var_dump(json_encode($a)); var_dump(json_encode(array_values($a)));
Output for 5.2.0 - 7.1.0
string(1943) "{"1":{"index":0,"codec_name":"h264","codec_long_name":"H.264 \/ AVC \/ MPEG-4 AVC \/ MPEG-4 part 10","profile":"Constrained Baseline","codec_type":"video","codec_time_base":"1\/5000","codec_tag_string":"avc1","codec_tag":"0x31637661","width":480,"height":272,"has_b_frames":0,"sample_aspect_ratio":"0:1","display_aspect_ratio":"0:1","pix_fmt":"yuv420p","level":21,"timecode":"N\/A","id":"N\/A","r_frame_rate":"25\/1","avg_frame_rate":"25\/1","time_base":"1\/2500","start_pts":0,"start_time":"0.000000","duration_ts":25000,"duration":"10.000000","bit_rate":677610,"nb_frames":250,"nb_read_frames":"N\/A","nb_read_packets":"N\/A","DISPOSITION:default":0,"DISPOSITION:dub":0,"DISPOSITION:original":0,"DISPOSITION:comment":0,"DISPOSITION:lyrics":0,"DISPOSITION:karaoke":0,"DISPOSITION:forced":0,"DISPOSITION:hearing_impaired":0,"DISPOSITION:visual_impaired":0,"DISPOSITION:clean_effects":0,"DISPOSITION:attached_pic":0,"TAG:creation_time":"2011-06-13 13:28:54","TAG:language":"eng","TAG:handler_name":"Module de gestion vid?o"},"2":{"index":1,"codec_name":"aac","codec_long_name":"AAC (Advanced Audio Coding)","profile":"unknown","codec_type":"audio","codec_time_base":"1\/44100","codec_tag_string":"mp4a","codec_tag":"0x6134706d","sample_fmt":"fltp","sample_rate":44100,"channels":2,"bits_per_sample":0,"id":"N\/A","r_frame_rate":"0\/0","avg_frame_rate":"0\/0","time_base":"1\/44100","start_pts":0,"start_time":"0.000000","duration_ts":441344,"duration":"10.007800","bit_rate":122597,"nb_frames":431,"nb_read_frames":"N\/A","nb_read_packets":"N\/A","DISPOSITION:default":0,"DISPOSITION:dub":0,"DISPOSITION:original":0,"DISPOSITION:comment":0,"DISPOSITION:lyrics":0,"DISPOSITION:karaoke":0,"DISPOSITION:forced":0,"DISPOSITION:hearing_impaired":0,"DISPOSITION:visual_impaired":0,"DISPOSITION:clean_effects":0,"DISPOSITION:attached_pic":0,"TAG:creation_time":"2011-06-13 13:28:54","TAG:language":"eng","TAG:handler_name":"Module de gestion sonore"}}" string(1935) "[{"index":0,"codec_name":"h264","codec_long_name":"H.264 \/ AVC \/ MPEG-4 AVC \/ MPEG-4 part 10","profile":"Constrained Baseline","codec_type":"video","codec_time_base":"1\/5000","codec_tag_string":"avc1","codec_tag":"0x31637661","width":480,"height":272,"has_b_frames":0,"sample_aspect_ratio":"0:1","display_aspect_ratio":"0:1","pix_fmt":"yuv420p","level":21,"timecode":"N\/A","id":"N\/A","r_frame_rate":"25\/1","avg_frame_rate":"25\/1","time_base":"1\/2500","start_pts":0,"start_time":"0.000000","duration_ts":25000,"duration":"10.000000","bit_rate":677610,"nb_frames":250,"nb_read_frames":"N\/A","nb_read_packets":"N\/A","DISPOSITION:default":0,"DISPOSITION:dub":0,"DISPOSITION:original":0,"DISPOSITION:comment":0,"DISPOSITION:lyrics":0,"DISPOSITION:karaoke":0,"DISPOSITION:forced":0,"DISPOSITION:hearing_impaired":0,"DISPOSITION:visual_impaired":0,"DISPOSITION:clean_effects":0,"DISPOSITION:attached_pic":0,"TAG:creation_time":"2011-06-13 13:28:54","TAG:language":"eng","TAG:handler_name":"Module de gestion vid?o"},{"index":1,"codec_name":"aac","codec_long_name":"AAC (Advanced Audio Coding)","profile":"unknown","codec_type":"audio","codec_time_base":"1\/44100","codec_tag_string":"mp4a","codec_tag":"0x6134706d","sample_fmt":"fltp","sample_rate":44100,"channels":2,"bits_per_sample":0,"id":"N\/A","r_frame_rate":"0\/0","avg_frame_rate":"0\/0","time_base":"1\/44100","start_pts":0,"start_time":"0.000000","duration_ts":441344,"duration":"10.007800","bit_rate":122597,"nb_frames":431,"nb_read_frames":"N\/A","nb_read_packets":"N\/A","DISPOSITION:default":0,"DISPOSITION:dub":0,"DISPOSITION:original":0,"DISPOSITION:comment":0,"DISPOSITION:lyrics":0,"DISPOSITION:karaoke":0,"DISPOSITION:forced":0,"DISPOSITION:hearing_impaired":0,"DISPOSITION:visual_impaired":0,"DISPOSITION:clean_effects":0,"DISPOSITION:attached_pic":0,"TAG:creation_time":"2011-06-13 13:28:54","TAG:language":"eng","TAG:handler_name":"Module de gestion sonore"}]"
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/GiMqu on line 92
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/GiMqu on line 92
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/GiMqu on line 92
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/GiMqu on line 92