3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pet { public $name; public function __construct ( $name ) { $this->name = $name; } public function speak ($what) { return $what; } } class Dog extends Pet { public function speak ( $what = null ) { return $what ? parent::speak($what) : 'Woof Woof!'; /* // Otra alternativa para meter codigo mas complicado seria: if($what) return parent::speak($what); return 'Woof Woof'; */ } public function plays() { return 'fetch'; } } $charlie = new Dog ( 'Charlie' ); echo 'The dog\'s name is ' . $charlie->name . '<br/>'; echo 'Speak of the super class: ' . $charlie->speak('hello, my name is ' . $charlie->name) . '<br/>'; echo 'Speak of the dog class: ' . $charlie->speak() . '<br/>';

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.0160.00316.63
8.3.50.0120.00717.50
8.3.40.0070.00718.97
8.3.30.0130.00318.56
8.3.20.0030.00618.81
8.3.10.0080.00018.60
8.3.00.0040.00419.02
8.2.180.0140.00316.50
8.2.170.0090.00622.96
8.2.160.0130.00318.79
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00019.66
8.2.110.0070.01019.26
8.2.100.0080.00417.80
8.2.90.0080.00019.09
8.2.80.0030.00517.97
8.2.70.0000.01317.50
8.2.60.0030.00618.03
8.2.50.0050.00318.10
8.2.40.0060.00318.16
8.2.30.0050.00517.73
8.2.20.0070.00317.54
8.2.10.0040.00417.68
8.2.00.0000.00817.76
8.1.280.0070.01125.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0070.00322.74
8.1.230.0050.00517.70
8.1.220.0000.00717.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.36
8.1.180.0060.00318.10
8.1.170.0030.00518.40
8.1.160.0000.00718.94
8.1.150.0000.01118.57
8.1.140.0030.00617.51
8.1.130.0000.00719.21
8.1.120.0070.00017.49
8.1.110.0000.00817.43
8.1.100.0000.00717.47
8.1.90.0030.00317.34
8.1.80.0000.00717.47
8.1.70.0030.00317.42
8.1.60.0040.00417.48
8.1.50.0000.00817.55
8.1.40.0000.00817.42
8.1.30.0050.00317.64
8.1.20.0060.00817.58
8.1.10.0000.00717.50
8.1.00.0000.00817.40
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0060.00318.37
8.0.270.0070.00017.23
8.0.260.0060.00018.41
8.0.250.0050.00316.91
8.0.240.0020.00516.88
8.0.230.0000.00816.90
8.0.220.0030.00316.86
8.0.210.0030.00316.84
8.0.200.0030.00316.88
8.0.190.0060.00316.95
8.0.180.0030.00316.82
8.0.170.0080.00016.90
8.0.160.0040.00416.80
8.0.150.0040.00416.93
8.0.140.0040.00416.81
8.0.130.0000.00513.27
8.0.120.0090.00016.79
8.0.110.0000.00716.69
8.0.100.0070.00016.81
8.0.90.0000.00716.73
8.0.80.0070.01016.95
8.0.70.0040.00416.80
8.0.60.0030.00616.80
8.0.50.0000.00816.73
8.0.30.0140.00317.17
8.0.20.0090.00917.18
8.0.10.0070.00016.87
8.0.00.0080.01216.65
7.4.330.0000.00512.89
7.4.320.0000.00716.56
7.4.300.0000.00616.56
7.4.290.0090.00016.52
7.4.280.0000.00816.60
7.4.270.0060.00016.54
7.4.260.0000.00513.25
7.4.250.0050.00316.38
7.4.240.0000.00816.61
7.4.230.0030.00316.51
7.4.220.0200.00316.67
7.4.210.0130.00316.45
7.4.200.0000.00716.50
7.4.190.0040.00416.75
7.4.160.0130.00316.50
7.4.150.0130.00416.48
7.4.140.0090.00917.86
7.4.130.0120.01516.56
7.4.120.0120.00616.52
7.4.110.0030.02216.63
7.4.100.0130.01016.52
7.4.90.0150.00316.43
7.4.80.0090.00919.39
7.4.70.0000.02016.47
7.4.60.0090.00916.21
7.4.50.0000.00816.54
7.4.40.0040.00716.37
7.4.30.0100.00616.53
7.4.00.0080.00914.80
7.3.330.0060.00013.14
7.3.320.0060.00013.09
7.3.310.0000.00716.20
7.3.300.0000.00716.25
7.3.290.0120.00316.27
7.3.280.0100.01116.34
7.3.270.0090.01216.51
7.3.260.0140.00316.43
7.3.240.0070.01016.37
7.3.230.0150.00316.47
7.3.210.0070.01016.48
7.3.200.0100.01016.28
7.3.190.0080.00816.19
7.3.180.0130.00616.45
7.3.170.0100.00716.54
7.3.160.0180.00016.16
7.3.120.0060.01114.76
7.3.110.0070.00814.84
7.3.100.0070.01014.55
7.3.90.0060.00814.78
7.3.80.0100.00414.93
7.3.70.0070.00414.65
7.3.60.0050.01014.71
7.3.50.0080.00114.67
7.3.40.0060.00814.78
7.3.30.0040.01014.85
7.3.20.0080.00516.55
7.3.10.0070.00616.57
7.3.00.0020.01016.40
7.2.330.0110.00716.76
7.2.320.0080.01216.75
7.2.310.0070.01016.73
7.2.300.0060.01216.81
7.2.290.0170.00416.80
7.2.250.0040.01414.95
7.2.240.0050.01415.19
7.2.230.0060.00715.18
7.2.220.0030.01015.20
7.2.210.0040.01215.27
7.2.200.0060.00315.23
7.2.190.0120.00715.12
7.2.180.0000.01714.94
7.2.170.0060.00915.01
7.2.00.0070.00719.04
7.1.330.0070.00715.77
7.1.320.0030.00715.70
7.1.310.0030.01215.72
7.1.300.0090.00815.69
7.1.290.0070.00715.85
7.1.280.0030.01315.74
7.1.270.0030.00915.66
7.1.260.0080.00515.73
7.1.100.0080.00317.80
7.1.70.0030.00517.11
7.1.60.0060.01317.27
7.1.50.0120.00616.73
7.1.00.0000.03722.42
7.0.200.0000.01416.73
7.0.140.0070.07021.92
7.0.120.0030.06322.13
7.0.60.0000.04319.80
7.0.50.0130.07317.83
7.0.40.0030.07717.71
7.0.30.0070.04017.84
7.0.20.0130.07317.73
7.0.10.0070.08717.74
7.0.00.0100.07317.72
5.6.210.0130.06720.77
5.6.200.0130.04718.18
5.6.190.0100.07718.19
5.6.180.0070.07718.27
5.6.170.0100.07318.25
5.6.160.0230.04018.29
5.6.150.0030.04018.11
5.6.140.0070.04018.18
5.6.130.0070.06018.28
5.6.120.0130.05018.18
5.6.110.0030.08718.24
5.6.100.0030.08718.13
5.6.90.0000.05718.13
5.6.80.0070.08317.64
5.6.70.0100.07317.67
5.6.60.0030.07717.65
5.6.50.0070.08017.61
5.6.40.0100.07317.50
5.6.30.0030.04717.54
5.6.20.0100.05017.54
5.6.10.0070.04017.52
5.6.00.0030.08017.59
5.5.350.0330.06020.36
5.5.340.0030.08717.97
5.5.330.0130.06317.97
5.5.320.0100.08017.98
5.5.310.0170.07018.02
5.5.300.0100.08018.00
5.5.290.0070.07718.05
5.5.280.0100.07318.08
5.5.270.0100.07018.07
5.5.260.0000.07717.92
5.5.250.0100.07717.77
5.5.240.0070.08017.48
5.5.230.0030.04017.43
5.5.220.0100.07017.39
5.5.210.0130.07017.36
5.5.200.0030.04717.44
5.5.190.0000.05317.43
5.5.180.0200.03017.49
5.5.160.0070.06717.28
5.5.150.0070.04717.30
5.5.140.0030.07717.39
5.5.130.0100.03717.38
5.5.120.0170.07017.40
5.5.110.0100.07717.42
5.5.100.0100.06717.35
5.5.90.0070.07017.23
5.5.80.0070.06317.20
5.5.70.0130.05717.25
5.5.60.0100.07017.21
5.5.50.0070.07717.23
5.5.40.0130.05017.18
5.5.30.0100.03317.19
5.5.20.0030.04017.18
5.5.10.0070.07317.20
5.5.00.0200.06317.25
5.4.450.0130.06719.36
5.4.440.0130.07719.44
5.4.430.0030.08319.37
5.4.420.0070.07319.42
5.4.410.0070.06319.25
5.4.400.0070.03719.05
5.4.390.0100.07319.05
5.4.380.0070.07319.02
5.4.370.0030.05718.98
5.4.360.0070.06719.03
5.4.350.0030.08318.96
5.4.340.0030.06718.99
5.4.320.0130.07319.01
5.4.310.0070.04319.05
5.4.300.0200.06319.01
5.4.290.0000.06719.09
5.4.280.0100.06018.88
5.4.270.0130.07319.12
5.4.260.0100.07019.04
5.4.250.0100.06719.04
5.4.240.0030.04719.08
5.4.230.0070.06319.02
5.4.220.0070.04319.13
5.4.210.0070.07319.02
5.4.200.0130.06718.97
5.4.190.0070.06019.00
5.4.180.0100.03319.11
5.4.170.0070.07719.09
5.4.160.0130.07019.09
5.4.150.0070.07719.08
5.4.140.0030.07316.42
5.4.130.0100.06716.29
5.4.120.0030.07316.29
5.4.110.0130.06716.47
5.4.100.0030.03716.50
5.4.90.0030.03716.34
5.4.80.0000.04016.48
5.4.70.0100.07016.49
5.4.60.0030.06716.21
5.4.50.0130.05316.38
5.4.40.0130.06716.38
5.4.30.0130.07016.35
5.4.20.0070.05016.38
5.4.10.0070.05316.34
5.4.00.0030.05015.87
5.3.290.0070.04314.72
5.3.280.0030.06714.63
5.3.270.0130.03714.58
5.3.260.0070.07714.63
5.3.250.0000.08314.62
5.3.240.0030.07714.67
5.3.230.0000.05714.64
5.3.220.0130.04014.79
5.3.210.0100.07014.62
5.3.200.0000.04714.62
5.3.190.0070.04314.79
5.3.180.0030.03714.59
5.3.170.0070.04314.57
5.3.160.0100.06314.61
5.3.150.0030.05714.38
5.3.140.0070.04314.77
5.3.130.0030.06314.59
5.3.120.0030.06014.52
5.3.110.0030.06714.60
5.3.100.0030.08014.07
5.3.90.0030.07714.02
5.3.80.0130.06314.05
5.3.70.0070.07314.05
5.3.60.0030.04314.07
5.3.50.0030.04313.94
5.3.40.0030.05013.94
5.3.30.0000.04013.95
5.3.20.0130.02713.60
5.3.10.0000.03713.69
5.3.00.0000.03713.68
5.2.170.0030.03011.20
5.2.160.0000.03011.02
5.2.150.0030.02711.12
5.2.140.0000.03011.17
5.2.130.0000.03011.17
5.2.120.0030.02711.18
5.2.110.0070.02310.96
5.2.100.0030.02711.15
5.2.90.0000.03011.14
5.2.80.0000.03010.94
5.2.70.0000.03011.10
5.2.60.0000.03011.07
5.2.50.0070.02311.07
5.2.40.0000.03011.04
5.2.30.0030.02711.01
5.2.20.0000.04311.00
5.2.10.0030.02710.93
5.2.00.0000.03010.76
5.1.60.0030.0209.98
5.1.50.0030.02310.07
5.1.40.0000.0239.96
5.1.30.0030.02310.38
5.1.20.0030.02310.26
5.1.10.0000.02710.00
5.1.00.0030.02310.16
5.0.50.0030.0178.76
5.0.40.0030.0178.46
5.0.30.0030.0278.44
5.0.20.0030.0178.19
5.0.10.0000.0208.39
5.0.00.0000.0308.16
4.4.90.0000.0177.99
4.4.80.0000.0177.99
4.4.70.0070.0107.99
4.4.60.0000.0177.99
4.4.50.0030.0107.99
4.4.40.0000.0237.99
4.4.30.0000.0177.99
4.4.20.0000.0177.99
4.4.10.0030.0107.99
4.4.00.0000.0237.99
4.3.110.0000.0137.99
4.3.100.0030.0107.99
4.3.90.0000.0137.99
4.3.80.0070.0207.99
4.3.70.0000.0137.99
4.3.60.0070.0107.99
4.3.50.0000.0137.99
4.3.40.0030.0207.99
4.3.30.0000.0137.99
4.3.20.0000.0177.99
4.3.10.0000.0137.99
4.3.00.0000.0137.99

preferences:
51.88 ms | 401 KiB | 5 Q