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 'property not found'; } } } $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('anotherProp')."\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.60.0110.00318.30
8.3.50.0110.00316.60
8.3.40.0150.00018.67
8.3.30.0060.00918.80
8.3.20.0030.00622.01
8.3.10.0040.00421.90
8.3.00.0050.00220.38
8.2.180.0060.00918.42
8.2.170.0110.00722.96
8.2.160.0030.01020.52
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0040.00822.29
8.2.100.0000.01117.80
8.2.90.0040.00419.22
8.2.80.0000.00817.97
8.2.70.0030.00517.50
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0070.00019.38
8.2.30.0000.00720.56
8.2.20.0050.00217.69
8.2.10.0080.00018.00
8.2.00.0000.00818.02
8.1.280.0130.00725.92
8.1.270.0040.01423.93
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00022.52
8.1.230.0120.00017.65
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0000.00917.48
8.1.190.0000.00817.11
8.1.180.0040.00418.10
8.1.170.0030.00618.49
8.1.160.0070.00021.94
8.1.150.0000.00718.95
8.1.140.0030.00617.46
8.1.130.0030.00317.61
8.1.120.0000.00717.45
8.1.110.0040.00417.45
8.1.100.0000.00717.43
8.1.90.0040.00417.41
8.1.80.0000.00717.34
8.1.70.0070.00017.43
8.1.60.0040.00417.50
8.1.50.0040.00417.41
8.1.40.0050.00217.55
8.1.30.0050.00317.66
8.1.20.0050.00217.48
8.1.10.0040.00417.44
8.1.00.0030.00617.58
8.0.300.0020.00518.77
8.0.290.0000.00716.63
8.0.280.0030.00318.50
8.0.270.0040.00417.34
8.0.260.0060.00017.21
8.0.250.0030.00516.85
8.0.240.0060.00016.86
8.0.230.0040.00416.94
8.0.220.0040.00416.79
8.0.210.0040.00416.80
8.0.200.0000.00616.96
8.0.190.0000.00716.89
8.0.180.0080.00016.82
8.0.170.0030.00616.81
8.0.160.0050.00216.91
8.0.150.0000.00816.79
8.0.140.0000.00716.87
8.0.130.0050.00013.35
8.0.120.0050.00316.76
8.0.110.0040.00416.82
8.0.100.0060.00316.89
8.0.90.0000.00716.79
8.0.80.0060.01016.91
8.0.70.0040.00416.89
8.0.60.0040.00416.93
8.0.50.0000.00816.80
8.0.30.0060.01316.95
8.0.20.0090.01017.40
8.0.10.0040.00416.98
8.0.00.0080.01016.85
7.4.330.0020.00215.08
7.4.320.0060.00016.59
7.4.300.0030.00316.41
7.4.290.0000.00716.51
7.4.280.0060.00316.52
7.4.270.0000.00816.52
7.4.260.0000.00816.59
7.4.250.0040.00416.36
7.4.240.0030.00416.54
7.4.230.0000.00716.48
7.4.220.0080.01016.51
7.4.210.0040.01216.44
7.4.200.0030.00316.71
7.4.160.0000.01616.39
7.4.150.0120.00617.40
7.4.140.0160.00717.86
7.4.130.0130.00716.44
7.4.120.0110.00716.43
7.4.110.0100.01316.48
7.4.100.0040.01816.64
7.4.90.0100.00716.45
7.4.80.0100.00719.39
7.4.70.0030.01516.42
7.4.60.0120.00316.61
7.4.50.0000.00616.54
7.4.40.0160.01016.71
7.4.30.0030.02016.76
7.4.00.0090.00615.13
7.3.330.0050.00013.34
7.3.320.0000.00513.36
7.3.310.0000.00716.41
7.3.300.0000.00716.29
7.3.290.0100.00316.37
7.3.280.0100.00816.32
7.3.270.0130.00317.40
7.3.260.0090.00916.42
7.3.250.0090.01216.36
7.3.240.0100.01016.25
7.3.230.0130.00316.39
7.3.210.0030.01316.35
7.3.200.0100.00716.55
7.3.190.0090.00616.64
7.3.180.0130.00316.40
7.3.170.0150.00316.44
7.3.160.0110.00516.44
7.3.10.0100.01016.57
7.3.00.0190.00516.50
7.2.330.0050.01416.69
7.2.320.0130.00316.66
7.2.310.0130.01016.79
7.2.300.0030.01316.74
7.2.290.0060.01216.80
7.2.130.0130.01616.28
7.2.120.0100.01616.81
7.2.110.0220.00616.89
7.2.100.0120.00616.63
7.2.90.0190.00816.57
7.2.80.0120.00616.64
7.2.70.0170.00616.65
7.2.60.0070.00716.73
7.2.50.0110.00516.68
7.2.40.0140.00716.38
7.2.30.0090.00616.67
7.2.20.0090.00616.85
7.2.10.0030.01316.80
7.2.00.0020.01518.00
7.1.250.0080.01515.29
7.1.200.0060.00615.71
7.1.100.0000.01318.07
7.1.70.0030.00316.90
7.1.60.0060.01819.11
7.1.50.0100.01416.85
7.1.00.0000.07722.30
7.0.200.0000.01016.62
7.0.60.0030.04719.84
7.0.50.0070.04317.97
7.0.40.0100.06320.40
7.0.30.0230.05320.19
7.0.20.0530.06320.16
7.0.10.0070.04020.25
7.0.00.0000.04320.16
5.6.280.0030.06721.09
5.6.210.0000.04320.68
5.6.200.0070.03718.16
5.6.190.0030.05720.57
5.6.180.0470.05720.48
5.6.170.0270.05020.44
5.6.160.0100.08320.39
5.6.150.0030.04018.16
5.6.140.0070.04318.27
5.6.130.0030.08018.28
5.6.120.0100.03321.06
5.6.110.0030.05721.12
5.6.100.0100.06021.12
5.6.90.0070.07020.97
5.6.80.0130.07720.52
5.5.350.0270.08020.36
5.5.340.0070.05317.93
5.5.330.0130.06320.35
5.5.320.0000.04720.38
5.5.310.0270.08020.31
5.5.300.0030.08317.95
5.5.290.0100.07017.98
5.5.280.0000.05320.78
5.5.270.0100.06020.86
5.5.260.0100.05320.98
5.5.250.0000.06020.80
5.5.240.0070.08320.16
5.4.450.0800.07019.54
5.4.440.1000.06019.41
5.4.430.0900.05319.51
5.4.420.0870.05319.16
5.4.410.0870.06019.27
5.4.400.1070.06019.30
5.4.390.0970.06319.08
5.4.380.0770.05319.33
5.4.370.0730.04719.23
5.4.360.0870.07319.30
5.4.350.0630.06718.84
5.4.340.0670.06019.21
5.4.320.0700.06319.23
5.4.310.0700.05019.21
5.4.300.0730.04719.11
5.4.290.0700.05018.84
5.4.280.0630.06019.08
5.4.270.0800.04319.25
5.4.260.0670.05319.22
5.4.250.0700.05019.21
5.4.240.0630.05319.05
5.4.230.0630.05319.24
5.4.220.0700.05719.25
5.4.210.0870.04719.10
5.4.200.0730.04719.00
5.4.190.0730.06319.06
5.4.180.0670.06319.24
5.4.170.0870.06319.21
5.4.160.0900.05719.17
5.4.150.0800.06318.81
5.4.140.0730.05016.45
5.4.130.0630.05016.51
5.4.120.0870.04716.37
5.4.110.0870.04716.53
5.4.100.0800.05016.32
5.4.90.0800.04716.65
5.4.80.1070.04016.48
5.4.70.0270.07316.39
5.4.60.0170.03716.34
5.4.50.0330.06016.23
5.4.40.0230.04016.48
5.4.30.0270.07016.25
5.4.20.0270.04716.56
5.4.10.0200.03716.52

preferences:
59.73 ms | 400 KiB | 5 Q