3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { } (function(){echo 'foo';})->bindTo(new foo, foo::class)(); echo PHP_EOL . "____________________________________________________________" . PHP_EOL; class Wagon { private $name; public function __construct($name) { $this->name = $name; } } class bar { public $wagons; } $obj = new bar(); $obj->wagons = (function (Wagon ...$wagons) { return $wagons; })(new Wagon('Wagon1'), new Wagon('Wagon2')); var_dump($obj->wagons);

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.0060.00918.31
8.3.50.0160.00522.12
8.3.40.0060.01018.97
8.3.30.0040.01119.21
8.3.20.0040.00420.29
8.3.10.0000.00821.73
8.3.00.0000.00822.50
8.2.180.0120.00318.05
8.2.170.0070.00722.96
8.2.160.0070.00722.20
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00317.63
8.2.110.0090.00021.18
8.2.100.0120.00017.63
8.2.90.0000.00819.27
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0090.00021.04
8.2.30.0050.00218.12
8.2.20.0030.00517.69
8.2.10.0030.00518.11
8.2.00.0040.00418.05
8.1.280.0070.00725.92
8.1.270.0070.00320.23
8.1.260.0000.00826.35
8.1.250.0000.00928.09
8.1.240.0060.00323.96
8.1.230.0060.00617.42
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0030.00618.52
8.1.160.0040.00421.93
8.1.150.0000.00718.94
8.1.140.0050.00217.38
8.1.130.0000.00717.62
8.1.120.0000.00717.40
8.1.110.0070.00017.43
8.1.100.0030.00417.37
8.1.90.0030.00617.50
8.1.80.0000.00717.43
8.1.70.0000.00717.36
8.1.60.0000.00817.62
8.1.50.0000.00817.59
8.1.40.0000.00817.51
8.1.30.0030.00617.69
8.1.20.0070.00017.59
8.1.10.0000.00817.59
8.1.00.0080.00017.49
8.0.300.0040.00418.77
8.0.290.0080.00016.58
8.0.280.0030.00318.45
8.0.270.0080.00017.21
8.0.260.0050.00517.34
8.0.250.0000.00716.81
8.0.240.0030.00316.94
8.0.230.0080.00016.92
8.0.220.0070.00016.73
8.0.210.0030.00316.74
8.0.200.0030.00316.91
8.0.190.0040.00416.95
8.0.180.0040.00416.97
8.0.170.0000.00816.88
8.0.160.0000.00716.93
8.0.150.0000.00716.76
8.0.140.0060.00316.88
8.0.130.0060.00013.32
8.0.120.0000.00816.89
8.0.110.0050.00216.74
8.0.100.0050.00316.88
8.0.90.0040.00416.86
8.0.80.0090.00616.83
8.0.70.0000.00816.97
8.0.60.0000.00816.82
8.0.50.0000.00816.94
8.0.30.0080.01216.88
8.0.20.0130.00517.40
8.0.10.0050.00217.08
8.0.00.0130.01016.68
7.4.330.0030.00315.20
7.4.320.0070.00016.52
7.4.300.0060.00016.41
7.4.290.0060.00316.46
7.4.280.0080.00016.50
7.4.270.0040.00416.61
7.4.260.0080.00016.51
7.4.250.0040.00416.60
7.4.240.0070.00016.51
7.4.230.0040.00416.36
7.4.220.0070.01116.54
7.4.210.0100.01016.48
7.4.200.0000.00716.63
7.4.160.0030.01316.30
7.4.150.0140.01117.40
7.4.140.0060.01117.86
7.4.130.0110.00816.40
7.4.120.0090.00916.43
7.4.110.0040.01716.56
7.4.100.0070.01616.49
7.4.90.0100.00716.38
7.4.80.0070.01019.39
7.4.70.0060.01016.50
7.4.60.0040.01216.76
7.4.50.0000.00816.64
7.4.40.0080.01416.54
7.4.30.0090.00916.69
7.4.00.0070.00715.12
7.3.330.0000.00513.27
7.3.320.0050.00013.27
7.3.310.0050.00216.16
7.3.300.0000.00716.20
7.3.290.0060.01016.28
7.3.280.0100.00816.34
7.3.270.0060.01617.40
7.3.260.0170.00716.34
7.3.250.0100.01116.30
7.3.240.0060.01516.31
7.3.230.0110.00816.64
7.3.210.0060.01216.54
7.3.200.0080.00819.39
7.3.190.0030.01416.57
7.3.180.0100.01016.30
7.3.170.0130.00316.51
7.3.160.0120.00616.48
7.2.330.0110.00716.82
7.2.320.0060.01316.79
7.2.310.0100.00616.40
7.2.300.0080.00816.84
7.2.290.0140.00916.67
7.2.60.0110.00316.82
7.2.00.0000.01219.50
7.1.200.0100.00315.66
7.1.100.0000.01218.08
7.1.70.0040.00417.15
7.1.60.0100.01419.19
7.1.50.0000.01517.07
7.1.00.0000.08022.27
7.0.200.0000.00716.73
7.0.60.0000.08019.93
7.0.50.0100.06717.86
7.0.40.0030.05320.13
7.0.30.0130.05020.15
7.0.20.0330.07320.24
7.0.10.0130.08320.12
7.0.00.0070.08020.07
5.6.280.0030.06720.98
5.6.210.0030.08720.51
5.6.200.0100.07718.12
5.6.190.0130.05320.75
5.6.180.0270.05720.50
5.6.170.0270.06020.48
5.6.160.0030.09020.39
5.6.150.0030.08018.21
5.6.140.0230.06718.21
5.6.130.0030.07718.16
5.6.120.0100.07721.00
5.6.110.0170.08720.99
5.6.100.0070.06320.89
5.6.90.0070.04021.07
5.6.80.0130.07320.38
5.5.350.0030.07020.43
5.5.340.0170.03017.96
5.5.330.0070.04020.27
5.5.320.1670.06320.38
5.5.310.0270.07720.32
5.5.300.0100.06017.99
5.5.290.0030.05017.98
5.5.280.0070.08720.87
5.5.270.0130.07720.86
5.5.260.0070.08320.87
5.5.250.0130.05320.70
5.5.240.0030.07720.12
5.4.450.0570.06019.50
5.4.440.0970.05319.30
5.4.430.0670.06319.45
5.4.420.0800.05719.70
5.4.410.0830.05319.35
5.4.400.0770.05018.99
5.4.390.0830.05319.12
5.4.380.0900.05319.02
5.4.370.1370.08019.14
5.4.360.0730.06019.06
5.4.350.0800.07319.01
5.4.340.1070.06719.04
5.4.320.0800.06719.16
5.4.310.1000.05719.14
5.4.300.0830.05719.22
5.4.290.1000.05719.13
5.4.280.0730.06719.15
5.4.270.0830.06319.30
5.4.260.1100.05019.06
5.4.250.0900.06318.83
5.4.240.0670.06719.31
5.4.230.0800.06018.83
5.4.220.0630.06019.14
5.4.210.0800.05719.08
5.4.200.0770.05016.97
5.4.190.0800.05719.18
5.4.180.0770.05719.02
5.4.170.0770.05718.93
5.4.160.0930.04319.27
5.4.150.1130.07019.23
5.4.140.1270.05016.48
5.4.130.0870.05016.45
5.4.120.1070.04716.38
5.4.110.0730.06016.60
5.4.100.0900.07016.46
5.4.90.1000.07016.60
5.4.80.1270.06316.40
5.4.70.1200.04016.36
5.4.60.1000.04716.52
5.4.50.0870.04316.31
5.4.40.0930.05316.32
5.4.30.0970.05016.55
5.4.20.0730.05316.51
5.4.10.0630.05716.35
5.4.00.0700.05015.79
5.3.290.0970.05314.64
5.3.280.0930.05314.50
5.3.270.1000.05014.58
5.3.260.1030.05014.75
5.3.250.0830.06014.59
5.3.240.0700.05314.52
5.3.230.0970.07014.68
5.3.220.0730.05014.50
5.3.210.0870.06014.49
5.3.200.0930.06014.79
5.3.190.1000.04714.46
5.3.180.0900.05314.57
5.3.170.0970.04714.46
5.3.160.0870.05314.48
5.3.150.0770.05014.58
5.3.140.0770.05014.78
5.3.130.0830.05714.46
5.3.120.0900.05714.60
5.3.110.0770.05314.55
5.3.100.0970.06013.90
5.3.90.0700.05014.16
5.3.80.0670.06014.06
5.3.70.0830.05013.92
5.3.60.0800.05714.01
5.3.50.0900.06013.80
5.3.40.0770.05713.86
5.3.30.0770.05013.82
5.3.20.0770.04313.69
5.3.10.0700.06013.74
5.3.00.0730.05313.54
5.2.170.0700.04711.10
5.2.160.0600.04011.29
5.2.150.0600.04011.04
5.2.140.0900.05311.15
5.2.130.0830.04011.24
5.2.120.0830.03711.15
5.2.110.1070.03311.02
5.2.100.0800.04311.01
5.2.90.0630.04011.02
5.2.80.0600.04311.14
5.2.70.0630.04711.14
5.2.60.0600.04011.04
5.2.50.0830.03710.96
5.2.40.0630.04010.99
5.2.30.0670.03711.02
5.2.20.0570.04311.18
5.2.10.0730.03310.79
5.2.00.0500.04010.71
5.1.60.0670.0339.86
5.1.50.0770.02710.07
5.1.40.0600.03010.05
5.1.30.0570.02710.34
5.1.20.0470.04010.32
5.1.10.0470.0379.99
5.1.00.0530.03010.13
5.0.50.0330.0338.57
5.0.40.0300.0378.32
5.0.30.0300.0438.22
5.0.20.0330.0238.18
5.0.10.0200.0338.17
5.0.00.0270.0408.21
4.4.90.0200.0235.78
4.4.80.0270.0175.86
4.4.70.0230.0235.76
4.4.60.0200.0235.84
4.4.50.0200.0235.76
4.4.40.0200.0375.75
4.4.30.0200.0235.82
4.4.20.0270.0175.80
4.4.10.0200.0235.94
4.4.00.0370.0275.83
4.3.110.0300.0175.78
4.3.100.0270.0235.70
4.3.90.0230.0205.79
4.3.80.0300.0275.64
4.3.70.0230.0235.70
4.3.60.0200.0235.74
4.3.50.0230.0205.77
4.3.40.0200.0335.70
4.3.30.0170.0174.43
4.3.20.0100.0234.49
4.3.10.0100.0234.36
4.3.00.0100.0237.03

preferences:
62.52 ms | 401 KiB | 5 Q