3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '[]'; for ($i = 0; $i < 50000; $i++) $string = '[' . $string . ']'; $s = microtime(true); $result = json_decode($string); var_dump($result, json_last_error(), JSON_ERROR_DEPTH, round(microtime(true) - $s, 5)); var_dump(microtime(true) - $s);
Output for 7.2.0
NULL int(1) int(1) float(5.0E-5) float(8.3208084106445E-5)
Output for 7.1.7
NULL int(1) int(1) float(6.0E-5) float(8.8930130004883E-5)
Output for 7.1.6
NULL int(1) int(1) float(6.0E-5) float(9.2983245849609E-5)
Output for 7.1.5
NULL int(1) int(1) float(7.0E-5) float(0.00010180473327637)
Output for 7.1.0
NULL int(1) int(1) float(4.0E-5) float(7.3909759521484E-5)
Output for 7.0.20
NULL int(1) int(1) float(6.0E-5) float(8.9883804321289E-5)
Output for 7.0.14
NULL int(1) int(1) float(4.0E-5) float(6.0081481933594E-5)
Output for 7.0.6
NULL int(1) int(1) float(5.0E-5) float(7.6055526733398E-5)
Output for 7.0.5
NULL int(1) int(1) float(5.0E-5) float(7.7009201049805E-5)
Output for 7.0.4
NULL int(1) int(1) float(5.0E-5) float(8.5115432739258E-5)
Output for 7.0.3
NULL int(1) int(1) float(5.0E-5) float(8.4161758422852E-5)
Output for 7.0.2
NULL int(1) int(1) float(5.0E-5) float(7.7962875366211E-5)
Output for 7.0.1
NULL int(1) int(1) float(5.0E-5) float(8.2969665527344E-5)
Output for 7.0.0
NULL int(1) int(1) float(5.0E-5) float(8.1062316894531E-5)
Output for 5.6.28
NULL int(1) int(1) float(-0.00029) float(-0.00031113624572754)
Output for 5.6.21
NULL int(1) int(1) float(0.00037) float(0.0003969669342041)
Output for 5.6.20
NULL int(1) int(1) float(0.00035) float(0.0003821849822998)
Output for 5.6.19
NULL int(1) int(1) float(0.00036) float(0.00039911270141602)
Output for 5.6.18
NULL int(1) int(1) float(0.00035) float(0.0003960132598877)
Output for 5.4.35, 5.6.17
NULL int(1) int(1) float(0.00038) float(0.00041890144348145)
Output for 5.6.16
NULL int(1) int(1) float(0.00034) float(0.00038695335388184)
Output for 5.6.15
NULL int(1) int(1) float(0.00035) float(0.00038504600524902)
Output for 5.4.27, 5.6.14
NULL int(1) int(1) float(0.00034) float(0.00037598609924316)
Output for 5.6.13
NULL int(1) int(1) float(0.00037) float(0.00040483474731445)
Output for 5.6.12
NULL int(1) int(1) float(0.00034) float(0.00037789344787598)
Output for 5.6.10 - 5.6.11
NULL int(1) int(1) float(0.00034) float(0.00037384033203125)
Output for 5.4.28, 5.6.9
NULL int(1) int(1) float(0.00035) float(0.0003809928894043)
Output for 5.6.8
NULL int(1) int(1) float(0.00038) float(0.00041317939758301)
Output for 5.6.7
NULL int(1) int(1) float(0.00034) float(0.00037097930908203)
Output for 5.5.35
NULL int(1) int(1) float(0.00034) float(0.00036120414733887)
Output for 5.5.34
NULL int(1) int(1) float(0.00034) float(0.00038003921508789)
Output for 5.4.24, 5.5.33
NULL int(1) int(1) float(0.00035) float(0.00038814544677734)
Output for 5.5.32
NULL int(1) int(1) float(0.00035) float(0.00039505958557129)
Output for 5.5.31
NULL int(1) int(1) float(0.00037) float(0.00041580200195312)
Output for 5.5.30
NULL int(1) int(1) float(0.00035) float(0.0003819465637207)
Output for 5.5.29
NULL int(1) int(1) float(0.00036) float(0.00039482116699219)
Output for 5.4.10, 5.5.28
NULL int(1) int(1) float(0.00036) float(0.00039100646972656)
Output for 5.5.27
NULL int(1) int(1) float(0.00037) float(0.00040411949157715)
Output for 5.4.9, 5.5.26
NULL int(1) int(1) float(0.00036) float(0.00039291381835938)
Output for 5.5.25
NULL int(1) int(1) float(0.0006) float(0.0006561279296875)
Output for 5.5.24
NULL int(1) int(1) float(0.00034) float(0.00036311149597168)
Output for 5.4.45
NULL int(1) int(1) float(0.00036) float(0.0003969669342041)
Output for 5.4.44
NULL int(1) int(1) float(0.00033) float(0.0003659725189209)
Output for 5.4.23, 5.4.43
NULL int(1) int(1) float(0.00034) float(0.00038409233093262)
Output for 5.4.42
NULL int(1) int(1) float(0.00034) float(0.0003821849822998)
Output for 5.4.41
NULL int(1) int(1) float(0.00034) float(0.00039386749267578)
Output for 5.4.3, 5.4.40
NULL int(1) int(1) float(0.00035) float(0.00038790702819824)
Output for 5.4.39
NULL int(1) int(1) float(0.00034) float(0.00039100646972656)
Output for 5.4.26, 5.4.38
NULL int(1) int(1) float(0.00034) float(0.00038504600524902)
Output for 5.4.16, 5.4.37
NULL int(1) int(1) float(0.00034) float(0.00038385391235352)
Output for 5.4.36
NULL int(1) int(1) float(0.00037) float(0.00040698051452637)
Output for 5.4.34
NULL int(1) int(1) float(0.00037) float(0.00040888786315918)
Output for 5.4.32
NULL int(1) int(1) float(0.00034) float(0.00038313865661621)
Output for 5.4.31
NULL int(1) int(1) float(0.00059) float(0.00063419342041016)
Output for 5.4.30
NULL int(1) int(1) float(0.00034) float(0.0003809928894043)
Output for 5.4.29
NULL int(1) int(1) float(0.00037) float(0.0004119873046875)
Output for 5.4.25
NULL int(1) int(1) float(0.00061) float(0.00066494941711426)
Output for 5.4.22
NULL int(1) int(1) float(0.00034) float(0.00037193298339844)
Output for 5.4.21
NULL int(1) int(1) float(0.00035) float(0.00039100646972656)
Output for 5.4.20
NULL int(1) int(1) float(0.00034) float(0.00039005279541016)
Output for 5.4.19
NULL int(1) int(1) float(0.00034) float(0.00038719177246094)
Output for 5.4.1, 5.4.18
NULL int(1) int(1) float(0.00035) float(0.00038719177246094)
Output for 5.4.17
NULL int(1) int(1) float(0.00035) float(0.00039315223693848)
Output for 5.4.15
NULL int(1) int(1) float(0.00034) float(0.00037813186645508)
Output for 5.4.14
NULL int(1) int(1) float(0.00034) float(0.00038480758666992)
Output for 5.4.13
NULL int(1) int(1) float(0.00045) float(0.00050616264343262)
Output for 5.4.12
NULL int(1) int(1) float(0.00034) float(0.00038814544677734)
Output for 5.4.5, 5.4.11
NULL int(1) int(1) float(0.00035) float(0.00038599967956543)
Output for 5.4.8
NULL int(1) int(1) float(0.00035) float(0.00039196014404297)
Output for 5.4.7
NULL int(1) int(1) float(0.00036) float(0.00039505958557129)
Output for 5.4.6
NULL int(1) int(1) float(0.00035) float(0.00039005279541016)
Output for 5.4.4
NULL int(1) int(1) float(0.00054) float(0.00058794021606445)
Output for 5.4.2
NULL int(1) int(1) float(0.00036) float(0.00039386749267578)
Output for 5.4.0
NULL int(1) int(1) float(0.00043) float(0.00046491622924805)
Output for 5.3.29
NULL int(1) int(1) float(0.00071) float(0.00075912475585938)
Output for 5.3.28
NULL int(1) int(1) float(0.00042) float(0.0004570484161377)
Output for 5.3.27
NULL int(1) int(1) float(0.00042) float(0.00045514106750488)
Output for 5.3.0, 5.3.26
NULL int(1) int(1) float(0.00041) float(0.00043702125549316)
Output for 5.3.25
NULL int(1) int(1) float(0.00042) float(0.00044798851013184)
Output for 5.3.24
NULL int(1) int(1) float(0.00042) float(0.0004580020904541)
Output for 5.3.23
NULL int(1) int(1) float(0.00043) float(0.00046706199645996)
Output for 5.3.22
NULL int(1) int(1) float(0.00046) float(0.00049901008605957)
Output for 5.3.21
NULL int(1) int(1) float(0.00052) float(0.00055789947509766)
Output for 5.3.20
NULL int(1) int(1) float(0.00047) float(0.00050711631774902)
Output for 5.3.19
NULL int(1) int(1) float(0.00042) float(0.00045180320739746)
Output for 5.3.18
NULL int(1) int(1) float(0.00042) float(0.00045108795166016)
Output for 5.3.17
NULL int(1) int(1) float(0.00043) float(0.00046086311340332)
Output for 5.3.16
NULL int(1) int(1) float(0.00043) float(0.00046205520629883)
Output for 5.3.15
NULL int(1) int(1) float(0.00043) float(0.00045895576477051)
Output for 5.3.14
NULL int(1) int(1) float(0.00044) float(0.00046706199645996)
Output for 5.3.13
NULL int(1) int(1) float(0.00046) float(0.00049591064453125)
Output for 5.3.11 - 5.3.12
NULL int(1) int(1) float(0.00043) float(0.0004570484161377)
Output for 5.3.10
NULL int(1) int(1) float(0.00036) float(0.00038981437683105)
Output for 5.3.9
NULL int(1) int(1) float(0.00039) float(0.00042915344238281)
Output for 5.3.8
NULL int(1) int(1) float(0.00037) float(0.00040507316589355)
Output for 5.3.7
NULL int(1) int(1) float(0.00039) float(0.00042200088500977)
Output for 5.3.6
NULL int(1) int(1) float(0.00038) float(0.00041103363037109)
Output for 5.3.5
NULL int(1) int(1) float(0.00039) float(0.00041604042053223)
Output for 5.3.4
NULL int(1) int(1) float(0.0006) float(0.00063014030456543)
Output for 5.3.3
NULL int(1) int(1) float(0.00039) float(0.00041794776916504)
Output for 5.3.1 - 5.3.2
NULL int(1) int(1) float(0.00039) float(0.00042104721069336)
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function json_last_error() in /in/YbVHe on line 12
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/YbVHe on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/YbVHe on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/YbVHe on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/YbVHe on line 10