3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Ancestor { public $publicVar = "ancestor's public var\n"; static $staticVar = "ancestor's static var\n"; function publicMethod(){ echo "this is ancestor's public method\n"; // is $this is set up if(isset($this)){ echo "publicMethod is in object context\n"; }else{ echo "publicMethod is in static context\n"; } } static function staticMethod(){ echo "this is ancestor's static method\n"; // is $this is set up if(isset($this)){ echo "staticMethod is in object context\n"; }else{ echo "staticMethod is in static context\n"; } } } class Descendant extends Ancestor { public $publicVar = "descendant's public var\n"; static $staticVar = "descendant's static var\n"; function publicMethod(){ echo "this is descendant's public method\n"; // is $this is set up if(isset($this)){ echo "publicMethod is in object context\n"; }else{ echo "publicMethod is in static context\n"; } } static function staticMethod(){ echo "this is descendant's static method\n"; // is $this is set up if(isset($this)){ echo "staticMethod is in object context\n"; }else{ echo "staticMethod is in static context\n"; } } } $ancestor = new Ancestor(); $descendant = new Descendant(); // From Outside Of An Instance/Class: echo $ancestor->publicVar; echo $ancestor::$staticVar; echo $descendant->publicVar; echo $descendant::$staticVar; echo Ancestor::$publicVar; echo Ancestor::$staticVar; echo Descendant::$publicVar; echo Descendant::$staticVar; //Ancestor::publicMethod();

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.0070.01116.63
8.3.50.0070.01016.34
8.3.40.0080.00818.97
8.3.30.0070.01118.89
8.3.20.0070.00020.33
8.3.10.0080.00023.71
8.3.00.0030.00519.56
8.2.180.0030.01016.60
8.2.170.0140.00722.96
8.2.160.0110.00320.49
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0060.00317.50
8.2.110.0070.00422.27
8.2.100.0060.00617.75
8.2.90.0080.00019.08
8.2.80.0090.00017.97
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0090.00018.07
8.2.40.0040.00419.05
8.2.30.0000.00819.77
8.2.20.0030.00517.73
8.2.10.0080.00017.98
8.2.00.0000.00718.04
8.1.280.0000.01425.92
8.1.270.0030.00620.38
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0030.00622.46
8.1.230.0080.00317.42
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0070.00417.35
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0080.00018.57
8.1.160.0000.00721.98
8.1.150.0070.00018.82
8.1.140.0040.00417.34
8.1.130.0000.00717.55
8.1.120.0040.00417.45
8.1.110.0040.00417.44
8.1.100.0070.00017.45
8.1.90.0040.00417.42
8.1.80.0000.00817.39
8.1.70.0000.00717.37
8.1.60.0060.00317.42
8.1.50.0090.00017.42
8.1.40.0080.00017.49
8.1.30.0040.00417.57
8.1.20.0000.00817.63
8.1.10.0050.00317.46
8.1.00.0030.00617.37
8.0.300.0070.00018.77
8.0.290.0000.00716.88
8.0.280.0000.00718.42
8.0.270.0070.00017.13
8.0.260.0030.00317.12
8.0.250.0040.00417.06
8.0.240.0050.00316.99
8.0.230.0000.00716.82
8.0.220.0030.00316.94
8.0.210.0030.00316.88
8.0.200.0000.00716.97
8.0.190.0000.00816.91
8.0.180.0040.00416.92
8.0.170.0030.00516.86
8.0.160.0040.00416.86
8.0.150.0000.00716.89
8.0.140.0000.00716.80
8.0.130.0000.00613.31
8.0.120.0080.00016.85
8.0.110.0040.00416.89
8.0.100.0070.00016.93
8.0.90.0000.00716.86
8.0.80.0120.00816.95
8.0.70.0070.00016.85
8.0.60.0040.00416.80
8.0.50.0040.00416.78
8.0.30.0110.00717.12
8.0.20.0080.01117.40
8.0.10.0000.00816.96
8.0.00.0110.00816.77
7.4.330.0000.00515.09
7.4.320.0060.00016.58
7.4.300.0000.00616.57
7.4.290.0030.00316.63
7.4.280.0040.00416.62
7.4.270.0030.00316.53
7.4.260.0030.00316.63
7.4.250.0040.00416.55
7.4.240.0040.00416.49
7.4.230.0070.00016.71
7.4.220.0090.01516.60
7.4.210.0100.01016.46
7.4.200.0000.00716.48
7.4.160.0120.00416.49
7.4.150.0090.00917.40
7.4.140.0140.01017.86
7.4.130.0100.01016.35
7.4.120.0060.01516.47
7.4.110.0100.00916.36
7.4.100.0100.01316.36
7.4.90.0140.00316.50
7.4.80.0090.00819.39
7.4.70.0080.00816.54
7.4.60.0030.01316.38
7.4.50.0000.00916.58
7.4.40.0090.00916.43
7.4.30.0060.01516.70
7.4.00.0070.00714.84
7.3.330.0050.00013.23
7.3.320.0050.00013.29
7.3.310.0000.00716.46
7.3.300.0060.00016.22
7.3.290.0100.00716.33
7.3.280.0060.01416.32
7.3.270.0090.00917.40
7.3.260.0100.01316.59
7.3.250.0110.00516.45
7.3.240.0040.01316.41
7.3.230.0090.00916.59
7.3.210.0080.00816.49
7.3.200.0070.01416.60
7.3.190.0070.01316.50
7.3.180.0120.00416.40
7.3.170.0100.00716.34
7.3.160.0030.01616.38
7.2.330.0120.00616.82
7.2.320.0160.00316.72
7.2.310.0110.00716.71
7.2.300.0000.01516.77
7.2.290.0140.00616.70
7.2.60.0000.01417.08
7.2.00.0030.01219.34
7.1.200.0000.00715.66
7.1.100.0000.01418.28
7.1.70.0000.00717.25
7.1.60.0100.00620.03
7.1.50.0090.01516.54
7.1.00.0030.07722.30
7.0.200.0100.00316.75
7.0.60.0100.04719.77
7.0.50.0070.08017.99
7.0.40.0170.07720.04
7.0.30.0400.05020.09
7.0.20.0300.08320.14
7.0.10.0070.08320.07
7.0.00.0170.08020.10
5.6.280.0030.03020.84
5.6.210.0070.06720.60
5.6.200.0100.07018.14
5.6.190.0030.09020.61
5.6.180.4000.04320.33
5.6.170.0330.07020.51
5.6.160.0070.04720.46
5.6.150.0030.08318.29
5.6.140.0030.07318.15
5.6.130.0030.08318.19
5.6.120.0070.04021.00
5.6.110.0100.06320.97
5.6.100.0100.05320.89
5.6.90.0130.06021.01
5.6.80.0000.05320.38
5.6.70.4300.03720.53
5.5.350.0270.08020.42
5.5.340.0130.07318.07
5.5.330.0030.05020.29
5.5.320.0270.05020.30
5.5.310.0130.07320.51
5.5.300.0130.07317.98
5.5.290.0030.05018.04
5.5.280.0130.07720.86
5.5.270.0130.07720.94
5.5.260.0070.08320.81
5.5.250.0170.07320.63
5.5.240.0230.05720.20
5.4.450.0300.05719.66
5.4.440.0130.06019.61
5.4.430.0230.05019.55
5.4.420.0100.06019.59
5.4.410.0200.05019.52
5.4.400.0230.06019.14
5.4.390.0370.05719.22
5.4.380.0270.06718.87
5.4.370.0330.05718.98
5.4.360.0270.06718.87
5.4.350.0230.05019.28
5.4.340.0130.05719.23
5.4.320.0100.05719.22
5.4.310.0070.05719.13
5.4.300.0100.05319.25
5.4.290.0170.05019.15
5.4.280.0100.06719.29
5.4.270.0070.06019.25
5.4.260.0200.04319.08
5.4.250.0070.06019.30
5.4.240.0130.05319.05
5.4.230.0130.05319.14
5.4.220.0170.05318.97
5.4.210.0330.03719.00
5.4.200.0130.05318.84
5.4.190.0130.05319.15
5.4.180.0230.04719.30
5.4.170.0270.04019.24
5.4.160.0100.05719.26
5.4.150.0200.05019.27
5.4.140.0130.05316.56
5.4.130.0230.04016.49
5.4.120.0300.05016.58
5.4.110.0200.05016.48
5.4.100.0130.06316.57
5.4.90.0230.04316.24
5.4.80.0070.05716.23
5.4.70.0300.07016.59
5.4.60.0300.05016.17
5.4.50.0030.07316.32
5.4.40.0100.06016.51
5.4.30.0070.07016.42
5.4.20.0200.04716.42

preferences:
48.52 ms | 400 KiB | 5 Q