3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isJson($string, $assoc = false) { var_dump(json_decode($string)); if(is_string($string)) { json_decode($string, $assoc); return (json_last_error() == JSON_ERROR_NONE); // return json_decode($str) != null; } return false; } $a=['arraiii'=>['dentro'=>234]]; $b=json_encode($a); $c='{ "book": [ { "id":"01", "language": "Java", "edition": "third", "author": "Herbert Schildt" }, { "id":"07", "language": "C++", "edition": "second" "author": "E.Balagurusamy" }] }'; var_dump(isJson($c));

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.0110.00618.31
8.3.50.0100.00722.05
8.3.40.0070.01118.84
8.3.30.0070.00720.36
8.3.20.0000.00720.25
8.3.10.0040.00421.87
8.3.00.0040.01122.37
8.2.180.0090.00616.38
8.2.170.0070.00722.96
8.2.160.0110.00322.08
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0040.00420.70
8.2.110.0060.00322.27
8.2.100.0070.00417.78
8.2.90.0090.00019.27
8.2.80.0040.00419.21
8.2.70.0050.00517.50
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0040.00419.77
8.2.30.0070.00019.47
8.2.20.0000.00717.60
8.2.10.0040.00417.59
8.2.00.0000.00817.61
8.1.280.0120.00925.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0000.00923.87
8.1.230.0070.00419.21
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0090.00017.13
8.1.190.0030.00617.26
8.1.180.0050.00319.01
8.1.170.0090.00018.58
8.1.160.0000.00720.68
8.1.150.0000.00718.59
8.1.140.0040.00417.33
8.1.130.0030.00317.75
8.1.120.0040.00417.51
8.1.110.0000.00717.47
8.1.100.0060.00317.50
8.1.90.0000.00717.46
8.1.80.0050.00317.52
8.1.70.0000.00817.48
8.1.60.0040.00417.57
8.1.50.0040.00417.57
8.1.40.0000.00817.51
8.1.30.0040.00417.59
8.1.20.0050.00317.57
8.1.10.0050.00217.30
8.1.00.0030.00717.38
8.0.300.0050.00218.77
8.0.290.0030.00517.05
8.0.280.0030.00318.30
8.0.270.0030.00317.15
8.0.260.0030.00316.79
8.0.250.0030.00416.77
8.0.240.0000.00816.75
8.0.230.0040.00416.95
8.0.220.0050.00216.93
8.0.210.0000.00716.81
8.0.200.0000.00616.88
8.0.190.0070.00016.89
8.0.180.0000.01016.74
8.0.170.0040.00416.85
8.0.160.0000.00816.85
8.0.150.0070.00316.75
8.0.140.0040.00416.70
8.0.130.0030.00313.29
8.0.120.0040.00416.79
8.0.110.0000.00816.96
8.0.100.0070.00016.71
8.0.90.0090.00016.76
8.0.80.0070.01016.87
8.0.70.0000.00816.84
8.0.60.0080.00016.78
8.0.50.0030.00516.74
8.0.30.0130.00816.96
8.0.20.0110.01217.40
8.0.10.0000.00716.99
8.0.00.0100.01216.85
7.4.330.0000.00515.00
7.4.320.0030.00516.52
7.4.300.0030.00316.48
7.4.290.0040.00416.49
7.4.280.0030.00316.54
7.4.270.0070.00016.54
7.4.260.0060.00013.29
7.4.250.0060.00316.46
7.4.240.0040.00416.46
7.4.230.0000.00716.40
7.4.220.0090.00916.53
7.4.210.0070.00716.56
7.4.200.0030.00416.70
7.4.190.0040.00416.50
7.4.160.0170.00016.23
7.4.150.0060.01117.40
7.4.140.0090.01117.86
7.4.130.0110.00616.59
7.4.120.0080.01216.51
7.4.110.0090.00916.48
7.4.100.0080.01216.35
7.4.90.0090.01016.53
7.4.80.0090.00919.39
7.4.70.0090.01216.46
7.4.60.0100.00616.40
7.4.50.0050.00316.41
7.4.40.0060.00922.77
7.4.30.0120.00616.56
7.4.00.0100.00614.91
7.3.330.0000.00513.19
7.3.320.0030.00313.23
7.3.310.0030.00616.13
7.3.300.0030.00316.11
7.3.290.0030.01116.23
7.3.280.0090.00716.26
7.3.270.0090.00917.40
7.3.260.0120.00616.26
7.3.250.0080.01116.40
7.3.240.0040.01216.31
7.3.230.0130.00316.43
7.3.210.0100.00616.50
7.3.200.0030.01419.39
7.3.190.0190.00316.30
7.3.180.0100.00816.26
7.3.170.0070.01316.27
7.3.160.0110.00716.48
7.3.120.0060.00914.63
7.2.330.0080.00816.64
7.2.320.0130.01016.64
7.2.310.0110.00616.73
7.2.300.0140.00316.71
7.2.290.0190.00716.65
7.1.70.0030.00517.14
7.1.60.0160.00719.32
7.1.50.0060.00616.86
7.1.00.0030.04722.45
7.0.200.0070.00416.89
7.0.140.0070.07022.18
7.0.90.0400.03719.89
7.0.80.0200.03319.85
7.0.70.0400.05019.89
7.0.60.0270.05719.97
7.0.50.0370.04720.29
7.0.40.0130.07320.10
7.0.30.0030.04320.19
7.0.20.0100.04020.15
7.0.10.0100.06720.13
7.0.00.0000.04720.09
5.6.280.0000.07720.86
5.6.240.0030.04020.61
5.6.230.0100.04020.63
5.6.220.0070.03720.50
5.6.210.0030.04020.47
5.6.200.0070.04020.96
5.6.190.0000.04721.08
5.6.180.0030.05021.14
5.6.170.0100.03721.14
5.6.160.0030.04021.02
5.6.150.0100.03320.94
5.6.140.0000.04721.13
5.6.130.0100.03721.04
5.6.120.0000.06020.96
5.6.110.0030.04321.07
5.6.100.0000.08321.04
5.6.90.0030.05321.09
5.6.80.0100.08020.50
5.6.70.0030.07020.39
5.6.60.0030.08720.49
5.6.50.0230.07320.46
5.6.40.0070.04020.41
5.6.30.0100.06320.39
5.6.20.0100.07720.43
5.6.10.0100.07320.43
5.6.00.0070.08720.45
5.5.380.0030.04020.39
5.5.370.0000.05320.38
5.5.360.0000.04020.34
5.5.350.0100.06320.43
5.5.340.0030.04020.84
5.5.330.0030.04020.89
5.5.320.0030.03720.75
5.5.310.0030.04020.60
5.5.300.0030.04020.64
5.5.290.0030.04320.93
5.5.280.0070.04020.84
5.5.270.0070.05320.79
5.5.260.0000.04720.79
5.5.250.0030.04020.69
5.5.240.0070.08320.28
5.5.230.0170.07320.30
5.5.220.0170.06320.29
5.5.210.0100.06720.30
5.5.200.0100.07320.24
5.5.190.0030.08720.12
5.5.180.0100.07320.09
5.5.160.0030.05020.26
5.5.150.0200.07320.27
5.5.140.0100.08020.12
5.5.130.0030.05720.23
5.5.120.0030.08020.27
5.5.110.0030.08320.03
5.5.100.0030.05320.16
5.5.90.0130.04720.07
5.5.80.0070.06320.13
5.5.70.0000.08320.09
5.5.60.0170.06319.96
5.5.50.0130.08020.13
5.5.40.0070.05720.09
5.5.30.0100.07720.14
5.5.20.0100.04720.13
5.5.10.0130.07720.03
5.5.00.0070.07020.03
5.4.450.0070.07019.56
5.4.440.0030.03719.51
5.4.430.0030.06019.45
5.4.420.0030.03319.45
5.4.410.0100.06319.20
5.4.400.0070.04018.91
5.4.390.0070.06719.12
5.4.380.0070.08019.09
5.4.370.0100.04319.23
5.4.360.0070.07719.10
5.4.350.0000.07719.18
5.4.340.0130.07319.13
5.4.320.0070.05019.13
5.4.310.0100.06019.04
5.4.300.0070.07318.94
5.4.290.0070.08018.88
5.4.280.0070.07019.16
5.4.270.0170.06318.84
5.4.260.0100.05719.13
5.4.250.0070.06018.89
5.4.240.0200.05318.95
5.4.230.0070.05719.20
5.4.220.0030.07019.12
5.4.210.0100.07018.90
5.4.200.0070.07318.89
5.4.190.0100.07319.03
5.4.180.0070.07019.11
5.4.170.0100.07019.03
5.4.160.0100.06719.11
5.4.150.0130.04019.23
5.4.140.0030.07716.29
5.4.130.0000.06716.20
5.4.120.0130.06316.38
5.4.110.0070.07016.32
5.4.100.0030.07716.42
5.4.90.0070.08016.49
5.4.80.0070.07016.45
5.4.70.0130.04016.49
5.4.60.0100.07716.47
5.4.50.0000.04016.33
5.4.40.0000.04316.54
5.4.30.0070.03316.33
5.4.20.0100.07016.48
5.4.10.0100.04316.41
5.4.00.0070.03715.83
5.3.290.0070.06714.61
5.3.280.0030.08014.55
5.3.270.0070.08014.58
5.3.260.0070.07314.66
5.3.250.0070.06014.54
5.3.240.0000.08014.71
5.3.230.0100.07314.61
5.3.220.0030.07014.62
5.3.210.0100.04014.66
5.3.200.0070.08014.50
5.3.190.0170.06014.61
5.3.180.0000.05014.58
5.3.170.0070.03714.48
5.3.160.0030.04714.68
5.3.150.0130.05014.57
5.3.140.0000.04714.65
5.3.130.0000.04314.52
5.3.120.0030.08014.47
5.3.110.0070.05314.61
5.3.100.0130.07314.15
5.3.90.0000.08014.11
5.3.80.0030.08014.13
5.3.70.0100.07314.02
5.3.60.0030.05713.92
5.3.50.0070.06013.96
5.3.40.0070.07314.07
5.3.30.0100.07313.84
5.3.20.0070.04313.77
5.3.10.0000.06713.80
5.3.00.0000.08313.55
5.2.170.0000.04311.20
5.2.160.0000.05311.27
5.2.150.0000.06011.20
5.2.140.0030.06311.25
5.2.130.0030.04311.01
5.2.120.0000.06711.02
5.2.110.0030.05010.98
5.2.100.0000.05010.98
5.2.90.0070.06011.17
5.2.80.0030.05311.01
5.2.70.0070.06011.00
5.2.60.0000.06311.03
5.2.50.0100.05311.06
5.2.40.0030.06011.11
5.2.30.0030.06311.00
5.2.20.0130.05311.01
5.2.10.0030.06311.00
5.2.00.0070.05710.67
5.1.60.0130.0339.98
5.1.50.0070.0539.98
5.1.40.0000.0609.97
5.1.30.0070.05010.39
5.1.20.0200.04710.27
5.1.10.0100.04710.06
5.1.00.0070.05310.13
5.0.50.0000.0378.38
5.0.40.0030.0338.48
5.0.30.0000.0608.32
5.0.20.0030.0378.27
5.0.10.0000.0408.25
5.0.00.0070.0578.15
4.4.90.0030.0377.69
4.4.80.0030.0237.69
4.4.70.0070.0237.69
4.4.60.0030.0337.69
4.4.50.0070.0307.69
4.4.40.0030.0577.69
4.4.30.0070.0307.69
4.4.20.0070.0307.69
4.4.10.0000.0277.69
4.4.00.0070.0507.69
4.3.110.0000.0277.69
4.3.100.0070.0237.69
4.3.90.0070.0337.69
4.3.80.0070.0477.69
4.3.70.0000.0377.69
4.3.60.0000.0277.69
4.3.50.0000.0277.69
4.3.40.0030.0277.69
4.3.30.0030.0237.69
4.3.20.0030.0377.69
4.3.10.0000.0377.69
4.3.00.0030.0307.69

preferences:
44.93 ms | 401 KiB | 5 Q