3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { public $model; public $year; public $passengers; function __construct() { $this->model = ""; $this->year = " "; $this->passengers=array(); } function addPassengers($passenger) { array_push($this->passengers, $passenger); return $this->passengers; } } $herbie = new Car(); $herbie->model = "vw"; $herbie->year = "1997"; $herbie->addPassengers("Mike"); echo $herbie->model; echo PHP_EOL; echo $herbie->year; echo PHP_EOL; print_r($herbie->passengers);

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.0100.00717.42
8.5.20.0100.00719.49
8.5.10.0120.00616.65
8.5.00.0100.01120.20
8.4.180.0110.01219.68
8.4.170.0120.01120.39
8.4.160.0100.01223.85
8.4.150.0080.00416.85
8.4.140.0140.01517.55
8.4.130.0040.00818.89
8.4.120.0050.00424.00
8.4.110.0110.00918.74
8.4.100.0140.00619.08
8.4.90.0130.00720.60
8.4.80.0070.00117.86
8.4.70.0160.00517.78
8.4.60.0070.00319.03
8.4.50.0100.01019.63
8.4.40.0120.00417.64
8.4.30.0090.00920.59
8.4.20.0040.01518.00
8.4.10.0070.01319.34
8.3.300.0120.01020.74
8.3.290.0120.00820.61
8.3.280.0120.00818.25
8.3.270.0140.01016.51
8.3.260.0090.01116.58
8.3.250.0110.00819.06
8.3.240.0110.00816.95
8.3.230.0110.00916.41
8.3.220.0110.00617.11
8.3.210.0090.00916.57
8.3.200.0040.00516.41
8.3.190.0090.01217.04
8.3.180.0120.00716.51
8.3.170.0110.00719.28
8.3.160.0040.01516.39
8.3.150.0040.01420.64
8.3.140.0070.00317.14
8.3.130.0000.01018.61
8.3.120.0070.00318.93
8.3.110.0090.00620.94
8.3.100.0050.00324.06
8.3.90.0040.00426.77
8.3.80.0060.00318.27
8.3.70.0090.00616.75
8.3.60.0070.01416.63
8.3.50.0100.01223.57
8.3.40.0140.00719.21
8.3.30.0000.01418.47
8.3.20.0050.00321.89
8.3.10.0080.00021.86
8.3.00.0080.00023.36
8.2.300.0200.01121.78
8.2.290.0120.00622.32
8.2.280.0090.00618.56
8.2.270.0150.00417.09
8.2.260.0140.00316.42
8.2.250.0070.00317.02
8.2.240.0100.00618.73
8.2.230.0040.00422.58
8.2.220.0040.00437.54
8.2.210.0070.00726.77
8.2.200.0060.00318.54
8.2.190.0110.00716.75
8.2.180.0100.00716.38
8.2.170.0140.00022.96
8.2.160.0150.00020.95
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00021.06
8.2.110.0040.00422.25
8.2.100.0060.00617.91
8.2.90.0000.00817.50
8.2.80.0030.00518.61
8.2.70.0040.00417.63
8.2.60.0000.00717.93
8.2.50.0060.00318.07
8.2.40.0030.00619.82
8.2.30.0080.00318.13
8.2.20.0040.00418.14
8.2.10.0040.00419.30
8.2.00.0040.00419.19
8.1.340.0130.00821.61
8.1.330.0140.00621.69
8.1.320.0100.00916.34
8.1.310.0080.00016.36
8.1.300.0060.00318.42
8.1.290.0000.01118.88
8.1.280.0070.01025.92
8.1.270.0000.00922.24
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.88
8.1.230.0110.00017.64
8.1.220.0070.00317.76
8.1.210.0040.00418.77
8.1.200.0000.00817.22
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0000.00818.66
8.1.160.0040.00418.84
8.1.150.0100.00018.84
8.1.140.0040.00418.76
8.1.130.0030.00320.19
8.1.120.0070.00017.42
8.1.110.0040.00417.38
8.1.100.0030.00517.39
8.1.90.0040.00417.41
8.1.80.0040.00417.33
8.1.70.0060.00317.28
8.1.60.0090.00017.55
8.1.50.0030.00517.57
8.1.40.0030.00517.42
8.1.30.0040.00417.55
8.1.20.0000.00817.66
8.1.10.0060.00317.62
8.1.00.0000.00917.48
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0040.00418.45
8.0.270.0030.00318.02
8.0.260.0070.00018.43
8.0.250.0080.00016.98
8.0.240.0030.00616.96
8.0.230.0000.00616.95
8.0.220.0000.00716.87
8.0.210.0030.00316.71
8.0.200.0060.00016.90
8.0.190.0030.00616.90
8.0.180.0050.00316.89
8.0.170.0040.00416.82
8.0.160.0030.00616.78
8.0.150.0000.00816.77
8.0.140.0040.00416.86
8.0.130.0000.00513.23
8.0.120.0000.00716.84
8.0.110.0030.00616.81
8.0.100.0070.00016.73
8.0.90.0070.00016.78
8.0.80.0060.00916.84
8.0.70.0050.00316.79
8.0.60.0070.00016.86
8.0.50.0080.00016.73
8.0.30.0140.00317.39
8.0.20.0120.01017.03
8.0.10.0040.00416.99
8.0.00.0130.01016.95
7.4.330.0000.00515.55
7.4.320.0040.00416.53
7.4.300.0000.00616.52
7.4.290.0040.00416.58
7.4.280.0030.00516.62
7.4.270.0070.00016.62
7.4.260.0060.00013.31
7.4.250.0000.00716.38
7.4.240.0020.00516.54
7.4.230.0030.00316.71
7.4.220.0070.00016.55
7.4.210.0090.00816.54
7.4.200.0050.00216.34
7.4.130.0120.00716.35
7.4.120.0060.01116.50
7.4.40.0140.00316.59
7.4.30.0100.00616.39
7.4.20.0120.00316.63
7.4.10.0000.01516.21
7.4.00.0030.01316.53
7.3.330.0020.00516.34
7.3.320.0040.00413.10
7.3.310.0060.00316.21
7.3.300.0000.00716.17
7.3.290.0040.00916.32
7.3.260.0130.01016.59
7.3.160.0030.01216.57
7.3.150.0100.00616.44
7.3.140.0100.00716.47
7.3.130.0160.00316.24
7.3.120.0100.00716.49
7.3.110.0090.00616.36
7.3.100.0130.00316.52
7.3.90.0080.00816.38
7.3.80.0120.00616.53
7.3.70.0120.00616.42
7.3.60.0030.01316.44
7.3.50.0070.01016.47
7.3.40.0130.00716.18
7.3.30.0100.00716.23
7.3.20.0090.00916.40
7.3.10.0150.00316.32
7.3.00.0140.00316.42
7.2.290.0130.00316.50
7.2.280.0130.00316.45
7.2.270.0070.00716.60
7.2.260.0030.01316.48
7.2.250.0090.00916.41
7.2.240.0060.01216.60
7.2.230.0130.00316.63
7.2.220.0110.00516.40
7.2.210.0090.00916.39
7.2.200.0110.00616.66
7.2.190.0140.00316.64
7.2.180.0030.01416.66
7.2.170.0090.00916.57
7.2.160.0170.00016.69
7.2.150.0090.00916.76
7.2.140.0140.01016.73
7.2.130.0110.00916.64
7.2.120.0150.00816.62
7.2.110.0120.00616.79
7.2.100.0030.01516.70
7.2.90.0090.01016.86
7.2.80.0100.01016.78
7.2.70.0120.00616.64
7.2.60.0090.00916.73
7.2.50.0120.00616.60
7.2.40.0060.01116.56
7.2.30.0130.00616.69
7.2.20.0100.01016.57
7.2.10.0210.01116.48
7.2.00.0100.01016.44

preferences:
73.74 ms | 1417 KiB | 5 Q