3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait OverloadConstructor { public function __construct(... $args) { $length = strlen('initMethod'); foreach (get_class_methods($this) as $method) { if (substr($method, 0, $length) === 'initMethod') { $this->{$method}(... $args); } } } } trait Init1 { protected function initMethodInit1(... $args) { echo 'initMethodInit1' . PHP_EOL; } } trait Init2 { protected function initMethodInit2(... $args) { echo 'initMethodInit2' . PHP_EOL; } } class InitTest { use OverloadConstructor, Init1; protected function initMethodInitTest(... $args) { echo 'initMethodInitTest' . PHP_EOL; } } class ChangeBehaviourOfInitTest extends InitTest { use Init2; protected function initMethodChangeBehaviourOfInitTest(... $args) { echo 'initMethodChangeBehaviourOfInitTest' . PHP_EOL; } } new InitTest(); new ChangeBehaviourOfInitTest();

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.0040.01118.56
8.3.50.0120.00618.16
8.3.40.0140.00018.66
8.3.30.0090.00618.79
8.3.20.0040.00421.86
8.3.10.0040.00418.75
8.3.00.0080.00019.38
8.2.180.0110.00318.42
8.2.170.0140.00022.96
8.2.160.0070.00719.33
8.2.150.0070.00024.18
8.2.140.0090.00024.66
8.2.130.0050.00222.19
8.2.120.0050.00326.35
8.2.110.0030.00619.31
8.2.100.0090.00317.66
8.2.90.0040.00418.34
8.2.80.0080.00317.97
8.2.70.0030.00618.04
8.2.60.0040.00418.14
8.2.50.0060.00318.10
8.2.40.0050.00321.25
8.2.30.0000.00719.14
8.2.20.0040.00417.93
8.2.10.0040.00419.57
8.2.00.0050.00317.98
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0070.00328.09
8.1.240.0030.00623.97
8.1.230.0030.01020.89
8.1.220.0040.00417.76
8.1.210.0060.00318.95
8.1.200.0050.00317.48
8.1.190.0090.00017.13
8.1.180.0030.00618.10
8.1.170.0040.00418.70
8.1.160.0040.00418.80
8.1.150.0000.00718.95
8.1.140.0030.00320.33
8.1.130.0030.00620.24
8.1.120.0040.00417.43
8.1.110.0070.00017.34
8.1.100.0050.00317.51
8.1.90.0000.00817.45
8.1.80.0020.00517.40
8.1.70.0030.00517.36
8.1.60.0000.00817.61
8.1.50.0060.00317.55
8.1.40.0030.00517.55
8.1.30.0040.00417.55
8.1.20.0040.00417.65
8.1.10.0040.00417.59
8.1.00.0030.00617.48
8.0.300.0040.00420.01
8.0.290.0070.00016.63
8.0.280.0000.00718.44
8.0.270.0030.00317.14
8.0.260.0040.00418.44
8.0.250.0030.00516.84
8.0.240.0040.00416.92
8.0.230.0070.00016.86
8.0.220.0030.00716.91
8.0.210.0030.00316.94
8.0.200.0040.00416.86
8.0.190.0040.00417.03
8.0.180.0040.00416.91
8.0.170.0030.00516.93
8.0.160.0000.00716.97
8.0.150.0040.00416.81
8.0.140.0000.00816.77
8.0.130.0000.00713.36
8.0.120.0040.00416.77
8.0.110.0040.00416.74
8.0.100.0000.00716.89
8.0.90.0090.00016.94
8.0.80.0050.01016.89
8.0.70.0000.00716.79
8.0.60.0000.00716.79
8.0.50.0000.00816.82
8.0.30.0080.01117.11
8.0.20.0070.01717.40
8.0.10.0000.00716.91
8.0.00.0100.00916.72
7.4.330.0030.00515.55
7.4.320.0000.00716.53
7.4.300.0060.00016.40
7.4.290.0030.00316.55
7.4.280.0000.00816.51
7.4.270.0000.00916.47
7.4.260.0000.00716.55
7.4.250.0070.00016.54
7.4.240.0030.00316.54
7.4.230.0070.00016.50
7.4.220.0050.00316.41
7.4.210.0080.00716.61
7.4.200.0070.00016.62
7.4.160.0090.00616.51
7.4.140.0090.00917.86
7.4.130.0060.01216.51
7.4.120.0030.01416.67
7.4.110.0140.00416.36
7.4.100.0160.00616.54
7.4.90.0130.00616.47
7.4.80.0150.00619.39
7.4.70.0110.00516.49
7.4.60.0100.00716.68
7.4.50.0070.01016.43
7.4.40.0070.01016.64
7.4.00.0120.00315.02
7.3.330.0000.00513.27
7.3.320.0060.00013.40
7.3.310.0000.00716.34
7.3.300.0030.00316.34
7.3.290.0000.01516.29
7.3.280.0080.00816.33
7.3.260.0110.00716.45
7.3.240.0170.00316.34
7.3.230.0110.00616.32
7.3.210.0100.00716.60
7.3.200.0090.00916.39
7.3.190.0060.01616.44
7.3.180.0060.00916.50
7.3.170.0090.00916.56
7.3.160.0080.00816.55
7.3.20.7660.00714.75
7.3.10.0120.00914.64
7.3.00.1180.01014.50
7.2.330.0060.01216.65
7.2.320.0040.01516.64
7.2.310.0140.00516.89
7.2.300.0090.00916.46
7.2.290.0160.00316.56
7.2.150.3860.00715.06
7.2.140.0760.00714.55
7.2.130.0060.00614.71
7.2.120.1210.00614.48
7.2.110.0110.00715.01
7.2.100.0650.00314.91
7.2.90.0060.01714.70
7.2.80.0060.02114.76
7.2.70.0300.00614.78
7.2.60.0560.00414.87
7.2.50.0090.02214.60
7.2.40.0140.01115.06
7.2.30.0290.00014.66
7.2.20.0210.01415.03
7.2.10.0120.01614.53
7.2.00.0220.00414.89
7.1.250.0260.00013.61

preferences:
64.24 ms | 401 KiB | 5 Q