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 { // Le he metido el null para que el parametro sea opcional public function speak ( $what ) { 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 . PHP_EOL; echo 'Speak of the super class: ' . $charlie->speak('hello, my name is ' . $charlie->name) . PHP_EOL; echo 'Speak of the dog class: ' . $charlie->speak() . PHP_EOL;

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.0100.01016.88
8.3.50.0150.01516.54
8.3.40.0150.00718.96
8.3.30.0090.00619.02
8.3.20.0080.00018.67
8.3.10.0060.00318.63
8.3.00.0030.00619.38
8.2.180.0140.00717.00
8.2.170.0140.00722.96
8.2.160.0030.01318.93
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00419.66
8.2.110.0070.00322.30
8.2.100.0060.00617.91
8.2.90.0040.00419.22
8.2.80.0000.00817.97
8.2.70.0100.00017.63
8.2.60.0030.00618.04
8.2.50.0040.00417.93
8.2.40.0060.00319.36
8.2.30.0050.00417.69
8.2.20.0060.00317.72
8.2.10.0000.00717.64
8.2.00.0020.00517.69
8.1.280.0110.01125.92
8.1.270.0040.00423.99
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0050.00522.05
8.1.230.0030.00920.88
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0030.00618.10
8.1.170.0050.00317.62
8.1.160.0020.00519.14
8.1.150.0060.00318.68
8.1.140.0000.00717.54
8.1.130.0000.00719.32
8.1.120.0050.00317.51
8.1.110.0030.00517.35
8.1.100.0040.00417.44
8.1.90.0020.00517.50
8.1.80.0000.00817.52
8.1.70.0000.00817.47
8.1.60.0000.00717.52
8.1.50.0070.00017.39
8.1.40.0040.00417.54
8.1.30.0080.00017.69
8.1.20.0040.00817.57
8.1.10.0040.00417.50
8.1.00.0050.00317.54
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0040.00418.61
8.0.270.0000.00717.17
8.0.260.0030.00316.90
8.0.250.0030.00717.09
8.0.240.0030.00317.05
8.0.230.0070.00017.10
8.0.220.0030.00317.00
8.0.210.0070.00017.02
8.0.200.0060.00017.02
8.0.190.0050.00317.05
8.0.180.0040.00416.94
8.0.170.0040.00416.91
8.0.160.0030.00516.98
8.0.150.0000.00816.81
8.0.140.0000.00716.95
8.0.130.0050.00013.45
8.0.120.0030.00516.89
8.0.110.0040.00416.93
8.0.100.0000.00817.02
8.0.90.0070.00016.76
8.0.80.0130.00317.04
8.0.70.0000.00816.86
8.0.60.0040.00416.89
8.0.50.0000.00816.88
8.0.30.0030.01416.92
8.0.20.0100.00817.09
8.0.10.0070.00016.90
8.0.00.0100.01216.81
7.4.330.0000.00513.00
7.4.320.0060.00016.46
7.4.300.0060.00016.45
7.4.290.0060.00316.54
7.4.280.0030.00316.49
7.4.270.0000.00716.50
7.4.260.0030.00313.41
7.4.250.0000.00816.51
7.4.240.0000.00716.59
7.4.230.0070.00016.41
7.4.220.0090.01616.41
7.4.210.0090.01216.63
7.4.200.0000.00716.60
7.4.190.0000.00816.43
7.4.160.0140.00316.72
7.4.150.0200.01016.54
7.4.140.0090.01317.86
7.4.130.0120.01516.43
7.4.120.0070.01016.64
7.4.110.0090.00916.64
7.4.100.0060.01516.52
7.4.90.0170.00316.37
7.4.80.0130.00319.39
7.4.70.0100.00716.42
7.4.60.0080.00816.61
7.4.50.0030.00316.19
7.4.40.0100.00316.58
7.4.30.0060.01216.49
7.4.10.0110.00916.68
7.4.00.0060.00915.45
7.3.330.0030.00313.21
7.3.320.0050.00013.32
7.3.310.0000.00716.40
7.3.300.0030.00316.24
7.3.290.0090.00716.42
7.3.280.0120.00916.45
7.3.270.0030.01316.46
7.3.260.0100.01416.55
7.3.240.0100.00716.55
7.3.230.0070.01016.54
7.3.210.0120.00616.52
7.3.200.0100.00616.50
7.3.190.0030.01516.46
7.3.180.0070.01016.55
7.3.170.0140.00316.61
7.3.160.0090.00616.61
7.3.130.0060.01216.37
7.3.120.0080.00815.47
7.3.110.0080.00815.54
7.3.100.0060.00715.82
7.3.90.0050.01215.49
7.3.80.0100.00515.47
7.3.70.0000.00915.60
7.3.60.0070.00915.58
7.3.50.0150.00115.59
7.3.40.0080.00915.65
7.3.30.0050.00915.55
7.3.20.0070.00817.45
7.3.10.0050.00817.54
7.3.00.0060.00717.41
7.2.330.0060.01216.64
7.2.320.0060.01316.40
7.2.310.0070.01116.66
7.2.300.0060.01116.44
7.2.290.0140.00716.61
7.2.260.0070.01316.48
7.2.250.0140.00515.57
7.2.240.0040.01115.76
7.2.230.0050.01216.05
7.2.220.0090.00315.93
7.2.210.0050.01215.98
7.2.200.0050.01115.93
7.2.190.0080.01015.68
7.2.180.0080.00715.68
7.2.170.0050.01115.81
7.2.160.0060.00616.77
7.2.150.0060.00618.28
7.2.140.0040.00818.51
7.2.130.0120.00018.37
7.2.120.0090.00318.48
7.2.110.0100.00318.50
7.2.100.0030.00718.57
7.2.90.0030.01018.71
7.2.80.0090.00318.35
7.2.70.0060.00618.63
7.2.60.0030.01117.68
7.2.50.0060.00618.30
7.2.40.0030.01318.33
7.2.30.0120.00318.45
7.2.20.0090.00618.56
7.2.10.0100.00318.55
7.2.00.0040.00718.28
7.1.330.0010.01116.37
7.1.320.0070.00716.41
7.1.310.0020.01116.56
7.1.300.0110.00616.55
7.1.290.0070.00716.71
7.1.280.0050.00816.63
7.1.270.0020.01216.35
7.1.260.0020.01216.63
7.1.250.0030.01017.18
7.1.240.0060.00917.23
7.1.230.0030.00717.32
7.1.220.0080.00417.47
7.1.210.0030.00817.23
7.1.200.0080.00516.57
7.1.190.0030.00617.28
7.1.180.0060.00617.28
7.1.170.0100.00317.29
7.1.160.0060.01017.53
7.1.150.0130.00317.32
7.1.140.0040.00817.34
7.1.130.0120.00417.22
7.1.120.0090.00617.30
7.1.110.0130.00017.39
7.1.100.0040.01117.41
7.1.90.0070.00317.44
7.1.80.0060.00917.52
7.1.70.0020.00817.37
7.1.60.0020.01018.30
7.1.50.0050.01117.10
7.1.40.0070.00317.31
7.1.30.0000.01517.25
7.1.20.0070.00317.39
7.1.10.0040.01117.38
7.1.00.0020.02419.81
7.0.330.0030.01016.88
7.0.320.0070.00717.06
7.0.310.0070.00717.05
7.0.300.0030.01016.78
7.0.290.0080.00816.94
7.0.280.0030.01016.96
7.0.270.0030.01016.80
7.0.260.0100.00317.09
7.0.250.0000.01017.00
7.0.240.0070.00717.05
7.0.230.0000.01417.08
7.0.220.0040.00816.92
7.0.210.0000.00917.16
7.0.200.0040.00516.93
7.0.190.0070.00416.89
7.0.180.0070.00716.89
7.0.170.0070.00716.96
7.0.160.0130.00017.12
7.0.150.0060.00917.00
7.0.140.0060.04019.50
7.0.130.0110.00417.18
7.0.120.0050.03819.57
7.0.110.0040.00717.04
7.0.100.0040.01117.14
7.0.90.0040.01416.93
7.0.80.0050.00816.94
7.0.70.0130.00316.93
7.0.60.0030.02318.49
7.0.50.0080.04717.41
7.0.40.0080.02816.49
7.0.30.0070.04216.51
7.0.20.0090.04516.38
7.0.10.0110.02716.43
7.0.00.0070.02316.33
5.6.400.0030.01016.25
5.6.390.0040.01116.10
5.6.380.0070.01115.73
5.6.370.0060.00315.93
5.6.360.0040.00715.59
5.6.350.0080.00815.96
5.6.340.0040.00816.07
5.6.330.0070.00815.64
5.6.320.0000.01216.23
5.6.310.0070.00715.65
5.6.300.0090.00616.01
5.6.290.0090.00915.94
5.6.280.0020.04518.56
5.6.270.0070.01015.66
5.6.260.0040.01115.84
5.6.250.0100.00615.95
5.6.240.0060.00915.90
5.6.230.0070.00915.98
5.6.220.0100.00715.98
5.6.210.0070.03818.33
5.6.200.0080.02816.98
5.6.190.0050.03516.97
5.6.180.0100.02017.02
5.6.170.0070.04317.02
5.6.160.0090.04017.07
5.6.150.0120.03517.06
5.6.140.0070.02217.09
5.6.130.0050.02817.06
5.6.120.0050.03517.09
5.6.110.0080.02516.94
5.6.100.0190.03617.07
5.6.90.0050.03017.03
5.6.80.0030.03016.58
5.6.70.0070.04716.69
5.6.60.0070.04216.64
5.6.50.0030.02516.62
5.6.40.0100.04416.86
5.6.30.0080.04016.74
5.6.20.0030.03216.79
5.6.10.0040.03116.65
5.6.00.0050.04216.78
5.5.380.0040.01115.71
5.5.370.0060.00615.92
5.5.360.0100.00715.98
5.5.350.0160.01718.13
5.5.340.0100.03516.89
5.5.330.0130.03616.88
5.5.320.0160.03216.96
5.5.310.0050.04316.80
5.5.300.0060.02316.83
5.5.290.0080.03616.92
5.5.280.0100.02516.76
5.5.270.0070.02716.93
5.5.260.0080.04516.85
5.5.250.0070.04516.86
5.5.240.0050.03116.60
5.5.230.0030.04016.49
5.5.220.0040.04616.63
5.5.210.0090.03016.41
5.5.200.0070.02216.53
5.5.190.0050.03516.51
5.5.180.0040.02716.54
5.5.170.0070.00715.70
5.5.160.0060.03616.59
5.5.150.0040.02916.42
5.5.140.0110.02316.59
5.5.130.0050.02916.45
5.5.120.0030.03316.57
5.5.110.0050.04216.57
5.5.100.0050.03016.39
5.5.90.0080.02216.52
5.5.80.0060.03816.33
5.5.70.0070.02416.41
5.5.60.0070.04216.42
5.5.50.0050.03016.33
5.5.40.0000.03216.46
5.5.30.0040.04116.46
5.5.20.0070.04216.32
5.5.10.0060.03916.52
5.5.00.0080.02616.44
5.4.450.0050.04416.01
5.4.440.0030.03116.12
5.4.430.0080.04216.03
5.4.420.0090.02616.17
5.4.410.0020.03815.93
5.4.400.0090.04215.79
5.4.390.0040.03015.75
5.4.380.0070.02815.83
5.4.370.0070.03915.77
5.4.360.0020.02615.72
5.4.350.0050.03715.85
5.4.340.0050.03716.01
5.4.330.0000.00712.44
5.4.320.0080.04215.79
5.4.310.0020.03815.72
5.4.300.0100.03715.74
5.4.290.0080.03815.89
5.4.280.0110.03315.87
5.4.270.0050.04215.87
5.4.260.0070.04315.75
5.4.250.0070.02115.81
5.4.240.0070.02615.78
5.4.230.0060.03915.82
5.4.220.0050.04615.84
5.4.210.0030.04615.91
5.4.200.0100.02215.84
5.4.190.0060.03715.92
5.4.180.0020.04415.86
5.4.170.0070.03215.84
5.4.160.0060.03015.75
5.4.150.0070.04115.91
5.4.140.0050.04214.50
5.4.130.0050.03814.54
5.4.120.0070.03814.58
5.4.110.0030.03514.46
5.4.100.0080.02014.44
5.4.90.0070.02514.45
5.4.80.0080.01914.55
5.4.70.0040.04014.50
5.4.60.0090.03714.38
5.4.50.0020.03114.40
5.4.40.0050.01814.56
5.4.30.0000.02414.42
5.4.20.0030.04314.42
5.4.10.0090.03514.45
5.4.00.0120.03514.23
5.3.290.0030.04513.94
5.3.280.0080.03813.84
5.3.270.0030.04813.84
5.3.260.0050.03813.87
5.3.250.0060.04113.91
5.3.240.0080.04013.85
5.3.230.0050.04213.90
5.3.220.0120.02213.78
5.3.210.0030.02613.67
5.3.200.0020.02713.74
5.3.190.0020.04213.87
5.3.180.0050.02313.92
5.3.170.0030.04313.95
5.3.160.0070.02813.86
5.3.150.0020.04613.80
5.3.140.0080.02013.91
5.3.130.0030.03113.80
5.3.120.0060.03613.72
5.3.110.0030.03213.83
5.3.100.0120.02513.53
5.3.90.0030.02513.58
5.3.80.0050.02013.61
5.3.70.0070.03713.56
5.3.60.0080.02913.56
5.3.50.0070.04013.59
5.3.40.0050.02613.65
5.3.30.0030.02313.50
5.3.20.0070.01813.38
5.3.10.0030.02113.36
5.3.00.0050.02013.17
5.2.170.0030.05311.20
5.2.160.0170.05011.12
5.2.150.0100.05711.05
5.2.140.0030.03011.14
5.2.130.0000.03011.11
5.2.120.0070.02711.11
5.2.110.0070.03011.14
5.2.100.0000.03011.15
5.2.90.0070.02311.17
5.2.80.0030.02711.20
5.2.70.0030.03311.16
5.2.60.0000.03011.11
5.2.50.0000.04010.93
5.2.40.0000.03011.11
5.2.30.0030.02711.00
5.2.20.0000.03011.04
5.2.10.0030.02710.77
5.2.00.0030.02710.82
5.1.60.0030.0209.99
5.1.50.0000.02310.00
5.1.40.0000.02710.19
5.1.30.0030.02310.38
5.1.20.0000.02710.46
5.1.10.0030.02310.07
5.1.00.0000.02710.13
5.0.50.0000.0208.54
5.0.40.0000.0208.63
5.0.30.0000.0308.32
5.0.20.0030.0178.12
5.0.10.0000.0208.14
5.0.00.0030.0278.16
4.4.90.0030.0137.99
4.4.80.0030.0137.99
4.4.70.0000.0177.99
4.4.60.0000.0177.99
4.4.50.0030.0137.99
4.4.40.0000.0237.99
4.4.30.0070.0107.99
4.4.20.0000.0177.99
4.4.10.0000.0177.99
4.4.00.0030.0207.99
4.3.110.0000.0177.99
4.3.100.0000.0177.99
4.3.90.0000.0137.99
4.3.80.0000.0237.99
4.3.70.0030.0137.99
4.3.60.0000.0137.99
4.3.50.0030.0137.99
4.3.40.0000.0237.99
4.3.30.0000.0177.99
4.3.20.0000.0177.99
4.3.10.0000.0177.99
4.3.00.0000.0137.99

preferences:
45.63 ms | 401 KiB | 5 Q