3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractClass { abstract function __construct(); // Our abstract method only needs to define the required arguments abstract protected function prefixName($name); } class ConcreteClass extends AbstractClass { public function __construct($a=9) { echo $a; } // Our child class may define optional arguments not in the parent's signature public function prefixName($name, $separator=0 ) { if ($name == "Pacman") { $prefix = "Mr"; } elseif ($name == "Pacwoman") { $prefix = "Mrs"; } else { $prefix = ""; } return "{$prefix}{$separator} {$name}"; } } $class = new ConcreteClass(666699990000); echo $class->prefixName("Pacman"), "\n"; echo $class->prefixName("Pacwoman"), "\n"; ?>

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.0120.00816.38
8.3.50.0120.00521.93
8.3.40.0060.00918.77
8.3.30.0070.00719.00
8.3.20.0000.00720.22
8.3.10.0000.00823.42
8.3.00.0030.00620.55
8.2.180.0040.01418.16
8.2.170.0150.00018.71
8.2.160.0200.00022.96
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00926.16
8.2.120.0040.00422.23
8.2.110.0080.00022.29
8.2.100.0040.00817.66
8.2.90.0030.00619.25
8.2.80.0060.00318.04
8.2.70.0000.01117.63
8.2.60.0080.00017.93
8.2.50.0050.00318.07
8.2.40.0050.00319.34
8.2.30.0040.00418.07
8.2.20.0050.00317.52
8.2.10.0050.00319.59
8.2.00.0040.00417.66
8.1.280.0110.00325.92
8.1.270.0050.00323.79
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.84
8.1.230.0050.00519.15
8.1.220.0000.00717.74
8.1.210.0000.00818.77
8.1.200.0060.00317.25
8.1.190.0000.00817.40
8.1.180.0080.00018.10
8.1.170.0080.00018.68
8.1.160.0040.00421.95
8.1.150.0070.00018.56
8.1.140.0040.00417.46
8.1.130.0000.00717.89
8.1.120.0000.00817.39
8.1.110.0070.00017.40
8.1.100.0040.00417.45
8.1.90.0040.00417.44
8.1.80.0000.00717.34
8.1.70.0030.00317.35
8.1.60.0040.00417.42
8.1.50.0000.00717.54
8.1.40.0040.00417.44
8.1.30.0030.00517.66
8.1.20.0000.00817.70
8.1.10.0030.00617.55
8.1.00.0040.00417.57
8.0.300.0050.00318.77
8.0.290.0030.00317.18
8.0.280.0020.00518.45
8.0.270.0030.00317.28
8.0.260.0000.00716.71
8.0.250.0030.00316.88
8.0.240.0040.00417.00
8.0.230.0050.00216.82
8.0.220.0080.00016.95
8.0.210.0000.00716.79
8.0.200.0030.00316.95
8.0.190.0000.00716.95
8.0.180.0120.00016.93
8.0.170.0090.00016.95
8.0.160.0030.00516.91
8.0.150.0030.00316.85
8.0.140.0040.00416.91
8.0.130.0000.00613.29
8.0.120.0000.00816.89
8.0.110.0040.00416.80
8.0.100.0000.00716.95
8.0.90.0040.00416.88
8.0.80.0130.00616.89
8.0.70.0060.00316.89
8.0.60.0040.00416.96
8.0.50.0050.00216.69
8.0.30.0130.00916.92
8.0.20.0130.00617.40
8.0.10.0070.00016.95
8.0.00.0100.00816.75
7.4.330.0020.00215.09
7.4.320.0000.00616.41
7.4.300.0040.00416.47
7.4.290.0000.00616.61
7.4.280.0040.00416.50
7.4.270.0030.00316.64
7.4.260.0080.00016.52
7.4.250.0000.00716.47
7.4.240.0050.00316.55
7.4.230.0050.00216.46
7.4.220.0090.00916.72
7.4.210.0080.00916.59
7.4.200.0000.00816.53
7.4.190.0000.00816.56
7.4.160.0060.01016.59
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0100.00816.49
7.4.120.0100.00916.45
7.4.110.0060.01016.44
7.4.100.0100.00716.54
7.4.90.0120.00916.51
7.4.80.0180.00619.39
7.4.70.0100.00616.49
7.4.60.0060.00916.41
7.4.50.0000.00716.29
7.4.40.0060.01022.77
7.4.30.0100.01616.39
7.4.00.0060.00315.13
7.3.330.0030.00313.32
7.3.320.0030.00313.25
7.3.310.0040.00416.34
7.3.300.0000.00716.30
7.3.290.0000.01416.31
7.3.280.0090.00716.35
7.3.270.0170.00317.40
7.3.260.0100.00716.29
7.3.250.0100.01116.31
7.3.240.0140.00316.56
7.3.230.0140.00316.39
7.3.210.0090.00916.32
7.3.200.0060.01519.39
7.3.190.0090.01316.46
7.3.180.0070.01516.43
7.3.170.0150.00316.62
7.3.160.0060.01016.38
7.3.120.0060.00914.64
7.2.330.0140.00716.49
7.2.320.0100.00716.82
7.2.310.0090.00616.55
7.2.300.0240.00016.79
7.2.290.0060.00916.55
7.2.00.0000.01419.26
7.1.100.0030.01018.04
7.1.70.0070.00716.81
7.1.60.0120.00919.29
7.1.50.0070.00716.98
7.1.00.0100.07022.35
7.0.200.0000.01116.63
7.0.140.0030.07322.11
7.0.60.0070.06319.82
7.0.50.0100.03317.87
7.0.40.0100.03720.27
7.0.30.0200.04020.10
7.0.20.0270.04020.15
7.0.10.0130.08020.21
7.0.00.0070.05020.19
5.6.280.0130.06321.13
5.6.210.0070.08020.55
5.6.200.0130.06018.27
5.6.190.0070.08720.47
5.6.180.0100.08720.61
5.6.170.0270.04320.50
5.6.160.0030.05020.57
5.6.150.0130.07318.19
5.6.140.0100.05318.27
5.6.130.0100.08718.18
5.6.120.0030.04021.00
5.6.110.0130.06321.12
5.6.100.0070.03720.99
5.6.90.0300.06021.13
5.6.80.0000.05320.42
5.5.350.0070.05320.33
5.5.340.0070.08318.04
5.5.330.0070.08020.43
5.5.320.0170.07320.28
5.5.310.0500.06320.26
5.5.300.0070.07017.96
5.5.290.0130.07017.93
5.5.280.0030.06020.96
5.5.270.0070.04020.72
5.5.260.0170.07320.83
5.5.250.0170.04020.52
5.5.240.0000.08020.20
5.4.450.1030.04019.32
5.4.440.0670.05719.47
5.4.430.0670.06719.58
5.4.420.0530.05319.63
5.4.410.0470.06319.25
5.4.400.0130.05319.30
5.4.390.0600.05719.13
5.4.380.0100.05718.48
5.4.370.0230.04718.63
5.4.360.0170.05018.48
5.4.350.0200.04718.48
5.4.340.0130.05318.57
5.4.320.0030.03912.50
5.4.310.0070.03912.50
5.4.300.0040.03712.50
5.4.290.0050.04112.50
5.4.280.0100.04212.40
5.4.270.0060.03712.40
5.4.260.0030.04012.39
5.4.250.0020.04312.39
5.4.240.0040.03912.39
5.4.230.0050.05212.39
5.4.220.0130.04712.37
5.4.210.0160.04312.37
5.4.200.0140.04512.38
5.4.190.0140.04612.37
5.4.180.0150.04512.37
5.4.170.0130.04512.38
5.4.160.0120.04912.38
5.4.150.0160.04312.36
5.4.140.0170.04012.05
5.4.130.0180.04012.04
5.4.120.0100.04611.99
5.4.110.0160.04411.99
5.4.100.0280.06211.99
5.4.90.0140.04812.00
5.4.80.0130.04611.99
5.4.70.0220.04011.99
5.4.60.0170.04211.99
5.4.50.0310.05911.99
5.4.40.0140.04411.97
5.4.30.0190.04011.98
5.4.20.0140.04511.97
5.4.10.0170.04311.97
5.4.00.0180.04411.46
5.3.290.0060.04812.80
5.3.280.0060.03712.71
5.3.270.0120.05412.73
5.3.260.0170.04312.72
5.3.250.0220.07312.72
5.3.240.0190.04912.72
5.3.230.0150.04912.71
5.3.220.0150.04812.68
5.3.210.0150.04812.68
5.3.200.0200.04312.68
5.3.190.0170.04712.68
5.3.180.0240.04112.67
5.3.170.0190.04412.67
5.3.160.0180.04312.68
5.3.150.0230.04212.67
5.3.140.0160.07512.66
5.3.130.0220.04012.66
5.3.120.0160.04312.66
5.3.110.0180.04112.66
5.3.100.0180.04412.12
5.3.90.0130.04612.09
5.3.80.0400.08512.07
5.3.70.0160.04812.07
5.3.60.0150.04712.06
5.3.50.0190.04312.00
5.3.40.0160.04312.00
5.3.30.0160.07611.98
5.3.20.0160.04911.75
5.3.10.0170.04011.72
5.3.00.0110.04511.70
5.2.170.0100.0389.20
5.2.160.0140.0359.21
5.2.150.0310.0799.21
5.2.140.0100.0419.20
5.2.130.0180.0359.16
5.2.120.0160.0319.16
5.2.110.0110.0399.17
5.2.100.0150.0319.17
5.2.90.0120.0339.17
5.2.80.0130.0359.16
5.2.70.0120.0379.16
5.2.60.0150.0369.11
5.2.50.0120.0359.08
5.2.40.0290.0789.05
5.2.30.0130.0349.03
5.2.20.0100.0369.04
5.2.10.0130.0328.93
5.2.00.0150.0338.78
5.1.60.0130.0298.07
5.1.50.0110.0338.07
5.1.40.0130.0298.06
5.1.30.0290.0788.40
5.1.20.0140.0318.43
5.1.10.0110.0328.14
5.1.00.0100.0338.14
5.0.50.0090.0256.63
5.0.40.0120.0206.48
5.0.30.0220.0546.30
5.0.20.0060.0266.27
5.0.10.0080.0266.25
5.0.00.0100.0356.24
4.4.90.0060.0194.78
4.4.80.0070.0184.76
4.4.70.0090.0164.75
4.4.60.0100.0174.76
4.4.50.0120.0164.77
4.4.40.0060.0294.71
4.4.30.0050.0224.76
4.4.20.0090.0164.84
4.4.10.0060.0194.84
4.4.00.0030.0334.76
4.3.110.0080.0174.67
4.3.100.0050.0204.66
4.3.90.0060.0184.63
4.3.80.0050.0294.59
4.3.70.0060.0214.63
4.3.60.0110.0144.63
4.3.50.0070.0184.63
4.3.40.0110.0284.54
4.3.30.0070.0173.29
4.3.20.0040.0193.27
4.3.10.0070.0153.23
4.3.00.0130.01313.14

preferences:
45.74 ms | 401 KiB | 5 Q