3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass implements JsonSerializable { public function jsonSerialize() { return [get_object_vars($this)]; } } $class = new SomeClass; var_dump(json_encode($class)); var_dump(json_last_error() == JSON_ERROR_RECURSION); $arr = [$class]; var_dump(json_encode($arr)); var_dump(json_last_error() == JSON_ERROR_RECURSION);

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.0090.00618.30
8.3.50.0150.00621.99
8.3.40.0140.00718.84
8.3.30.0070.00718.77
8.3.20.0000.00720.33
8.3.10.0040.00423.54
8.3.00.0080.00020.62
8.2.180.0140.00716.75
8.2.170.0110.00422.96
8.2.160.0090.00919.07
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00422.16
8.2.120.0050.00326.35
8.2.110.0060.00322.08
8.2.100.0140.00017.91
8.2.90.0000.00917.75
8.2.80.0050.00318.81
8.2.70.0060.00317.50
8.2.60.0000.00817.63
8.2.50.0060.00317.55
8.2.40.0050.00317.93
8.2.30.0000.00820.63
8.2.20.0030.00517.56
8.2.10.0050.00218.09
8.2.00.0020.00517.95
8.1.280.0060.00925.92
8.1.270.0100.00621.94
8.1.260.0000.00828.09
8.1.250.0030.00528.09
8.1.240.0080.00022.05
8.1.230.0040.00722.20
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00517.36
8.1.190.0000.00817.13
8.1.180.0090.00018.10
8.1.170.0040.00417.62
8.1.160.0030.00520.76
8.1.150.0000.00818.82
8.1.140.0040.00419.45
8.1.130.0000.00717.66
8.1.120.0000.00817.37
8.1.110.0030.00317.35
8.1.100.0000.00717.43
8.1.90.0040.00417.36
8.1.80.0070.00017.36
8.1.70.0030.00317.34
8.1.60.0040.00417.63
8.1.50.0030.00517.51
8.1.40.0000.00817.53
8.1.30.0040.00417.52
8.1.20.0000.00817.48
8.1.10.0040.00417.49
8.1.00.0050.00317.55
8.0.300.0040.00418.80
8.0.290.0040.00416.63
8.0.280.0000.00818.32
8.0.270.0000.00717.25
8.0.260.0030.00317.20
8.0.250.0030.00316.86
8.0.240.0000.00716.91
8.0.230.0070.00016.95
8.0.220.0040.00416.87
8.0.210.0030.00316.75
8.0.200.0030.00516.94
8.0.190.0080.00016.97
8.0.180.0000.00816.93
8.0.170.0030.00516.84
8.0.160.0040.00416.80
8.0.150.0000.00716.80
8.0.140.0070.00016.89
8.0.130.0030.00313.20
8.0.120.0040.00416.88
8.0.110.0070.00016.90
8.0.100.0000.00716.75
8.0.90.0000.00716.96
8.0.80.0150.00716.90
8.0.70.0000.00716.81
8.0.60.0060.00316.88
8.0.50.0000.00716.95
8.0.30.0080.01016.97
8.0.20.0130.01217.40
8.0.10.0040.00417.04
8.0.00.0050.01516.77
7.4.330.0060.00015.08
7.4.320.0000.00616.37
7.4.300.0000.00716.47
7.4.290.0000.00716.61
7.4.280.0030.00516.39
7.4.270.0040.00416.61
7.4.260.0030.00316.44
7.4.250.0040.00416.41
7.4.240.0030.00316.57
7.4.230.0000.00716.40
7.4.220.0090.00916.67
7.4.210.0110.00316.56
7.4.200.0000.00816.48
7.4.160.0060.00916.46
7.4.150.0140.00617.40
7.4.140.0120.00617.86
7.4.130.0110.00816.45
7.4.120.0110.00616.42
7.4.110.0030.01616.36
7.4.100.0030.01516.49
7.4.90.0040.01416.42
7.4.80.0070.01019.39
7.4.70.0140.00316.54
7.4.60.0110.00816.43
7.4.50.0070.00716.63
7.4.40.0090.00916.60
7.4.30.0190.00316.71
7.4.00.0100.00314.75
7.3.330.0030.00313.26
7.3.320.0020.00213.09
7.3.310.0040.00416.18
7.3.300.0060.00016.17
7.3.290.0080.01216.28
7.3.280.0090.00716.28
7.3.270.0090.01317.40
7.3.260.0090.00916.53
7.3.250.0080.01316.38
7.3.240.0150.00316.53
7.3.230.0180.00016.39
7.3.210.0140.00416.39
7.3.200.0060.01216.30
7.3.190.0090.00916.38
7.3.180.0100.00716.26
7.3.170.0090.00916.38
7.3.160.0040.01216.26
7.3.10.0100.00716.63
7.3.00.0040.01116.55
7.2.330.0090.00916.77
7.2.320.0090.01216.84
7.2.310.0040.01616.85
7.2.300.0000.01816.67
7.2.290.0060.00916.70
7.2.130.0110.00316.82
7.2.120.0040.01216.71
7.2.110.0000.01116.61
7.2.100.0030.01016.85
7.2.90.0070.00716.49
7.2.80.0030.01016.79
7.2.70.0090.00316.64
7.2.60.0080.00816.80
7.2.50.0070.00716.93
7.2.40.0000.01217.14
7.2.30.0070.00716.55
7.2.20.0080.00417.05
7.2.10.0060.01016.92
7.2.00.0100.00617.07
7.1.250.0090.00015.49
7.1.200.0060.00615.71
7.1.70.0070.00016.82
7.1.60.0090.01519.48
7.1.50.0060.01316.64
7.1.00.0000.07722.36
7.0.200.0290.00715.07
7.0.90.0070.04319.96
7.0.80.0070.06719.89
7.0.70.0100.06719.93
7.0.60.0170.06719.98
7.0.50.0070.08020.35
7.0.40.0100.06319.98
7.0.30.0100.05020.10
7.0.20.0070.07720.05
7.0.10.0070.04320.13
7.0.00.0070.08019.95
5.6.280.0030.07321.12
5.6.240.0070.07720.60
5.6.230.0000.08020.59
5.6.220.0200.07320.67
5.6.210.0130.07020.67
5.6.200.0030.08721.05
5.6.190.0100.04721.11
5.6.180.0030.04321.04
5.6.170.0070.07321.07
5.6.160.0030.07721.17
5.6.150.0030.08321.02
5.6.140.0070.08321.13
5.6.130.0100.08321.02
5.6.120.0030.04720.95
5.6.110.0000.08721.11
5.6.100.0100.07721.01
5.6.90.0100.04321.15
5.6.80.0030.07720.41
5.6.70.0100.07320.41
5.6.60.0070.04020.39
5.6.50.0030.05320.52
5.6.40.0030.06720.40
5.6.30.0100.07320.44
5.6.20.0070.07020.27
5.6.10.0000.08320.36
5.6.00.0100.07320.38
5.5.380.0100.07020.57
5.5.370.0070.08320.43
5.5.360.0100.06720.54
5.5.350.0100.08020.45
5.5.340.0070.07020.93
5.5.330.0070.05720.76
5.5.320.0070.05320.82
5.5.310.0100.06320.78
5.5.300.0030.05320.79
5.5.290.0070.08020.93
5.5.280.0070.04020.83
5.5.270.0070.08320.87
5.5.260.0100.08020.75
5.5.250.0030.08020.59
5.5.240.0100.06320.22
5.5.230.0030.08320.28
5.5.220.0100.07720.16
5.5.210.0070.08320.15
5.5.200.0100.07720.16
5.5.190.0100.07720.27
5.5.180.0100.06320.27
5.5.160.0100.07720.25
5.5.150.0100.07020.14
5.5.140.0100.08020.23
5.5.130.0100.06020.23
5.5.120.0170.07320.13
5.5.110.0070.04320.23
5.5.100.0100.07720.02
5.5.90.0130.06720.16
5.5.80.0070.05020.07
5.5.70.0070.08020.14
5.5.60.0070.08020.09
5.5.50.0070.04720.09
5.5.40.0070.07720.14
5.5.30.0000.06320.14
5.5.20.0030.08020.04
5.5.10.0100.03720.02
5.5.00.0000.04320.02

preferences:
61.18 ms | 404 KiB | 6 Q