3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hook { public function __construct( public string $hook, public string $method = '', public ?string $module = NULL, ) {} } class Alter extends Hook { public function __construct( public string $hook, public string $method = '', public ?string $module = NULL, ) { parent::__construct($hook . '_alter'); } } class FormAlter extends Alter { public function __construct( public string $hook = '', public string $method = '', public ?string $module = NULL, ) { parent::__construct($hook ? 'form_' . $hook : 'form'); } } var_dump(new Alter('foo')); var_dump(new FormAlter()); var_dump(new FormAlter('foo'));

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.5.10.0130.00516.68
8.5.00.0090.01519.89
8.4.150.0030.00014.05
8.4.140.0110.01017.70
8.4.130.0080.00217.75
8.4.120.0080.01220.52
8.4.110.0020.00719.16
8.4.100.0160.00517.99
8.4.90.0030.00617.86
8.4.80.0040.00517.71
8.4.70.0170.00917.94
8.4.60.0140.00717.70
8.4.50.0040.00518.68
8.4.40.0080.01117.94
8.4.30.0100.00718.76
8.4.20.0130.01021.04
8.4.10.0070.00317.69
8.3.280.0110.00918.32
8.3.270.0110.01116.93
8.3.260.0110.00916.79
8.3.250.0100.00819.11
8.3.240.0130.00716.67
8.3.230.0120.00716.41
8.3.220.0050.00316.41
8.3.210.0090.01016.66
8.3.200.0110.00816.83
8.3.190.0080.01116.71
8.3.180.0050.00318.21
8.3.170.0110.00718.91
8.3.160.0140.00320.80
8.3.150.0000.01916.96
8.3.140.0190.01116.46
8.3.130.0160.00016.39
8.3.120.0100.00716.65
8.3.110.0150.00418.47
8.3.100.0210.00016.32
8.3.90.0140.00916.61
8.3.80.0130.00716.34
8.3.70.0150.00616.48
8.3.60.0170.00616.57
8.3.50.0170.00316.42
8.3.40.0110.00617.20
8.3.30.0120.00417.51
8.3.20.0160.00217.29
8.3.10.0100.00817.26
8.3.00.0070.00517.44
8.2.290.0040.00518.86
8.2.280.0080.00816.72
8.2.270.0040.00416.66
8.2.260.0150.00316.31
8.2.250.0140.00316.43
8.2.240.0190.00016.32
8.2.230.0130.00416.70
8.2.220.0170.00016.41
8.2.210.0100.00716.50
8.2.200.0180.00016.64
8.2.190.0170.00016.32
8.2.180.0140.00516.40
8.2.170.0190.00317.44
8.2.160.0140.00517.58
8.2.150.0130.00317.26
8.2.140.0160.00517.40
8.2.130.0170.00317.20
8.2.120.0140.00517.57
8.2.110.0120.00817.24
8.2.100.0160.00217.59
8.2.90.0120.00617.43
8.2.80.0130.00517.21
8.2.70.0090.00917.51
8.2.60.0120.00617.29
8.2.50.0140.00517.36
8.2.40.0080.00817.41
8.2.30.0110.00717.19
8.2.20.0130.00517.13
8.2.10.0100.00717.14
8.2.00.0120.00617.27
8.1.330.0150.00516.00
8.1.320.0150.00517.78
8.1.310.0130.00416.23
8.1.300.0120.00616.25
8.1.290.0090.00915.80
8.1.280.0140.00316.25
8.1.270.0110.00817.17
8.1.260.0130.00617.09
8.1.250.0150.00417.09
8.1.240.0130.00417.24
8.1.230.0100.00717.11
8.1.220.0080.00817.16
8.1.210.0140.00316.95
8.1.200.0120.00617.06
8.1.190.0120.00616.99
8.1.180.0150.00716.95
8.1.170.0130.00316.92
8.1.160.0140.00516.93
8.1.150.0100.00716.89
8.1.140.0170.00317.09
8.1.130.0070.01017.13
8.1.120.0120.00416.96
8.1.110.0130.00516.88
8.1.100.0150.00016.86
8.1.90.0090.00917.14
8.1.80.0130.00316.90
8.1.70.0100.00716.80
8.1.60.0150.00417.25
8.1.50.0170.00017.29
8.1.40.0150.00317.12
8.1.30.0180.00017.23
8.1.20.0150.00417.03
8.1.10.0120.00617.11
8.1.00.0180.00016.93

preferences:
24.11 ms | 403 KiB | 5 Q