3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "'string'\n"; $r = json_decode("'string'"); var_dump($r, json_last_error(), json_last_error_msg()); echo "\"string\"\n"; $r = json_decode("\"string\""); var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "100\n"; $r = json_decode("100"); // int var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "1.\n"; $r = json_decode("1."); // float var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "1.0\n"; $r = json_decode("1.0"); // float var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo ".5\n"; $r = json_decode(".5"); // float var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "true\n"; $r = json_decode("true"); // bool var_dump($r, json_last_error(), json_last_error_msg());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0210.00016.38
8.3.50.0120.00617.96
8.3.40.0110.00418.71
8.3.30.0110.00418.57
8.3.20.0040.00420.33
8.3.10.0040.00423.60
8.3.00.0090.00019.85
8.2.180.0150.00616.75
8.2.170.0070.00722.96
8.2.160.0120.00920.31
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00021.00
8.2.120.0030.00526.35
8.2.110.0050.00320.18
8.2.100.0090.00318.04
8.2.90.0000.00819.26
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0040.00418.04
8.2.50.0000.00918.07
8.2.40.0000.00822.27
8.2.30.0040.00420.58
8.2.20.0000.00717.57
8.2.10.0050.00218.03
8.2.00.0040.00417.88
8.1.280.0070.00725.92
8.1.270.0160.00320.32
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0050.00522.02
8.1.230.0040.00817.66
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0060.00317.22
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0030.00618.51
8.1.160.0000.00720.63
8.1.150.0040.00418.80
8.1.140.0040.00419.46
8.1.130.0070.00017.69
8.1.120.0070.00017.41
8.1.110.0030.00617.32
8.1.100.0040.00417.45
8.1.90.0060.00317.31
8.1.80.0040.00417.36
8.1.70.0000.00717.32
8.1.60.0000.00817.52
8.1.50.0080.00017.38
8.1.40.0060.00317.47
8.1.30.0040.00417.64
8.1.20.0030.00617.53
8.1.10.0040.00417.58
8.1.00.0000.00717.41
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0070.00018.46
8.0.270.0070.00017.27
8.0.260.0060.00017.27
8.0.250.0000.00716.92
8.0.240.0030.00316.92
8.0.230.0080.00016.93
8.0.220.0030.00316.80
8.0.210.0050.00216.82
8.0.200.0000.00616.79
8.0.190.0080.00016.88
8.0.180.0000.00816.95
8.0.170.0040.00416.89
8.0.160.0070.00016.87
8.0.150.0040.00416.78
8.0.140.0000.00716.80
8.0.130.0000.00513.29
8.0.120.0000.00816.71
8.0.110.0040.00416.71
8.0.100.0000.00716.73
8.0.90.0070.00016.86
8.0.80.0040.01516.88
8.0.70.0040.00416.88
8.0.60.0000.00716.64
8.0.50.0040.00416.64
8.0.30.0100.00917.07
8.0.20.0140.00417.40
8.0.10.0040.00417.02
8.0.00.0080.01016.65
7.4.330.0000.00616.66
7.4.320.0030.00316.60
7.4.300.0030.00316.54
7.4.290.0040.00416.38
7.4.280.0070.00316.35
7.4.270.0000.00716.44
7.4.260.0030.00316.43
7.4.250.0000.00716.56
7.4.240.0020.00516.47
7.4.230.0040.00416.57
7.4.220.0180.00016.41
7.4.210.0000.01416.40
7.4.200.0030.00316.30
7.4.160.0120.00316.41
7.4.150.0080.01117.40
7.4.140.0080.01417.86
7.4.130.0100.00716.49
7.4.120.0070.01116.56
7.4.110.0170.00716.33
7.4.100.0090.00916.33
7.4.90.0100.01416.62
7.4.80.0040.01319.39
7.4.70.0100.01216.42
7.4.60.0060.01016.38
7.4.50.0040.01116.48
7.4.40.0110.00516.43
7.4.30.0120.00716.46
7.4.00.0080.00414.99
7.3.330.0040.00413.00
7.3.320.0080.00012.83
7.3.310.0070.00016.08
7.3.300.0000.00716.01
7.3.290.0070.01016.14
7.3.280.0120.00516.15
7.3.270.0090.00917.40
7.3.260.0090.01116.26
7.3.250.0100.00916.09
7.3.240.0100.00816.36
7.3.230.0060.01316.55
7.3.210.0060.01316.21
7.3.200.0150.00816.34
7.3.190.0150.00316.37
7.3.180.0090.00616.30
7.3.170.0090.01116.54
7.3.160.0080.00816.16
7.3.120.0060.00917.15
7.3.110.0070.00717.15
7.3.100.0070.01017.15
7.3.90.0040.01117.15
7.3.80.0040.01117.15
7.3.70.0060.00617.15
7.3.60.0070.00417.15
7.3.50.0060.00617.15
7.3.40.0030.01017.15
7.3.30.0070.00317.15
7.3.20.0030.00917.15
7.3.10.0090.00617.15
7.3.00.0040.01117.15
7.2.330.0140.00716.39
7.2.320.0100.01016.64
7.2.310.0120.00616.27
7.2.300.0090.00916.58
7.2.290.0130.01016.57
7.2.240.0090.00617.15
7.2.230.0060.00917.15
7.2.220.0040.01117.15
7.2.210.0070.01017.15
7.2.200.0030.01017.15
7.2.190.0120.00317.15
7.2.180.0040.00817.15
7.2.170.0040.01217.15
7.2.160.0120.00617.15
7.2.150.0070.00717.15
7.2.140.0030.00917.15
7.2.130.0090.00017.15
7.2.120.0060.00816.87
7.2.110.0040.00916.94
7.2.100.0080.00716.71
7.2.90.0050.00616.85
7.2.80.0020.01216.89
7.2.70.0020.01317.04
7.2.60.0050.00916.91
7.2.50.0050.00817.03
7.2.40.0040.00916.79
7.2.30.0050.00817.02
7.2.20.0050.00616.95
7.2.10.0050.01016.95
7.2.00.0100.00417.62
7.1.330.0120.00317.15
7.1.320.0060.01017.15
7.1.310.0030.00617.15
7.1.300.0000.01217.15
7.1.290.0040.00817.15
7.1.280.0040.01117.15
7.1.270.0070.01017.15
7.1.260.0090.00617.15
7.1.250.0110.00017.15
7.1.240.0030.01015.77
7.1.230.0030.01015.49
7.1.220.0070.00715.76
7.1.210.0100.00315.73
7.1.200.0090.00615.77
7.1.190.0080.00415.47
7.1.180.0100.00015.72
7.1.170.0100.00315.75
7.1.160.0070.00315.63
7.1.150.0000.00815.84
7.1.140.0110.00415.79
7.1.130.0030.00715.46
7.1.120.0030.01315.78
7.1.110.0030.00915.69
7.1.100.0050.01116.94
7.1.90.0070.00715.80
7.1.80.0100.00615.63
7.1.70.0050.00516.31
7.1.60.0070.01217.36
7.1.50.0060.01116.18
7.1.40.0000.00915.64
7.1.30.0060.00615.69
7.1.20.0030.00615.71
7.1.10.0070.00715.56
7.1.00.0030.04319.04
7.0.320.0040.01215.27
7.0.310.0030.00715.47
7.0.300.0090.00615.54
7.0.290.0100.00315.38
7.0.280.0070.00715.33
7.0.270.0030.00715.48
7.0.260.0080.00415.24
7.0.250.0090.00315.27
7.0.240.0120.00015.20
7.0.230.0120.00015.50
7.0.220.0030.01015.15
7.0.210.0030.00715.47
7.0.200.0000.00915.96
7.0.190.0080.00415.21
7.0.180.0000.01615.46
7.0.170.0070.00715.44
7.0.160.0060.00615.13
7.0.150.0030.01015.21
7.0.140.0070.00715.36
7.0.130.0000.01315.29
7.0.120.0030.00515.30
7.0.110.0040.00415.29
7.0.100.0040.01115.38
7.0.90.0000.01315.46
7.0.80.0090.00615.30
7.0.70.0030.01015.53
7.0.60.0030.03117.58
7.0.50.0070.03716.55
7.0.40.0040.03116.53
7.0.30.0150.04416.73
7.0.20.0130.02916.85
7.0.10.0030.02616.84
7.0.00.0090.04116.87
5.6.380.0040.00414.11
5.6.370.0040.01114.08
5.6.360.0000.00914.19
5.6.350.0080.00614.18
5.6.340.0040.00814.42
5.6.330.0040.00814.31
5.6.320.0040.00714.42
5.6.310.0030.00614.11
5.6.300.0110.00414.00
5.6.290.0100.00313.92
5.6.280.0050.04017.66
5.6.270.0030.01014.26
5.6.260.0070.00714.05
5.6.250.0080.00414.06
5.6.240.0000.01114.24
5.6.230.0070.00714.09
5.6.220.0040.00714.32
5.6.210.0060.02417.35
5.6.200.0080.04516.14
5.6.190.0090.04417.27
5.6.180.1820.02817.28
5.6.170.0140.04217.54
5.6.160.0050.04717.31
5.6.150.0070.03816.25
5.6.140.0060.02316.13
5.6.130.0050.04716.26
5.6.120.0030.04817.89
5.6.110.0050.04817.59
5.6.100.0050.03917.59
5.6.90.0020.04517.77
5.6.80.0080.03717.23
5.6.70.0040.00414.36
5.6.60.0000.01314.14
5.6.50.0000.01413.91
5.6.40.0030.00914.18
5.6.30.0060.00914.11
5.6.20.0030.00614.46
5.6.10.0110.00013.89
5.6.00.0070.01014.10
5.5.380.0000.00611.27
5.5.370.0000.00711.27
5.5.360.0060.00611.27
5.5.350.0050.03515.83
5.5.340.0070.02014.62
5.5.330.0030.04115.83
5.5.320.0190.03815.79
5.5.310.0120.02315.73
5.5.300.0080.02514.59
5.5.290.0100.04314.64
5.5.280.0100.04216.12
5.5.270.0040.02015.96
5.5.260.0050.04416.01
5.5.250.0080.03315.93
5.5.240.0160.03815.77
5.5.230.0030.00611.27
5.5.220.0090.00311.27
5.5.210.0080.00011.27
5.5.200.0060.00311.27
5.5.190.0030.01011.27
5.5.180.0060.00611.27
5.5.170.0000.01213.84
5.5.160.0090.00011.27
5.5.150.0040.00811.27
5.5.140.0100.00011.27
5.5.130.0070.00711.27
5.5.120.0070.00411.27
5.5.110.0120.00011.27
5.5.100.0040.00411.27
5.5.90.0110.00011.27
5.5.80.0070.00411.27
5.5.70.0070.00311.27
5.5.60.0060.00311.27
5.5.50.0070.00011.27
5.5.40.0040.00711.27
5.5.30.0000.01111.27
5.5.20.0110.00011.27
5.5.10.0000.01111.27
5.5.00.0060.00611.27

preferences:
60.85 ms | 400 KiB | 5 Q