3v4l.org

run code in 300+ PHP versions simultaneously
<?php class namedClass{ protected $prop; public function __construct($value){ $this->prop = $value; } public function returnProperty($propName){ if( !empty($this->$propName) ){ return $this->$propName; }else{ return null; } } } $standardObject = new namedCLass('The named class'); echo $standardObject->returnProperty('prop')."\n"; class namedExtension extends namedClass{ public function returnProperty($propName){ if( !empty($this->$propName) ){ return $this->$propName.' from standard extenstion'; }else{ return null; } } } $extObject = new namedExtension('The named extension'); echo $extObject->returnProperty('prop')."\n"; $anonObj = new class('The anonymous class') extends namedClass{ public function returnProperty($propName){ if( !empty($this->$propName) ){ return $this->$propName.' from anonymous class'; }else{ return null; } } }; echo $anonObj->returnProperty('prop');

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.00918.27
8.3.50.0140.00718.30
8.3.40.0070.00718.62
8.3.30.0070.00718.65
8.3.20.0070.00020.16
8.3.10.0050.00321.77
8.3.00.0000.00820.09
8.2.180.0070.01118.09
8.2.170.0070.01122.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00017.63
8.2.110.0100.01422.29
8.2.100.0040.00817.93
8.2.90.0000.00919.05
8.2.80.0030.00617.97
8.2.70.0040.00417.25
8.2.60.0060.00317.80
8.2.50.0060.00318.07
8.2.40.0030.00619.32
8.2.30.0000.00720.71
8.2.20.0000.00817.80
8.2.10.0040.00417.98
8.2.00.0060.00318.07
8.1.280.0140.00725.92
8.1.270.0120.00623.82
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0000.00922.53
8.1.230.0080.00417.66
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0080.00018.37
8.1.160.0050.00321.95
8.1.150.0000.00818.92
8.1.140.0040.00717.52
8.1.130.0040.00417.79
8.1.120.0030.00417.38
8.1.110.0070.00017.50
8.1.100.0040.00417.36
8.1.90.0000.00817.53
8.1.80.0030.00517.53
8.1.70.0030.00317.40
8.1.60.0040.00417.61
8.1.50.0040.00417.52
8.1.40.0040.00417.48
8.1.30.0040.00417.65
8.1.20.0000.00717.52
8.1.10.0000.00817.45
8.1.00.0070.00017.57
8.0.300.0000.00818.77
8.0.290.0060.00316.75
8.0.280.0000.00718.46
8.0.270.0000.00817.20
8.0.260.0030.00317.32
8.0.250.0000.00816.91
8.0.240.0000.00716.91
8.0.230.0050.00317.02
8.0.220.0000.00716.96
8.0.210.0040.00416.92
8.0.200.0000.00617.01
8.0.190.0030.00616.88
8.0.180.0000.00816.80
8.0.170.0040.00416.91
8.0.160.0070.00016.87
8.0.150.0040.00416.91
8.0.140.0000.00816.88
8.0.130.0030.00313.32
8.0.120.0050.00316.76
8.0.110.0040.00416.92
8.0.100.0040.00416.98
8.0.90.0000.00716.74
8.0.80.0070.01316.93
8.0.70.0000.00816.78
8.0.60.0080.00016.95
8.0.50.0050.00216.96
8.0.30.0090.00916.92
8.0.20.0100.00817.40
8.0.10.0040.00416.98
8.0.00.0070.01116.79
7.4.330.0000.00515.08
7.4.320.0000.00616.67
7.4.300.0070.00016.67
7.4.290.0000.00716.67
7.4.280.0070.00016.50
7.4.270.0000.00716.64
7.4.260.0000.00716.58
7.4.250.0000.00716.50
7.4.240.0050.00316.55
7.4.230.0000.00716.61
7.4.220.0120.00816.64
7.4.210.0110.00416.61
7.4.200.0040.00416.42
7.4.160.0080.00816.48
7.4.150.0080.00817.40
7.4.140.0100.00917.86
7.4.130.0040.01416.43
7.4.120.0070.01016.46
7.4.110.0080.00816.35
7.4.100.0190.00316.67
7.4.90.0070.01316.49
7.4.80.0040.01219.39
7.4.70.0080.00916.55
7.4.60.0110.00616.55
7.4.50.0030.00616.40
7.4.40.0120.01316.45
7.4.30.0060.01516.34
7.4.00.0070.01015.02
7.3.330.0050.00013.45
7.3.320.0000.00613.42
7.3.310.0070.00016.20
7.3.300.0030.00316.24
7.3.290.0080.00916.38
7.3.280.0120.00816.35
7.3.270.0110.00617.40
7.3.260.0140.00716.39
7.3.250.0080.01016.45
7.3.240.0080.01116.65
7.3.230.0100.00716.41
7.3.210.0110.00616.48
7.3.200.0070.01016.32
7.3.190.0160.00816.35
7.3.180.0080.00816.45
7.3.170.0070.01116.45
7.3.160.0060.01016.58
7.2.330.0150.00916.51
7.2.320.0160.00616.72
7.2.310.0100.01316.46
7.2.300.0040.01216.49
7.2.290.0000.01616.59
7.2.60.0130.01016.68
7.2.00.0040.00819.48
7.1.200.0110.00315.75
7.1.100.0070.00418.06
7.1.70.0000.00817.08
7.1.60.0110.01419.11
7.1.50.0070.01517.06
7.1.00.0070.07322.36
7.0.200.0000.01016.72
7.0.60.0070.04719.96
7.0.50.0070.08017.90
7.0.40.0100.08720.11
7.0.30.0300.07720.34
7.0.20.0270.04720.16
7.0.10.0030.07020.23
7.0.00.0030.06720.22
5.6.280.0070.05321.03
5.6.210.0170.06020.46
5.6.200.0130.04318.14
5.6.190.0070.08020.48
5.6.180.0500.05320.41
5.6.170.0170.04720.54
5.6.160.0170.07720.39
5.6.150.0100.03318.18
5.6.140.0000.09018.20
5.6.130.0100.08018.16
5.6.120.0130.08721.14
5.6.110.0070.07721.05
5.6.100.0030.05720.96
5.6.90.0030.08021.11
5.6.80.0030.07720.53
5.5.350.0170.03720.30
5.5.340.0100.03318.02
5.5.330.0100.08020.21
5.5.320.0000.04320.34
5.5.310.0430.04020.35
5.5.300.0100.04717.99
5.5.290.0030.04018.07
5.5.280.0130.06320.86
5.5.270.0030.06720.64
5.5.260.0030.07020.78
5.5.250.0030.06320.62
5.5.240.0130.06320.17
5.4.450.0930.05019.42
5.4.440.0900.06019.57
5.4.430.1100.05019.41
5.4.420.0930.05019.23
5.4.410.0800.05719.27
5.4.400.0800.05719.26
5.4.390.0900.06019.26
5.4.380.0770.04719.19
5.4.370.0770.05319.30
5.4.360.0900.05719.19
5.4.350.0930.04719.11
5.4.340.0970.04018.84
5.4.320.0730.05019.25
5.4.310.0770.05719.19
5.4.300.0830.05019.23
5.4.290.0630.05018.85
5.4.280.0670.05318.90
5.4.270.0670.05019.23
5.4.260.0670.05319.01
5.4.250.0600.05319.23
5.4.240.0700.04319.29
5.4.230.0630.05019.22
5.4.220.0670.05019.25
5.4.210.0670.05019.30
5.4.200.0670.04719.25
5.4.190.0900.05719.09
5.4.180.0630.05019.08
5.4.170.0670.05319.24
5.4.160.0670.04719.07
5.4.150.0670.05319.16
5.4.140.0630.05016.44
5.4.130.0600.04716.39
5.4.120.0600.05716.41
5.4.110.0630.05016.30
5.4.100.0770.05716.52
5.4.90.0670.05016.61
5.4.80.0800.03316.54
5.4.70.0200.03716.57
5.4.60.0270.05316.51
5.4.50.0430.04316.51
5.4.40.0300.06316.33
5.4.30.0330.06316.42
5.4.20.0330.03716.53
5.4.10.0330.03716.23

preferences:
49.4 ms | 400 KiB | 5 Q