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 "ancestor's publicMethod "; // is $this is set up if(isset($this)){ echo "is in object context\n"; }else{ echo "is in static context\n"; } } static function staticMethod(){ echo "ancestor's staticMethod "; // is $this is set up if(isset($this)){ echo "in object context\n"; }else{ echo "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 "descendant's publicMethod "; // is $this is set up if(isset($this)){ echo "in object context\n"; }else{ echo "in static context\n"; } } static function staticMethod(){ echo "descendant's staticMethod "; // is $this is set up if(isset($this)){ echo "in object context\n"; }else{ echo "in static context\n"; } } } $ancestor = new Ancestor(); $descendant = new Descendant(); // From Outside Of An Instance/Class: // access to properties echo $descendant->publicVar; // descendant's public var //echo $descendant->staticVar; // "" + notice: Undefined property: Descendant::$staticVar echo $descendant::$staticVar; // descendant's static var //echo $descendant::$publicVar; // fatal error: Access to undeclared static property: Descendant::$publicVar //echo Descendant::$publicVar; // fatal error: Access to undeclared static property echo Descendant::$staticVar; // descendant's static var // access to methods $descendant->publicMethod(); // descendant's publicMethod in object context $descendant->staticMethod(); // descendant's staticMethod in static context $descendant::staticMethod(); // descendant's staticMethod in static context $descendant::publicMethod(); // descendant's publicMethod in static context Descendant::publicMethod(); // Descendant::staticMethod(); // //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.0150.00316.63
8.3.50.0120.00821.09
8.3.40.0170.00318.71
8.3.30.0000.01418.67
8.3.20.0000.00720.20
8.3.10.0040.00423.71
8.3.00.0090.00019.66
8.2.180.0090.00618.54
8.2.170.0110.00422.96
8.2.160.0070.01020.32
8.2.150.0080.00024.18
8.2.140.0070.00324.66
8.2.130.0000.00826.16
8.2.120.0060.00317.63
8.2.110.0090.00022.29
8.2.100.0080.00417.63
8.2.90.0000.00818.96
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0040.00418.04
8.2.50.0000.00818.07
8.2.40.0050.00319.34
8.2.30.0000.00818.13
8.2.20.0050.00317.75
8.2.10.0000.00717.94
8.2.00.0040.00418.06
8.1.280.0120.00325.92
8.1.270.0150.00020.26
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0100.00020.65
8.1.230.0110.00019.10
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0000.00817.25
8.1.180.0000.00818.10
8.1.170.0080.00018.52
8.1.160.0040.00421.96
8.1.150.0040.00418.76
8.1.140.0080.00017.44
8.1.130.0070.00017.55
8.1.120.0040.00417.38
8.1.110.0040.00417.32
8.1.100.0000.00717.42
8.1.90.0040.00417.32
8.1.80.0000.00817.33
8.1.70.0030.00317.43
8.1.60.0080.00017.58
8.1.50.0030.00517.57
8.1.40.0040.00717.39
8.1.30.0030.00517.61
8.1.20.0040.00417.55
8.1.10.0000.00817.63
8.1.00.0000.00817.40
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0050.00218.48
8.0.270.0030.00317.27
8.0.260.0030.00317.14
8.0.250.0000.00717.09
8.0.240.0080.00016.99
8.0.230.0030.00316.93
8.0.220.0000.00716.84
8.0.210.0050.00216.85
8.0.200.0040.00416.98
8.0.190.0040.00416.96
8.0.180.0040.00416.87
8.0.170.0040.00416.77
8.0.160.0000.00916.96
8.0.150.0040.00416.73
8.0.140.0040.00416.89
8.0.130.0070.00013.28
8.0.120.0000.00816.97
8.0.110.0050.00216.89
8.0.100.0040.00416.78
8.0.90.0040.00416.70
8.0.80.0080.00816.89
8.0.70.0070.00016.75
8.0.60.0070.00016.83
8.0.50.0030.00516.96
8.0.30.0080.01317.18
8.0.20.0110.01017.40
8.0.10.0040.00416.91
8.0.00.0100.00716.76
7.4.330.0000.00515.08
7.4.320.0030.00316.34
7.4.300.0030.00316.43
7.4.290.0000.00716.61
7.4.280.0040.00416.50
7.4.270.0070.00016.63
7.4.260.0080.00316.40
7.4.250.0040.00416.42
7.4.240.0030.00416.59
7.4.230.0030.00316.71
7.4.220.0130.00416.64
7.4.210.0090.00616.63
7.4.200.0050.00316.71
7.4.160.0110.00616.56
7.4.150.0180.00017.40
7.4.140.0100.01117.86
7.4.130.0110.01216.56
7.4.120.0110.00616.52
7.4.110.0070.01116.39
7.4.100.0060.01216.64
7.4.90.0120.00316.54
7.4.80.0100.01019.39
7.4.70.0100.01016.54
7.4.60.0070.01016.54
7.4.50.0040.00416.60
7.4.40.0030.01316.59
7.4.30.0150.00816.45
7.4.00.0050.01215.04
7.3.330.0000.00613.45
7.3.320.0030.00313.30
7.3.310.0000.00716.39
7.3.300.0000.00716.29
7.3.290.0070.01016.45
7.3.280.0110.00916.40
7.3.270.0110.00617.40
7.3.260.0030.01416.65
7.3.250.0150.00616.33
7.3.240.0070.01116.34
7.3.230.0090.00916.59
7.3.210.0060.01116.42
7.3.200.0170.00316.35
7.3.190.0090.00916.44
7.3.180.0090.00616.46
7.3.170.0110.00516.43
7.3.160.0120.00516.45
7.3.120.0040.01414.97
7.3.110.0070.01014.65
7.3.100.0110.00514.67
7.3.90.0030.00814.66
7.3.80.0050.00414.92
7.3.70.0060.00614.94
7.3.60.0060.00614.86
7.3.50.0000.01314.87
7.3.40.0080.01114.78
7.3.30.0000.01314.67
7.3.20.0070.00516.72
7.3.10.0060.01116.60
7.3.00.0040.01016.65
7.2.330.0090.00916.76
7.2.320.0030.01616.80
7.2.310.0040.01216.68
7.2.300.0090.00616.48
7.2.290.0090.01216.45
7.2.250.0050.01315.07
7.2.240.0100.01015.24
7.2.230.0020.01215.25
7.2.220.0040.00815.02
7.2.210.0080.00615.20
7.2.200.0030.00914.97
7.2.190.0050.00814.92
7.2.180.0030.01515.03
7.2.170.0070.00715.00
7.2.160.0030.01014.91
7.2.150.0030.01316.89
7.2.140.0040.01516.98
7.2.130.0100.00516.53
7.2.120.0080.00716.61
7.2.110.0070.00916.77
7.2.100.0080.00716.72
7.2.90.0070.00716.77
7.2.80.0070.01016.80
7.2.70.0110.00416.77
7.2.60.0070.00716.74
7.2.50.0030.01016.79
7.2.40.0060.00916.69
7.2.30.0090.00716.88
7.2.20.0060.00816.86
7.2.10.0070.00716.82
7.2.00.0040.01017.53
7.1.330.0040.01415.81
7.1.320.0020.01515.67
7.1.310.0090.00415.88
7.1.300.0100.00615.83
7.1.290.0050.01015.66
7.1.280.0030.01315.66
7.1.270.0050.00815.64
7.1.260.0030.01215.41
7.1.250.0110.00315.49
7.1.240.0060.00715.67
7.1.230.0080.00715.53
7.1.220.0100.00415.68
7.1.210.0070.00715.72
7.1.200.0060.00515.71
7.1.190.0080.00715.44
7.1.180.0070.00615.55
7.1.170.0090.00315.42
7.1.160.0110.00515.52
7.1.150.0080.00715.55
7.1.140.0070.00815.58
7.1.130.0060.00615.60
7.1.120.0070.00815.50
7.1.110.0070.00615.50
7.1.100.0050.00816.29
7.1.90.0080.00615.74
7.1.80.0050.00815.59
7.1.70.0060.00615.97
7.1.60.0070.01116.71
7.1.50.0050.00915.93
7.1.40.0050.00915.61
7.1.30.0040.00615.46
7.1.20.0040.00915.67
7.1.10.0080.00515.51
7.1.00.0070.02317.37
7.0.330.0080.00315.21
7.0.320.0060.00515.12
7.0.310.0070.00815.00
7.0.300.0060.00615.24
7.0.290.0080.00715.33
7.0.280.0060.00515.17
7.0.270.0070.00715.22
7.0.260.0070.00415.18
7.0.250.0040.00815.38
7.0.240.0080.00615.45
7.0.230.0050.00815.25
7.0.220.0060.00715.42
7.0.210.0070.00515.39
7.0.200.0050.00715.77
7.0.190.0060.00615.32
7.0.180.0060.00515.31
7.0.170.0070.00415.39
7.0.160.0070.00615.33
7.0.150.0080.00515.36
7.0.140.0070.00915.42
7.0.130.0070.00515.31
7.0.120.0060.00815.48
7.0.110.0040.01015.33
7.0.100.0040.01015.22
7.0.90.0050.00715.39
7.0.80.0060.00615.35
7.0.70.0020.00915.25
7.0.60.0050.01716.42
7.0.50.0060.02015.90
7.0.40.0060.02515.06
7.0.30.0110.02614.94
7.0.20.0130.01914.87
7.0.10.0020.02515.09
7.0.00.0030.02914.93
5.6.400.0070.01114.32
5.6.390.0110.00414.26
5.6.380.0020.01014.00
5.6.370.0030.00714.13
5.6.360.0060.00714.11
5.6.350.0090.00614.01
5.6.340.0060.00714.18
5.6.330.0080.00414.33
5.6.320.0020.00914.07
5.6.310.0070.00514.29
5.6.300.0050.00914.31
5.6.290.0050.00714.18
5.6.280.0060.02315.89
5.6.270.0020.01114.25
5.6.260.0050.00614.17
5.6.250.0020.00714.24
5.6.240.0060.00614.06
5.6.230.0050.00614.21
5.6.220.0060.00914.32
5.6.210.0080.02415.92
5.6.200.0040.02015.27
5.6.190.0080.02615.74
5.6.180.0110.01815.76
5.6.170.0100.02615.66
5.6.160.0060.01515.78
5.6.150.0050.02415.16
5.6.140.0050.01615.20
5.6.130.0120.02115.38
5.6.120.0040.02015.97
5.6.110.0070.01915.99
5.6.100.0060.02415.86
5.6.90.0030.02215.83
5.6.80.0060.01215.68
5.6.70.0040.00714.08
5.6.60.0040.01014.02
5.6.50.0080.00614.12
5.6.40.0040.01014.08
5.6.30.0080.00614.04
5.6.20.0100.00413.93
5.6.10.0040.00914.15
5.6.00.0030.00714.14
5.5.380.0040.00612.14
5.5.370.0020.00912.19
5.5.360.0040.00512.43
5.5.350.0050.01414.32
5.5.340.0030.02313.73
5.5.330.0050.02214.27
5.5.320.0410.02114.33
5.5.310.0090.01614.28
5.5.300.0050.01613.63
5.5.290.0040.02013.62
5.5.280.0060.01614.42
5.5.270.0050.01514.29
5.5.260.0080.01914.31
5.5.250.0060.02714.45
5.5.240.0060.02414.28
5.5.230.0020.00812.25
5.5.220.0050.00612.22
5.5.210.0090.00312.15
5.5.200.0060.00312.28
5.5.190.0060.00712.23
5.5.180.0030.00812.11
5.5.170.0040.00512.30
5.5.160.0070.00712.33
5.5.150.0040.00712.38
5.5.140.0040.00612.29
5.5.130.0030.00812.43
5.5.120.0020.00812.23
5.5.110.0040.00712.26
5.5.100.0020.00912.16
5.5.90.0030.00712.20
5.5.80.0040.00612.35
5.5.70.0050.00612.18
5.5.60.0040.00612.21
5.5.50.0010.00712.29
5.5.40.0030.00712.27
5.5.30.0060.00612.19
5.5.20.0050.00512.28
5.5.10.0040.00512.17
5.5.00.0060.00612.26
5.4.450.0140.01713.24
5.4.440.0130.01813.32
5.4.430.0150.02013.25
5.4.420.0110.02113.32
5.4.410.0140.01813.18
5.4.400.0150.01813.19
5.4.390.0100.01913.25
5.4.380.0070.02013.12
5.4.370.0130.01713.21
5.4.360.0160.01513.17
5.4.350.0130.01713.20
5.4.340.0180.01313.13
5.4.330.0050.00511.21
5.4.320.0140.01813.14
5.4.310.0110.01913.17
5.4.300.0150.01613.23
5.4.290.0160.01513.19
5.4.280.0140.01613.21
5.4.270.0150.01913.09
5.4.260.0140.01813.21
5.4.250.0140.01613.21
5.4.240.0130.01713.13
5.4.230.0140.01813.14
5.4.220.0160.01613.21
5.4.210.0170.01513.12
5.4.200.0160.01513.26
5.4.190.0130.01713.04
5.4.180.0150.02013.01
5.4.170.0190.01213.13
5.4.160.0040.01713.22
5.4.150.0050.01813.14
5.4.140.0040.01812.50
5.4.130.0110.01412.52
5.4.120.0070.01712.50
5.4.110.0080.01612.56
5.4.100.0060.01712.50
5.4.90.0040.01612.50
5.4.80.0100.01412.52
5.4.70.0080.01712.51
5.4.60.0080.02212.41
5.4.50.0030.02212.47
5.4.40.0080.02112.52
5.4.30.0040.01512.50
5.4.20.0080.02212.52
5.4.10.0100.01512.49
5.4.00.0040.00611.24

preferences:
53.32 ms | 401 KiB | 5 Q