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{ private $anotherProp = 'Extended property'; } $extObject = new namedExtension('The named extension'); echo $extObject->returnProperty('anotherPropery')."\n"; $anonObj = new class('The anonymous class') extends namedClass{ private $anotherProp = 'Anonymous property'; }; echo $anonObj->returnProperty('anotherProp');

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.70.0110.00418.55
8.3.60.0070.00718.68
8.3.50.0140.00721.02
8.3.40.0070.00718.69
8.3.30.0070.00718.71
8.3.20.0040.00420.26
8.3.10.0080.00021.87
8.3.00.0000.00820.34
8.2.180.0150.00018.11
8.2.170.0140.00422.96
8.2.160.0090.00920.29
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00317.50
8.2.110.0060.00319.20
8.2.100.0070.00417.78
8.2.90.0070.00019.27
8.2.80.0090.00017.97
8.2.70.0000.00817.50
8.2.60.0050.00317.80
8.2.50.0060.00318.07
8.2.40.0040.00419.32
8.2.30.0030.00320.70
8.2.20.0040.00417.61
8.2.10.0000.00717.93
8.2.00.0030.00618.08
8.1.280.0060.00925.92
8.1.270.0100.01323.93
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00421.42
8.1.230.0030.00917.42
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0080.00017.00
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0050.00221.93
8.1.150.0000.00718.85
8.1.140.0030.00617.46
8.1.130.0030.00317.63
8.1.120.0030.00517.43
8.1.110.0080.00017.42
8.1.100.0050.00317.49
8.1.90.0050.00217.35
8.1.80.0040.00417.36
8.1.70.0050.00217.45
8.1.60.0000.00817.47
8.1.50.0000.00817.51
8.1.40.0040.00417.50
8.1.30.0030.00517.73
8.1.20.0040.00417.68
8.1.10.0030.00617.48
8.1.00.0020.00517.48
8.0.300.0030.00618.77
8.0.290.0030.00516.75
8.0.280.0000.00718.51
8.0.270.0030.00617.21
8.0.260.0000.00817.33
8.0.250.0070.00016.87
8.0.240.0000.00716.85
8.0.230.0000.00816.91
8.0.220.0030.00316.76
8.0.210.0030.00516.86
8.0.200.0030.00616.89
8.0.190.0040.00416.91
8.0.180.0000.00916.97
8.0.170.0040.00416.82
8.0.160.0070.00016.81
8.0.150.0000.00716.75
8.0.140.0000.00716.94
8.0.130.0060.00013.30
8.0.120.0030.00616.89
8.0.110.0080.00016.94
8.0.100.0050.00316.92
8.0.90.0050.00216.88
8.0.80.0060.01216.93
8.0.70.0030.00716.70
8.0.60.0000.00716.75
8.0.50.0040.00416.88
8.0.30.0100.00717.04
8.0.20.0070.01317.40
8.0.10.0000.00817.13
8.0.00.0110.01216.88
7.4.330.0020.00215.08
7.4.320.0030.00316.63
7.4.300.0030.00316.58
7.4.290.0030.00316.56
7.4.280.0000.00716.55
7.4.270.0070.00016.61
7.4.260.0030.00316.35
7.4.250.0070.00016.57
7.4.240.0050.00216.61
7.4.230.0070.00016.47
7.4.220.0140.00916.68
7.4.210.0130.00316.54
7.4.200.0000.00816.59
7.4.160.0030.02016.52
7.4.150.0060.01217.40
7.4.140.0120.00917.86
7.4.130.0100.00716.58
7.4.120.0090.00816.44
7.4.110.0040.01816.61
7.4.100.0140.00716.51
7.4.90.0070.01716.52
7.4.80.0070.01019.39
7.4.70.0040.01316.59
7.4.60.0130.00416.42
7.4.50.0030.00316.58
7.4.40.0100.01116.40
7.4.30.0110.00816.57
7.4.00.0070.00714.74
7.3.330.0030.00313.34
7.3.320.0000.00513.37
7.3.310.0030.00316.27
7.3.300.0060.00016.34
7.3.290.0070.00916.38
7.3.280.0080.01416.36
7.3.270.0040.01317.40
7.3.260.0090.00916.45
7.3.250.0070.01116.47
7.3.240.0100.00716.43
7.3.230.0070.01016.39
7.3.210.0030.01316.37
7.3.200.0100.00716.43
7.3.190.0170.00016.50
7.3.180.0090.00916.41
7.3.170.0070.01016.34
7.3.160.0030.01316.41
7.3.120.0000.02015.13
7.3.110.0100.00714.87
7.3.100.0070.01014.70
7.3.90.0070.01114.88
7.3.80.0000.01014.99
7.3.70.0030.01314.60
7.3.60.0030.00615.00
7.3.50.0040.01115.01
7.3.40.0060.00614.76
7.3.30.0040.01214.92
7.3.20.0000.01316.46
7.3.10.0000.01316.34
7.3.00.0030.01016.64
7.2.330.0120.00616.72
7.2.320.0070.01316.49
7.2.310.0160.00616.67
7.2.300.0080.00816.58
7.2.290.0180.00516.72
7.2.250.0090.00915.39
7.2.240.0030.01714.97
7.2.230.0100.00715.04
7.2.220.0030.00915.02
7.2.210.0040.01115.27
7.2.200.0030.01315.19
7.2.190.0070.00315.11
7.2.180.0100.00714.96
7.2.170.0030.01015.11
7.2.60.0170.00816.94
7.2.00.0040.00719.26
7.1.330.0060.00815.93
7.1.320.0030.01115.73
7.1.310.0030.01415.72
7.1.300.0090.00315.78
7.1.290.0050.00516.00
7.1.280.0000.00815.60
7.1.270.0000.00815.68
7.1.260.0060.00315.97
7.1.200.0040.00815.81
7.1.100.0030.00618.28
7.1.70.0000.00817.13
7.1.60.0110.01519.11
7.1.50.0090.00916.95
7.1.00.0070.07322.31
7.0.200.0030.00716.43
7.0.60.0070.03719.95
7.0.50.0070.05717.78
7.0.40.0100.08720.24
7.0.30.0270.05320.10
7.0.20.0330.05720.30
7.0.10.0100.03720.33
7.0.00.0030.04720.27
5.6.280.0030.06721.03
5.6.210.0100.05720.68
5.6.200.0000.08718.19
5.6.190.0100.04720.61
5.6.180.0300.04720.68
5.6.170.0230.07320.45
5.6.160.0070.04020.45
5.6.150.0030.04318.16
5.6.140.0170.03318.17
5.6.130.0030.04318.16
5.6.120.0130.07721.01
5.6.110.0070.07721.11
5.6.100.0030.07721.09
5.6.90.0130.08320.88
5.6.80.0100.06720.36
5.5.350.0400.06720.43
5.5.340.0030.04017.96
5.5.330.0100.06320.29
5.5.320.0000.08020.27
5.5.310.0300.04720.30
5.5.300.0170.07018.07
5.5.290.0100.07718.07
5.5.280.0070.08320.97
5.5.270.0000.05020.79
5.5.260.0070.06020.68
5.5.250.0070.08320.59
5.5.240.0070.07720.28
5.4.450.0670.05319.38
5.4.440.0670.08019.34
5.4.430.0870.05319.43
5.4.420.0630.05719.38
5.4.410.0700.05019.45
5.4.400.0770.04019.26
5.4.390.0670.05018.84
5.4.380.0700.04719.19
5.4.370.0730.04319.25
5.4.360.0630.05719.21
5.4.350.0630.05318.84
5.4.340.0770.06319.30
5.4.320.0800.05019.06
5.4.310.0570.06019.25
5.4.300.0770.03719.08
5.4.290.0700.06719.18
5.4.280.0630.05319.22
5.4.270.0800.05719.06
5.4.260.0900.07719.22
5.4.250.0870.05019.07
5.4.240.0670.05019.30
5.4.230.0670.05718.83
5.4.220.0700.05318.83
5.4.210.0570.05719.25
5.4.200.0770.05718.83
5.4.190.0830.03718.89
5.4.180.0600.05719.07
5.4.170.0600.06019.20
5.4.160.0670.05019.28
5.4.150.0670.06319.05
5.4.140.0670.04716.45
5.4.130.0670.04316.37
5.4.120.0730.04316.71
5.4.110.0600.05716.43
5.4.100.0700.05016.47
5.4.90.0700.04716.67
5.4.80.0630.04716.52
5.4.70.0170.06316.48
5.4.60.0230.06716.43
5.4.50.0300.06716.42
5.4.40.0200.03016.43
5.4.30.0300.03716.33
5.4.20.0270.06316.43
5.4.10.0270.04316.53

preferences:
49.17 ms | 401 KiB | 5 Q