3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DTO { public function __construct( public int $a, public int $b, public int $c, public int $d, public int $e, public int $f, ) {} } $dto = new DTO(1, 2, 3, 4, 5, 6); var_dump($dto); // #PHP 8.2+, with named parameters in arrays $copy = new DTO(...(['d' => 42] + get_object_vars($dto))); var_dump($copy); // #PHP 8.0–1+, with unnamed parameters in arrays $copy2 = new DTO(...array_values(array_merge(get_object_vars($dto), ['d' => 42]))); var_dump($copy2); // #PHP 7.4– : not supported

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.30.0160.00718.57
8.5.20.0180.00718.42
8.5.10.0240.00816.77
8.5.00.0190.00618.31
8.4.180.0230.00919.73
8.4.170.0260.00721.62
8.4.160.0240.00921.77
8.4.150.0190.00716.88
8.4.140.0240.00917.65
8.4.130.0170.00918.39
8.4.120.0300.01019.72
8.4.110.0330.00819.29
8.4.100.0290.01017.80
8.4.90.0270.01017.76
8.4.80.0290.00718.26
8.4.70.0340.00917.97
8.4.60.0300.00717.87
8.4.50.0350.00717.89
8.4.40.0420.01017.79
8.4.30.0430.01017.67
8.4.20.0420.01017.75
8.4.10.0420.01117.70
8.3.300.0240.00819.51
8.3.290.0240.00819.58
8.3.280.0140.00918.52
8.3.270.0230.00816.70
8.3.260.0200.00716.72
8.3.250.0230.00717.49
8.3.240.0200.00516.81
8.3.230.0200.01016.60
8.3.220.0220.00617.28
8.3.210.0320.00717.19
8.3.200.0270.00617.23
8.3.190.0380.00817.19
8.3.180.0360.01117.12
8.3.170.0400.00917.10
8.3.160.0410.00817.13
8.3.150.0350.00817.18
8.3.140.0320.00617.18
8.3.130.0220.00617.15
8.3.120.0220.00517.21
8.3.110.0230.00417.09
8.3.100.0280.00717.07
8.3.90.0370.00617.26
8.3.80.0300.00817.17
8.3.70.0410.00717.15
8.3.60.0400.00817.14
8.3.50.0420.00917.20
8.3.40.0360.00817.94
8.3.30.0300.00817.92
8.3.20.0280.00617.85
8.3.10.0200.00817.91
8.3.00.0300.00917.89
8.2.300.0250.00817.80
8.2.290.0180.00817.81
8.2.280.0340.00417.16
8.2.270.0230.00817.22
8.2.260.0290.00917.05
8.2.250.0250.00817.27
8.2.240.0350.00617.09
8.2.230.0280.00617.17
8.2.220.0250.00617.05
8.2.210.0280.00717.11
8.2.200.0230.00917.20
8.2.190.0260.00717.15
8.2.180.0270.00617.18
8.2.170.0300.00818.05
8.2.160.0380.00917.88
8.2.150.0330.00717.89
8.2.140.0300.00717.77
8.2.130.0270.00817.90
8.2.120.0300.01017.85
8.2.110.0310.00717.90
8.2.100.0330.00917.92
8.2.90.0350.00817.90
8.2.80.0320.01017.88
8.2.70.0360.00617.84
8.2.60.0350.00617.89
8.2.50.0300.00817.90
8.2.40.0310.00617.81
8.2.30.0300.00617.79
8.2.20.0310.00717.79
8.2.10.0240.00717.88
8.2.00.0280.00817.85
8.0.290.0310.00816.73
8.0.00.0270.00817.07
7.4.250.0280.00816.73
7.4.240.0260.00716.73
7.4.00.0290.00416.73
7.3.210.0270.00616.73

preferences:
43.44 ms | 901 KiB | 5 Q