3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface KeyInterface { public function open(); } class MagnetKey implements KeyInterface { public function open() { print 'open by magnet key:'; $this->slide(); } private function slide() { print 'slide down.'; } } class TurnKey implements KeyInterface { public function open() { print 'open by turn key:'; $this->insert(); $this->turn(); } private function insert() { print 'insert key.'; } private function turn() { print 'turn key.'; } } class Key { public function open() { print 'open door:'; $this->insert(); $this->turn(); } private function insert() { print 'insert key.'; } private function turn() { print 'turn key.'; } } class MagnetKeOld extends Key { public function open() { print 'open by magnet key:'; $this->insert(); $this->slide(); } private function slide() { print 'slide key.'; } } $k = new TurnKey(); $k->open(); $mk = new MagnetKey(); $mk->open(); interface Testable { public function test(); } interface MyCountable { public function count(); } abstract class MyAbstract { public abstract function test(); } class MyClass implements Testable, MyCountable { public function test() { print 'this is test method'; } public function count() { print 'this is count method'; } } $o = new MyClass(); $o->test(); $o->count();

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.0030.01618.43
8.3.50.0150.00718.39
8.3.40.0110.00818.67
8.3.30.0110.00418.72
8.3.20.0040.00421.90
8.3.10.0080.00020.38
8.3.00.0080.00020.96
8.2.180.0110.00718.41
8.2.170.0110.00722.96
8.2.160.0120.00320.53
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00422.21
8.2.120.0070.00026.35
8.2.110.0040.00422.04
8.2.100.0090.00317.72
8.2.90.0040.00417.97
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0040.00418.03
8.2.50.0080.00019.66
8.2.40.0040.00422.18
8.2.30.0040.00422.23
8.2.20.0000.00818.07
8.2.10.0040.00417.97
8.2.00.0030.00618.30
8.1.280.0140.00325.92
8.1.270.0040.00423.91
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0000.00822.46
8.1.230.0080.00820.66
8.1.220.0040.00417.77
8.1.210.0040.00418.90
8.1.200.0030.00717.35
8.1.190.0000.00817.22
8.1.180.0000.00818.10
8.1.170.0040.00418.46
8.1.160.0050.00218.88
8.1.150.0040.00420.23
8.1.140.0000.00719.64
8.1.130.0030.00319.10
8.1.120.0000.00717.35
8.1.110.0030.00617.54
8.1.100.0050.00317.52
8.1.90.0040.00417.47
8.1.80.0000.00917.47
8.1.70.0050.00317.46
8.1.60.0070.00017.63
8.1.50.0000.00817.59
8.1.40.0040.00417.52
8.1.30.0000.00817.51
8.1.20.0040.00417.66
8.1.10.0000.00717.64
8.1.00.0000.00817.44
8.0.300.0060.00320.08
8.0.290.0040.00416.63
8.0.280.0030.00318.49
8.0.270.0070.00017.30
8.0.260.0030.00317.28
8.0.250.0040.00416.92
8.0.240.0040.00416.99
8.0.230.0000.00716.98
8.0.220.0030.00316.96
8.0.210.0100.00016.83
8.0.200.0060.00016.87
8.0.190.0040.00316.94
8.0.180.0000.00716.93
8.0.170.0030.00516.86
8.0.160.0060.00316.89
8.0.150.0090.00016.95
8.0.140.0040.00416.88
8.0.130.0030.00313.41
8.0.120.0050.00316.77
8.0.110.0080.00016.76
8.0.100.0070.00016.93
8.0.90.0070.00016.80
8.0.80.0100.00616.97
8.0.70.0040.00416.78
8.0.60.0040.00416.96
8.0.50.0040.00416.96
8.0.30.0090.01016.99
8.0.20.0070.01417.40
8.0.10.0070.00017.09
8.0.00.0140.00416.66
7.4.330.0000.00515.55
7.4.320.0020.00716.49
7.4.300.0040.00416.64
7.4.290.0040.00416.50
7.4.280.0030.00616.62
7.4.270.0030.00316.55
7.4.260.0030.00316.61
7.4.250.0040.00416.60
7.4.240.0080.00016.64
7.4.230.0030.00316.47
7.4.220.0030.01516.61
7.4.210.0040.01116.63
7.4.200.0000.00716.38
7.4.160.0060.01116.59
7.4.150.0110.00617.40
7.4.140.0080.01017.86
7.4.130.0120.00516.59
7.4.120.0110.00716.46
7.4.110.0090.00916.73
7.4.100.0100.00716.50
7.4.90.0130.00316.41
7.4.80.0130.00719.39
7.4.70.0150.00616.54
7.4.60.0060.01216.51
7.4.50.0070.00716.41
7.4.40.0060.01516.46
7.4.30.0120.00616.68
7.4.00.0090.00615.13
7.3.330.0070.00013.09
7.3.320.0030.00313.25
7.3.310.0070.00016.13
7.3.300.0030.00316.32
7.3.290.0060.00816.31
7.3.280.0080.01016.30
7.3.270.0140.00617.40
7.3.260.0080.01216.41
7.3.250.0110.01016.38
7.3.240.0070.01216.29
7.3.230.0100.00716.35
7.3.210.0100.00616.39
7.3.200.0040.01216.43
7.3.190.0070.01016.46
7.3.180.0080.00816.42
7.3.170.0090.00616.26
7.3.160.0130.00316.58
7.3.10.0070.00716.48
7.3.00.0180.00016.25
7.2.330.0000.01716.43
7.2.320.0090.00916.71
7.2.310.0090.01416.67
7.2.300.0070.01116.66
7.2.290.0090.00616.75
7.2.130.0130.00616.85
7.2.120.0100.00616.88
7.2.110.0030.01216.59
7.2.100.0180.00716.86
7.2.90.0070.01116.84
7.2.80.0260.00716.53
7.2.70.0100.01017.02
7.2.60.0060.00916.84
7.2.50.0150.01116.56
7.2.40.0110.00516.90
7.2.30.0150.00516.60
7.2.20.0080.00816.70
7.2.10.0110.00516.98
7.2.00.0040.01417.03
7.1.250.0060.00315.50
7.1.240.0060.00915.53
7.1.230.0070.00715.63
7.1.220.0160.00515.75
7.1.210.0190.00415.62
7.1.200.0090.00615.57
7.1.190.0140.00615.55
7.1.180.0130.00515.57
7.1.170.0190.00015.55
7.1.160.0030.00715.75
7.1.150.0160.01015.68
7.1.140.0080.00815.58
7.1.130.0090.01215.59
7.1.120.0100.00715.55
7.1.110.0130.00615.71
7.1.100.0070.00915.57
7.1.90.0250.00415.59
7.1.80.0080.00815.70
7.1.70.0090.00416.25
7.1.60.0040.00916.45
7.1.50.0140.01115.83
7.1.40.0030.00615.44
7.1.30.0130.01315.36
7.1.20.0200.04927.82
7.1.10.0140.03218.81
7.1.00.0080.04318.94
7.0.330.0080.00315.39
7.0.320.0100.00715.18
7.0.310.0060.00615.30
7.0.300.0140.00015.30
7.0.290.0060.00315.14
7.0.280.0070.00714.98
7.0.270.0030.00815.13
7.0.260.0170.00015.23
7.0.250.0130.00015.07
7.0.240.0000.00915.04
7.0.230.0060.01015.16
7.0.220.0110.00715.26
7.0.210.0090.00315.30
7.0.200.0030.00815.91
7.0.190.0100.00315.24
7.0.180.0030.01215.23
7.0.170.0030.01515.30
7.0.160.0110.03618.56
7.0.150.0060.04018.51
7.0.140.0080.04618.67
7.0.130.0080.03618.67
7.0.120.0190.02718.49
7.0.110.0190.03718.48
7.0.100.0120.04418.57
7.0.90.0070.03918.59
7.0.80.0100.03318.55
7.0.70.0090.03118.68
7.0.60.0070.04518.45
7.0.50.0070.03518.53
7.0.40.0070.03317.59
7.0.30.0140.03517.46
7.0.20.0080.04017.55
7.0.10.0070.03317.59
7.0.00.0120.03017.59
5.6.380.0090.00914.08

preferences:
64.36 ms | 400 KiB | 5 Q