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); class SomeOtherClass implements JsonSerializable { public function jsonSerialize() { return get_object_vars($this); } } $class = new SomeOtherClass; 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.4.120.0090.00620.37
8.4.110.0110.01018.84
8.4.100.0150.00618.13
8.4.90.0110.01017.98
8.4.80.0120.00622.46
8.4.70.0160.00517.77
8.4.60.0120.00917.97
8.4.50.0070.00218.69
8.4.40.0180.00320.76
8.4.30.0100.01017.73
8.4.20.0140.00318.01
8.4.10.0100.01017.71
8.3.250.0080.00218.93
8.3.240.0080.00316.97
8.3.230.0130.00816.92
8.3.220.0130.00617.35
8.3.210.0130.00616.57
8.3.200.0060.00616.72
8.3.190.0050.00417.28
8.3.180.0100.00816.66
8.3.170.0070.00720.69
8.3.160.0030.00618.29
8.3.150.0130.00616.78
8.3.140.0090.00619.05
8.3.130.0030.00518.45
8.3.120.0100.01018.95
8.3.110.0070.00420.94
8.3.100.0080.00324.06
8.3.90.0080.00826.77
8.3.80.0030.00618.55
8.3.70.0110.00716.75
8.3.60.0120.00318.43
8.3.50.0120.00721.99
8.3.40.0090.00618.57
8.3.30.0070.00718.63
8.3.20.0040.00420.39
8.3.10.0040.00421.84
8.3.00.0090.00020.87
8.2.290.0080.01120.41
8.2.280.0050.00919.92
8.2.270.0070.01118.82
8.2.260.0040.00416.47
8.2.250.0040.00716.68
8.2.240.0130.00717.07
8.2.230.0060.00322.58
8.2.220.0040.00437.54
8.2.210.0140.00326.77
8.2.200.0060.00316.38
8.2.190.0140.00716.58
8.2.180.0110.00716.38
8.2.170.0070.01022.96
8.2.160.0100.00719.21
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00419.77
8.2.120.0040.00426.35
8.2.110.0030.00622.25
8.2.100.0040.00817.93
8.2.90.0000.00819.40
8.2.80.0080.00017.97
8.2.70.0060.00317.50
8.2.60.0060.00317.93
8.2.50.0060.00318.10
8.2.40.0040.00420.63
8.2.30.0050.00220.63
8.2.20.0070.00017.70
8.2.10.0000.00717.98
8.2.00.0000.00718.13
8.1.330.0100.00916.69
8.1.320.0130.00818.32
8.1.310.0000.00818.57
8.1.300.0070.01117.74
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0040.00423.96
8.1.260.0100.00328.09
8.1.250.0080.00028.09
8.1.240.0030.00719.17
8.1.230.0080.00317.77
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0050.00318.62
8.1.160.0040.00420.89
8.1.150.0040.00418.91
8.1.140.0000.00719.49
8.1.130.0040.00417.53
8.1.120.0040.00417.48
8.1.110.0070.00017.38
8.1.100.0050.00317.47
8.1.90.0040.00417.36
8.1.80.0040.00417.38
8.1.70.0000.00817.36
8.1.60.0000.00817.52
8.1.50.0050.00317.53
8.1.40.0030.00617.40
8.1.30.0080.00017.64
8.1.20.0040.00417.50
8.1.10.0080.00017.46
8.1.00.0050.00317.51
8.0.300.0040.00418.77
8.0.290.0040.00416.58
8.0.280.0040.00418.45
8.0.270.0000.00717.27
8.0.260.0030.00317.19
8.0.250.0040.00417.02
8.0.240.0000.00716.93
8.0.230.0030.00316.84
8.0.220.0080.00016.90
8.0.210.0070.00016.80
8.0.200.0030.00616.84
8.0.190.0040.00416.98
8.0.180.0050.00316.91
8.0.170.0040.00416.81
8.0.160.0040.00416.79
8.0.150.0070.00016.84
8.0.140.0040.00416.75
8.0.130.0030.00313.37
8.0.120.0000.00816.84
8.0.110.0000.00716.93
8.0.100.0080.00016.94
8.0.90.0040.00416.81
8.0.80.0110.01016.89
8.0.70.0040.00416.84
8.0.60.0040.00416.91
8.0.50.0020.00516.98
8.0.30.0120.00617.15
8.0.20.0090.01517.40
8.0.10.0040.00416.91
8.0.00.0060.01416.84
7.4.330.0000.00515.15
7.4.320.0060.00016.60
7.4.300.0040.00416.60
7.4.290.0020.00516.61
7.4.280.0030.00516.41
7.4.270.0040.00416.56
7.4.260.0040.00416.49
7.4.250.0050.00216.44
7.4.240.0030.00316.37
7.4.230.0030.00316.35
7.4.220.0150.00416.53
7.4.210.0060.01316.65
7.4.200.0000.00716.64
7.4.160.0130.00316.40
7.4.150.0150.00917.40
7.4.140.0130.00517.86
7.4.130.0100.00716.55
7.4.120.0130.00516.45
7.4.110.0110.00616.39
7.4.100.0090.00916.37
7.4.90.0000.01816.48
7.4.80.0110.01119.39
7.4.70.0100.00716.43
7.4.60.0130.00916.51
7.4.50.0090.00916.66
7.4.40.0140.01116.57
7.4.30.0080.00816.35
7.4.00.0070.01015.03
7.3.330.0000.00513.25
7.3.320.0000.00513.16
7.3.310.0000.00716.23
7.3.300.0000.00716.32
7.3.290.0070.01016.32
7.3.280.0060.01016.30
7.3.270.0090.01517.40
7.3.260.0150.00416.52
7.3.250.0120.00616.43
7.3.240.0050.01216.44
7.3.230.0050.01116.45
7.3.210.0160.00716.25
7.3.200.0110.00616.32
7.3.190.0080.00816.34
7.3.180.0100.01016.52
7.3.170.0100.01016.45
7.3.160.0030.01716.45
7.3.120.0080.01114.94
7.3.110.0080.01014.81
7.3.100.0050.01014.85
7.3.90.0090.00814.81
7.3.80.0090.00514.77
7.3.70.0070.00614.78
7.3.60.0090.00514.70
7.3.50.0040.00714.75
7.3.40.0080.00614.75
7.3.30.0060.00614.79
7.3.20.0030.01016.60
7.3.10.0030.01016.71
7.3.00.0060.00816.81
7.2.330.0090.00916.81
7.2.320.0150.00416.73
7.2.310.0090.00916.59
7.2.300.0070.01016.85
7.2.290.0060.00916.63
7.2.250.0080.01015.09
7.2.240.0090.01015.14
7.2.230.0080.00914.96
7.2.220.0050.00915.19
7.2.210.0050.01214.96
7.2.200.0080.00515.05
7.2.190.0030.01015.19
7.2.180.0040.00815.04
7.2.170.0070.00614.99
7.2.60.0030.00716.59
7.1.330.0020.01315.84
7.1.320.0060.00515.61
7.1.310.0050.00815.95
7.1.300.0060.00815.64
7.1.290.0060.01015.82
7.1.280.0040.01115.76
7.1.270.0060.00515.72
7.1.260.0020.01315.93
7.1.200.0090.00615.51
7.1.70.0030.00617.11
7.1.60.0060.01919.48
7.1.50.0090.00617.10
7.1.00.0100.06322.57
7.0.200.0200.00715.12
7.0.90.0530.08719.98
7.0.80.0470.05019.91
7.0.70.0500.04719.85
7.0.60.0370.08719.90
7.0.50.0400.06020.32
7.0.40.0130.08020.19
7.0.30.0200.07020.12
7.0.20.0100.07320.15
7.0.10.0030.05320.14
7.0.00.0130.08020.11
5.6.280.0000.07321.16
5.6.240.0000.05720.68
5.6.230.0000.08720.69
5.6.220.0170.06320.75
5.6.210.0070.08320.72
5.6.200.0100.07321.09
5.6.190.0170.07721.04
5.6.180.0130.07721.01
5.6.170.0070.05020.96
5.6.160.0100.03721.07
5.6.150.0030.05020.96
5.6.140.0100.08021.06
5.6.130.0070.05020.95
5.6.120.0130.07721.09
5.6.110.0100.08020.91
5.6.100.0100.08321.03
5.6.90.0000.05321.10
5.6.80.0070.08020.55
5.6.70.0130.07720.37
5.6.60.0030.04720.42
5.6.50.0100.08320.45
5.6.40.0130.07720.42
5.6.30.0070.08020.48
5.6.20.0130.07020.47
5.6.10.0170.06720.38
5.6.00.0000.05020.36
5.5.380.0070.08320.47
5.5.370.0130.06720.42
5.5.360.0100.07720.42
5.5.350.0130.07020.33
5.5.340.0130.04320.65
5.5.330.0030.06720.91
5.5.320.0100.06720.77
5.5.310.0030.05720.88
5.5.300.0030.07720.84
5.5.290.0070.07720.80
5.5.280.0070.05320.90
5.5.270.0030.07020.82
5.5.260.0130.04720.73
5.5.250.0070.04020.73
5.5.240.0070.06020.22
5.5.230.0200.06720.14
5.5.220.0130.07320.27
5.5.210.0070.04020.18
5.5.200.0100.07320.18
5.5.190.0170.07320.28
5.5.180.0130.07320.21
5.5.160.0130.07320.27
5.5.150.0030.06020.27
5.5.140.0070.06020.14
5.5.130.0000.07320.24
5.5.120.0000.08320.25
5.5.110.0200.06320.26
5.5.100.0100.04319.98
5.5.90.0170.06020.04
5.5.80.0030.05320.16
5.5.70.0070.07720.07
5.5.60.0100.07720.05
5.5.50.0130.06020.08
5.5.40.0030.06720.10
5.5.30.0100.07320.13
5.5.20.0130.05320.07
5.5.10.0100.03320.09
5.5.00.0100.03719.97

preferences:
32.87 ms | 403 KiB | 5 Q