3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myName{ private $prop; public function __construct($value){ $this->prop = $value; } public function returnPrivate(){ return $this->prop; } } $oldObject = new myName('The named way'); echo $oldObject->returnPrivate()."\n"; class myNameExt extends myName{ public function returnPrivate(){ return $this->prop.' from named extension'; } } $extObject = new myNameExt('The named extension'); echo $extObject->returnPrivate()."\n"; $newObj = new class('The anonymous way') extends myName{ public function returnPrivate(){ return $this->prop.' with override'; } }; echo $newObj->returnPrivate();

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.0180.00018.30
8.3.50.0110.00416.41
8.3.40.0110.00418.79
8.3.30.0110.00318.71
8.3.20.0040.00420.37
8.3.10.0000.00821.76
8.3.00.0080.00020.22
8.2.180.0060.01616.75
8.2.170.0110.00322.96
8.2.160.0120.00320.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00317.50
8.2.110.0060.00320.99
8.2.100.0110.00017.84
8.2.90.0030.00619.09
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0080.00017.93
8.2.50.0000.00818.10
8.2.40.0040.00419.51
8.2.30.0000.00720.73
8.2.20.0000.00717.50
8.2.10.0000.00718.06
8.2.00.0000.00817.99
8.1.270.0070.01123.89
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0030.00622.81
8.1.230.0070.00417.83
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0040.00717.35
8.1.190.0060.00317.36
8.1.180.0080.00018.10
8.1.170.0080.00018.71
8.1.160.0000.00822.01
8.1.150.0040.00418.80
8.1.140.0030.00617.57
8.1.130.0040.00417.61
8.1.120.0040.00417.42
8.1.110.0000.00717.37
8.1.100.0000.00717.36
8.1.90.0070.00017.43
8.1.80.0040.00417.49
8.1.70.0020.00517.45
8.1.60.0000.00717.59
8.1.50.0080.00017.60
8.1.40.0040.00417.55
8.1.30.0030.00617.63
8.1.20.0000.00817.68
8.1.10.0000.00817.63
8.1.00.0040.00417.40
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0070.00018.45
8.0.270.0000.00917.25
8.0.260.0000.00617.16
8.0.250.0000.00717.00
8.0.240.0060.00016.89
8.0.230.0000.00717.03
8.0.220.0030.00316.93
8.0.210.0030.00516.98
8.0.200.0000.00716.99
8.0.190.0040.00416.98
8.0.180.0040.00417.00
8.0.170.0000.00816.95
8.0.160.0070.00016.99
8.0.150.0040.00416.92
8.0.140.0000.00716.93
8.0.130.0030.00313.37
8.0.120.0030.00616.78
8.0.110.0000.00816.96
8.0.100.0000.00816.91
8.0.90.0040.00416.91
8.0.80.0090.00617.01
8.0.70.0030.00516.86
8.0.60.0060.00317.00
8.0.50.0000.00816.86
8.0.30.0080.00917.18
8.0.20.0110.01117.40
8.0.10.0080.00016.89
8.0.00.0090.01116.83
7.4.330.0050.00015.08
7.4.320.0000.00616.43
7.4.300.0030.00316.51
7.4.290.0070.00016.59
7.4.280.0070.00016.58
7.4.270.0000.00716.48
7.4.260.0000.00816.56
7.4.250.0040.00416.37
7.4.240.0050.00216.64
7.4.230.0030.00316.48
7.4.220.0120.00616.67
7.4.210.0140.00616.60
7.4.200.0030.00316.44
7.4.160.0060.00916.57
7.4.150.0070.01017.40
7.4.140.0160.00617.86
7.4.130.0080.01116.48
7.4.120.0110.00816.60
7.4.110.0030.01416.53
7.4.100.0070.01016.64
7.4.90.0150.00316.54
7.4.80.0090.00919.39
7.4.70.0090.00816.45
7.4.60.0090.00616.65
7.4.50.0000.00516.39
7.4.40.0100.01316.70
7.4.30.0150.00916.43
7.4.00.0110.00715.21
7.3.330.0000.00513.38
7.3.320.0050.00013.35
7.3.310.0080.00016.31
7.3.300.0030.00316.35
7.3.290.0080.00516.34
7.3.280.0090.01016.35
7.3.270.0090.00917.40
7.3.260.0150.00916.31
7.3.250.0090.00916.39
7.3.240.0130.00616.22
7.3.230.0070.01016.39
7.3.210.0130.00316.55
7.3.200.0070.01016.27
7.3.190.0030.01316.52
7.3.180.0030.01316.41
7.3.170.0140.00316.59
7.3.160.0110.00616.38
7.3.120.0050.01314.69
7.3.110.0080.00814.95
7.3.100.0030.01114.82
7.3.90.0040.00814.77
7.3.80.0090.00514.76
7.3.70.0090.00514.78
7.3.60.0070.00714.55
7.3.50.0050.00714.72
7.3.40.0040.00914.54
7.3.30.0060.00214.67
7.3.20.0060.00716.45
7.3.10.0060.01016.58
7.3.00.0050.00716.58
7.2.330.0110.00816.67
7.2.320.0100.01316.82
7.2.310.0070.01416.50
7.2.300.0000.01616.52
7.2.290.0120.00916.44
7.2.240.0070.00915.15
7.2.230.0080.00715.19
7.2.220.0070.00914.98
7.2.210.0050.00914.99
7.2.200.0080.00415.02
7.2.190.0030.00915.10
7.2.180.0110.00514.96
7.2.170.0070.00914.99
7.2.160.0070.00514.95
7.2.150.0070.01117.01
7.2.140.0050.00916.89
7.2.130.0050.01017.07
7.2.120.0080.00516.96
7.2.110.0040.00916.78
7.2.100.0080.00616.84
7.2.90.0070.00916.91
7.2.80.0100.00616.69
7.2.70.0070.00916.92
7.2.60.0150.00716.83
7.2.50.0050.00916.98
7.2.40.0050.01116.72
7.2.30.0060.00817.00
7.2.20.0080.00616.98
7.2.10.0080.00616.86
7.2.00.0030.01017.31
7.1.330.0070.00615.88
7.1.320.0100.00715.70
7.1.310.0050.00915.68
7.1.300.0070.00315.83
7.1.290.0060.00915.75
7.1.280.0020.00815.72
7.1.270.0070.00515.64
7.1.260.0060.00715.60
7.1.250.0060.00615.82
7.1.200.0040.00415.61
7.1.100.0000.01418.18
7.1.70.0000.01016.76
7.1.60.0070.01819.11
7.1.50.0100.01416.64
7.1.00.0100.06722.37
7.0.200.0000.00816.72
7.0.60.0070.08020.09
7.0.50.0170.06717.73
7.0.40.0000.08720.30
7.0.30.0200.04720.34
7.0.20.0370.04320.30
7.0.10.0030.04320.16
7.0.00.0030.05720.22
5.6.280.0130.03021.07
5.6.210.0200.05320.63
5.6.200.0100.07718.14
5.6.190.0030.04320.68
5.6.180.0270.05720.52
5.6.170.0200.04320.71
5.6.160.0070.05020.57
5.6.150.0070.03718.14
5.6.140.0030.04018.24
5.6.130.0070.08018.18
5.6.120.0100.06721.13
5.6.110.0100.08321.14
5.6.100.0070.04020.96
5.6.90.0200.03021.11
5.6.80.0070.07020.51
5.5.350.0230.04320.44
5.5.340.0130.07318.11
5.5.330.0000.09020.35
5.5.320.0100.08020.25
5.5.310.0330.07720.30
5.5.300.0000.06018.01
5.5.290.0130.08018.07
5.5.280.0030.06720.97
5.5.270.0030.04720.88
5.5.260.0100.08020.85
5.5.250.0070.03720.55
5.5.240.0000.08020.27
5.4.450.0870.07019.59
5.4.440.1000.05719.63
5.4.430.0870.05019.58
5.4.420.0730.06019.62
5.4.410.0800.05319.45
5.4.400.0870.04719.23
5.4.390.0870.05019.08
5.4.380.0800.05318.91
5.4.370.0900.04318.84
5.4.360.0830.05718.84
5.4.350.1000.05718.84
5.4.340.0900.05019.23
5.4.320.0670.05718.93
5.4.310.0730.04719.20
5.4.300.0700.04719.21
5.4.290.0670.05018.82
5.4.280.0670.05719.30
5.4.270.0870.05318.90
5.4.260.0630.04318.83
5.4.250.0670.05019.07
5.4.240.0670.04719.18
5.4.230.0700.05019.24
5.4.220.0630.05319.25
5.4.210.0630.05019.23
5.4.200.0600.05319.02
5.4.190.0600.05318.83
5.4.180.0770.04319.07
5.4.170.0870.05018.82
5.4.160.0670.05018.82
5.4.150.0630.05318.83
5.4.140.0570.06016.36
5.4.130.0700.04016.36
5.4.120.0670.04716.49
5.4.110.0600.05316.63
5.4.100.0770.04016.33
5.4.90.0530.06016.46
5.4.80.0700.04716.51
5.4.70.0170.05316.44
5.4.60.0200.03316.17
5.4.50.0230.05016.44
5.4.40.0270.06716.51
5.4.30.0200.07316.49
5.4.20.0270.06316.16
5.4.10.0370.06316.48

preferences:
64.14 ms | 400 KiB | 5 Q