3v4l.org

run code in 300+ PHP versions simultaneously
<?php // before, in 10.1 class BaseOld { public function __construct() {} public function printTest(): void { print $this->test; } } // after class BaseNew { private bool $test; public function __construct(?bool $test = NULL) { $test = $test ?? TRUE; $this->test = $test; } public function printTest(): void { print $this->test; } } // NOTE: IDENTICAL! class FooOld extends BaseOld { protected bool $test; public function __construct() { parent::__construct(); $this->test = FALSE; } } class FooNew extends BaseNew { protected bool $test; public function __construct() { parent::__construct(); $this->test = FALSE; } } $f = new FooOld(); $f->printTest(); $f = new FooNew(); $f->printTest();

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.0100.01020.64
8.4.110.0150.00622.36
8.4.100.0130.00817.84
8.4.90.0120.00820.39
8.4.80.0100.01017.77
8.4.70.0090.00717.78
8.4.60.0100.01218.64
8.4.50.0120.00620.37
8.4.40.0100.01017.68
8.4.30.0130.00318.89
8.4.20.0160.00617.96
8.4.10.0060.01319.45
8.3.250.0040.00419.00
8.3.240.0130.00616.74
8.3.230.0130.00616.41
8.3.220.0070.01019.04
8.3.210.0120.00716.59
8.3.200.0080.01316.22
8.3.190.0120.00717.00
8.3.180.0050.00416.51
8.3.170.0100.00718.80
8.3.160.0150.00318.16
8.3.150.0150.00416.63
8.3.140.0000.00817.23
8.3.130.0040.00418.37
8.3.120.0030.00618.99
8.3.110.0040.00720.94
8.3.100.0110.00824.06
8.3.90.0000.00826.77
8.3.80.0030.00618.43
8.3.70.0060.00916.50
8.3.60.0100.01018.18
8.3.50.0070.01418.38
8.3.40.0040.01120.04
8.3.30.0120.00321.73
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0060.00326.35
8.2.290.0050.00516.73
8.2.280.0060.00218.16
8.2.270.0100.01017.33
8.2.260.0040.00416.57
8.2.250.0060.00316.86
8.2.240.0060.00917.29
8.2.230.0040.00422.58
8.2.220.0080.00037.54
8.2.210.0040.00826.77
8.2.200.0110.00016.38
8.2.190.0070.01116.75
8.2.180.0120.00618.48
8.2.170.0110.00419.07
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0030.00724.66
8.2.130.0000.00826.35
8.2.120.0060.00326.35
8.2.110.0030.00626.35
8.2.100.0060.00326.35
8.2.90.0090.00026.35
8.2.80.0040.00426.35
8.2.70.0080.00026.35
8.2.60.0060.00326.35
8.2.50.0030.00626.35
8.2.40.0090.00026.35
8.2.30.0000.00926.35
8.2.20.0000.00926.35
8.2.10.0000.00826.35
8.2.00.0030.00626.35
8.1.330.0110.00821.93
8.1.320.0110.00815.98
8.1.310.0030.00716.84
8.1.300.0040.00420.18
8.1.290.0080.00330.84
8.1.280.0180.00325.92
8.1.270.0030.00523.89
8.1.260.0000.00826.35
8.1.250.0060.00326.35
8.1.240.0050.00326.35
8.1.230.0080.00026.35
8.1.220.0080.00026.35
8.1.210.0030.00626.35
8.1.200.0000.00826.35
8.1.190.0000.00926.35
8.1.180.0090.00026.35
8.1.170.0080.00026.35
8.1.160.0080.00026.35
8.1.150.0080.00026.35
8.1.140.0040.00426.35
8.1.130.0040.00426.35
8.1.120.0090.00026.35
8.1.110.0040.00426.35
8.1.100.0080.00026.35
8.1.90.0040.00426.35
8.1.80.0060.00326.35
8.1.70.0040.00426.35
8.1.60.0050.00326.35
8.1.50.0030.00626.35
8.1.40.0050.00326.35
8.1.30.0060.00326.35
8.1.20.0090.00026.35
8.1.10.0040.00426.35
8.1.00.0030.00626.35

preferences:
27.98 ms | 403 KiB | 5 Q