3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeObject implements JsonSerializable { public string $placeholder = 'hallo'; public string $id; public string $model; public string $value; public bool $disabled; public bool $required; public function jsonSerialize(): mixed { return array_map( fn($value) => $value ?? '', array_merge( get_class_vars(__CLASS__), get_object_vars($this) ) ); } } class MainObject implements JsonSerializable { public string $mainName; public SomeObject $someObject; public function __construct() { $this->mainName = (new ReflectionClass(MainObject::class))->getShortName(); $this->someObject = new SomeObject(); } public function jsonSerialize(): mixed { return get_object_vars($this); } } $main = new MainObject; echo json_encode($main, JSON_PRETTY_PRINT);

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.130.0150.00520.50
8.4.120.0130.00717.84
8.4.110.0110.01017.99
8.4.100.0120.00818.91
8.4.90.0110.00917.83
8.4.80.0100.01017.77
8.4.70.0120.00718.00
8.4.60.0060.00418.63
8.4.50.0060.00319.35
8.4.40.0030.00617.74
8.4.30.0110.00720.71
8.4.20.0080.00019.45
8.4.10.0060.00317.91
8.3.250.0120.00816.55
8.3.240.0120.00716.48
8.3.230.0050.00316.55
8.3.220.0050.00417.18
8.3.210.0150.00516.53
8.3.200.0030.00516.49
8.3.190.0140.00517.10
8.3.180.0110.00717.34
8.3.170.0070.00716.74
8.3.160.0080.00016.63
8.3.150.0030.00619.01
8.3.140.0030.00716.63
8.3.130.0100.00618.72
8.3.120.0110.00018.85
8.3.110.0070.00716.63
8.3.100.0070.00324.06
8.3.90.0030.00526.77
8.3.80.0030.00616.36
8.3.70.0070.01416.75
8.3.60.0030.01218.27
8.3.50.0110.00717.85
8.3.40.0040.01120.34
8.3.30.0160.00018.67
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0130.00916.80
8.2.280.0130.00618.57
8.2.270.0150.00317.36
8.2.260.0060.00920.00
8.2.250.0130.00716.38
8.2.240.0050.00318.96
8.2.230.0060.00320.94
8.2.220.0060.00337.54
8.2.210.0080.00026.77
8.2.200.0090.00016.88
8.2.190.0150.00616.58
8.2.180.0080.00825.92
8.2.170.0000.01918.96
8.2.160.0070.01322.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.01119.48
8.2.110.0090.00020.47
8.2.100.0080.00417.59
8.2.90.0050.00519.36
8.2.80.0040.00418.91
8.2.70.0060.00317.63
8.2.60.0030.00617.79
8.2.50.0030.00618.07
8.2.40.0050.00318.22
8.2.30.0000.00718.17
8.2.20.0040.00418.18
8.2.10.0000.00718.89
8.2.00.0090.00019.32
8.1.330.0090.01016.17
8.1.320.0110.00116.23
8.1.310.0000.00818.63
8.1.300.0030.00617.95
8.1.290.0040.00718.88
8.1.280.0090.00925.92
8.1.270.0040.00423.99
8.1.260.0000.00926.35
8.1.250.0000.00828.09
8.1.240.0060.00323.79
8.1.230.0040.00720.88
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0090.00017.23
8.1.190.0090.00017.23
8.1.180.0050.00318.10
8.1.170.0050.00318.69
8.1.160.0000.00718.82
8.1.150.0040.00418.66
8.1.140.0000.00717.41
8.1.130.0000.00718.82
8.1.120.0040.00417.47
8.1.110.0050.00317.41
8.1.100.0000.00717.44
8.1.90.0000.00717.52
8.1.80.0040.00417.53
8.1.70.0030.00317.51
8.1.60.0000.00717.52
8.1.50.0060.00317.59
8.1.40.0040.00417.46
8.1.30.0000.00917.57
8.1.20.0000.00817.51
8.1.10.0030.00617.50
8.1.00.0040.00417.56
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0030.00318.39
8.0.270.0000.00716.84
8.0.260.0070.00018.57
8.0.250.0030.00316.96
8.0.240.0070.00016.94
8.0.230.0040.00316.87
8.0.220.0030.00316.87
8.0.210.0070.00016.92
8.0.200.0000.00717.02
8.0.190.0000.00816.95
8.0.180.0000.00716.77
8.0.170.0030.00616.93
8.0.160.0000.00716.78
8.0.150.0030.00516.93
8.0.140.0050.00316.88
8.0.130.0030.00313.30
8.0.120.0040.00416.89
8.0.110.0000.00816.73
8.0.100.0080.00016.77
8.0.90.0050.00216.71
8.0.80.0000.00716.95
8.0.70.0050.00216.88
8.0.60.0040.00417.04
8.0.50.0000.00716.86
8.0.30.0000.00716.96
8.0.20.0040.00417.04
8.0.10.0000.00716.95
8.0.00.0040.00416.86
7.4.330.0000.00515.55
7.4.320.0040.00416.50
7.4.300.0070.00016.56
7.4.290.0050.00316.62
7.4.280.0050.00216.48
7.4.270.0000.00716.55
7.4.260.0000.00513.25
7.4.250.0030.00516.60
7.4.240.0030.00316.49
7.4.230.0040.00416.66
7.4.220.0030.00316.33
7.4.210.0000.00716.62
7.4.200.0080.00016.55
7.4.190.0030.00316.58
7.4.180.0030.00316.76
7.4.160.0000.00716.52
7.4.150.0030.00616.66
7.4.140.0040.00416.26
7.4.130.0040.00416.67
7.4.120.0030.00516.44
7.4.110.0080.00016.47
7.4.100.0080.00016.56
7.4.90.0070.00016.36
7.4.80.0030.00316.61
7.4.70.0000.00716.52
7.4.60.0000.00716.58
7.4.50.0000.00716.19
7.4.40.0000.00716.50
7.4.30.0000.00716.24
7.4.20.0030.00316.59
7.4.10.0030.00316.46
7.4.00.0030.00316.42
7.3.330.0070.00016.22
7.3.320.0070.00013.07
7.3.310.0070.00016.08
7.3.300.0070.00016.01
7.3.290.0040.00416.21
7.3.280.0030.00316.25
7.3.270.0000.00816.16
7.3.260.0040.00416.26
7.3.250.0000.00716.16
7.3.240.0050.00316.13
7.3.230.0060.00316.18
7.3.220.0000.00716.09
7.3.210.0000.00716.13
7.3.200.0000.00716.02
7.3.190.0040.00416.10
7.3.180.0060.00016.10
7.3.170.0030.00316.04
7.3.160.0000.00616.05
7.3.150.0000.00616.09
7.3.140.0060.00016.13
7.3.130.0030.00316.13
7.3.120.0040.00416.10
7.3.110.0040.00416.09
7.3.100.0000.00716.04
7.3.90.0000.00616.39
7.3.80.0030.00316.16
7.3.70.0060.00016.16
7.3.60.0000.00716.21
7.3.50.0030.00316.21
7.3.40.0000.00616.07
7.3.30.0030.00316.18
7.3.20.0000.00717.94
7.3.10.0080.00017.98
7.3.00.0040.00418.03

preferences:
28.36 ms | 403 KiB | 5 Q