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; //ancestor's public var echo $ancestor::$staticVar; //ancestor's static var echo $descendant->publicVar; // descendant's public var echo $descendant::$staticVar; // descendant's static var //echo Ancestor::$publicVar; // fatal error: Access to undeclared static property 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.0140.00716.88
8.3.50.0100.01020.93
8.3.40.0100.00318.82
8.3.30.0060.00918.75
8.3.20.0070.00020.11
8.3.10.0040.00423.42
8.3.00.0080.00019.66
8.2.180.0150.00016.75
8.2.170.0090.00622.96
8.2.160.0070.00719.46
8.2.150.0040.00424.18
8.2.140.0110.00724.66
8.2.130.0040.00426.16
8.2.120.0060.00317.63
8.2.110.0100.00022.13
8.2.100.0040.00817.88
8.2.90.0040.00419.05
8.2.80.0040.00417.97
8.2.70.0030.00917.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0000.00719.25
8.2.30.0040.00419.85
8.2.20.0000.00917.63
8.2.10.0040.00417.88
8.2.00.0050.00218.00
8.1.280.0170.00325.92
8.1.270.0100.00720.38
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00622.61
8.1.230.0060.00617.42
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0080.00417.23
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0040.00418.58
8.1.160.0030.00521.96
8.1.150.0000.00718.83
8.1.140.0040.00417.27
8.1.130.0000.00817.64
8.1.120.0050.00317.41
8.1.110.0040.00417.43
8.1.100.0000.00717.43
8.1.90.0040.00417.40
8.1.80.0050.00317.22
8.1.70.0000.00717.41
8.1.60.0000.00817.41
8.1.50.0040.00417.54
8.1.40.0060.00317.42
8.1.30.0030.00617.66
8.1.20.0070.00017.63
8.1.10.0000.00817.59
8.1.00.0000.00717.52
8.0.300.0080.00318.77
8.0.290.0030.00616.88
8.0.280.0000.00818.36
8.0.270.0000.00717.39
8.0.260.0030.00317.14
8.0.250.0050.00317.04
8.0.240.0050.00317.04
8.0.230.0000.00716.98
8.0.220.0030.00316.78
8.0.210.0000.00716.80
8.0.200.0000.00716.95
8.0.190.0040.00416.96
8.0.180.0040.00416.82
8.0.170.0070.00016.88
8.0.160.0030.00516.81
8.0.150.0000.00716.86
8.0.140.0030.00516.76
8.0.130.0060.00013.36
8.0.120.0040.00416.89
8.0.110.0050.00316.95
8.0.100.0000.00716.67
8.0.90.0070.00016.77
8.0.80.0070.01016.89
8.0.70.0000.00816.68
8.0.60.0000.00716.93
8.0.50.0000.00816.87
8.0.30.0140.00616.92
8.0.20.0080.01017.40
8.0.10.0020.00517.04
8.0.00.0090.00916.73
7.4.330.0050.00015.08
7.4.320.0030.00316.45
7.4.300.0000.00616.48
7.4.290.0000.00816.61
7.4.280.0030.00516.51
7.4.270.0000.00616.43
7.4.260.0030.00316.61
7.4.250.0000.00816.36
7.4.240.0060.00116.52
7.4.230.0070.00016.41
7.4.220.0130.01016.45
7.4.210.0090.01016.71
7.4.200.0040.00416.50
7.4.160.0140.01016.52
7.4.150.0120.00617.40
7.4.140.0110.01117.86
7.4.130.0070.01116.52
7.4.120.0080.00816.37
7.4.110.0120.00616.65
7.4.100.0060.01616.71
7.4.90.0030.01316.58
7.4.80.0030.01419.39
7.4.70.0030.01416.35
7.4.60.0100.00616.49
7.4.50.0030.00616.61
7.4.40.0090.01216.32
7.4.30.0120.01216.67
7.4.00.0070.01114.96
7.3.330.0050.00013.36
7.3.320.0000.00513.36
7.3.310.0030.00316.18
7.3.300.0000.00716.30
7.3.290.0110.00416.31
7.3.280.0120.00616.37
7.3.270.0120.00617.40
7.3.260.0160.00716.43
7.3.250.0130.00616.49
7.3.240.0030.01716.30
7.3.230.0170.00016.40
7.3.210.0070.01016.36
7.3.200.0060.01016.59
7.3.190.0100.01016.45
7.3.180.0110.00416.41
7.3.170.0070.01516.52
7.3.160.0140.00416.65
7.3.120.0030.01314.96
7.3.110.0110.00714.88
7.3.100.0030.00614.71
7.3.90.0120.00314.94
7.3.80.0060.01014.71
7.3.70.0040.01114.78
7.3.60.0090.00614.91
7.3.50.0070.00714.74
7.3.40.0000.01014.72
7.3.30.0090.00614.88
7.3.20.0070.00716.38
7.3.10.0100.00316.65
7.3.00.0150.00016.59
7.2.330.0120.01216.80
7.2.320.0170.00016.71
7.2.310.0120.00616.45
7.2.300.0060.00916.68
7.2.290.0120.00916.68
7.2.250.0100.01015.38
7.2.240.0000.01815.02
7.2.230.0070.01015.33
7.2.220.0100.00315.04
7.2.210.0070.00714.65
7.2.200.0040.01115.22
7.2.190.0000.01214.95
7.2.180.0030.01215.14
7.2.170.0140.00015.02
7.2.160.0080.00615.05
7.2.150.0030.00716.89
7.2.140.0070.00716.77
7.2.130.0040.01417.00
7.2.120.0030.00816.79
7.2.110.0030.01416.87
7.2.100.0060.00916.91
7.2.90.0070.01016.71
7.2.80.0060.00916.88
7.2.70.0090.00317.07
7.2.60.0100.00716.83
7.2.50.0060.00916.80
7.2.40.0000.01216.62
7.2.30.0150.00017.03
7.2.20.0090.00316.91
7.2.10.0030.00916.79
7.2.00.0070.00818.24
7.1.330.0060.01215.67
7.1.320.0040.00415.40
7.1.310.0040.01115.66
7.1.300.0090.00615.71
7.1.290.0040.00715.48
7.1.280.0000.01115.62
7.1.270.0150.00015.78
7.1.260.0040.00815.71
7.1.250.0060.00615.67
7.1.240.0030.00715.84
7.1.230.0030.00815.46
7.1.220.0090.00615.82
7.1.210.0060.00615.86
7.1.200.0030.01015.81
7.1.190.0000.01815.49
7.1.180.0090.00615.67
7.1.170.0090.00615.56
7.1.160.0030.00915.70
7.1.150.0000.01315.81
7.1.140.0030.00915.73
7.1.130.0080.00615.69
7.1.120.0100.00715.53
7.1.110.0090.00915.87
7.1.100.0040.00716.73
7.1.90.0040.00715.95
7.1.80.0070.00715.73
7.1.70.0000.00916.29
7.1.60.0050.01117.78
7.1.50.0080.00915.96
7.1.40.0050.00815.88
7.1.30.0070.00315.49
7.1.20.0030.01015.86
7.1.10.0110.00015.57
7.1.00.0070.04019.00
7.0.330.0070.01015.43
7.0.320.0050.01215.45
7.0.310.0030.01015.47
7.0.300.0000.01115.45
7.0.290.0000.01415.43
7.0.280.0030.00915.60
7.0.270.0040.00715.45
7.0.260.0060.00315.34
7.0.250.0070.01115.63
7.0.240.0080.00315.55
7.0.230.0040.00715.58
7.0.220.0100.00615.49
7.0.210.0130.00015.59
7.0.200.0020.00716.06
7.0.190.0030.01015.37
7.0.180.0000.01015.61
7.0.170.0110.00415.57
7.0.160.0000.01215.14
7.0.150.0060.00315.50
7.0.140.0070.00315.55
7.0.130.0000.01215.57
7.0.120.0080.00815.48
7.0.110.0130.00015.53
7.0.100.0030.00915.36
7.0.90.0090.00315.18
7.0.80.0090.00915.41
7.0.70.0070.00415.42
7.0.60.0150.03717.75
7.0.50.0080.04316.67
7.0.40.0070.03216.68
7.0.30.0170.03516.81
7.0.20.0210.04016.90
7.0.10.0060.04316.87
7.0.00.0050.04616.91
5.6.400.0030.00914.49
5.6.390.0040.00714.23
5.6.380.0000.01414.03
5.6.370.0040.00714.15
5.6.360.0040.00414.57
5.6.350.0080.00814.40
5.6.340.0060.00614.56
5.6.330.0070.00414.14
5.6.320.0000.01714.62
5.6.310.0070.01014.03
5.6.300.0060.00614.15
5.6.290.0060.00914.62
5.6.280.0050.02617.72
5.6.270.0090.00014.41
5.6.260.0040.00814.43
5.6.250.0070.00314.12
5.6.240.0060.01014.46
5.6.230.0000.01314.34
5.6.220.0040.00414.11
5.6.210.0080.04417.41
5.6.200.0080.04616.36
5.6.190.0080.04317.37
5.6.180.0200.02417.30
5.6.170.0130.04717.47
5.6.160.0020.02417.37
5.6.150.0020.04716.29
5.6.140.0100.04016.17
5.6.130.0000.03816.31
5.6.120.0030.04317.56
5.6.110.0050.04417.60
5.6.100.0020.05217.65
5.6.90.0050.03217.70
5.6.80.0070.04717.37
5.6.70.0060.00914.27
5.6.60.0040.01014.32
5.6.50.0030.01014.07
5.6.40.0000.01114.17
5.6.30.0040.00814.30
5.6.20.0000.01314.31
5.6.10.0140.00014.36
5.6.00.0060.00614.39
5.5.380.0000.01114.10
5.5.370.0100.00314.37
5.5.360.0060.00314.32
5.5.350.0030.04717.31
5.5.340.0030.03916.23
5.5.330.0050.04517.23
5.5.320.1070.02517.15
5.5.310.0160.03117.17
5.5.300.0070.03516.19
5.5.290.0020.02816.18
5.5.280.0060.02217.48
5.5.270.0080.04517.41
5.5.260.0080.03517.70
5.5.250.0100.04317.32
5.5.240.0050.04417.25
5.5.230.0030.01014.12
5.5.220.0040.00714.03
5.5.210.0040.01214.21
5.5.200.0030.00514.30
5.5.190.0040.01113.89
5.5.180.0150.00014.15
5.5.170.0000.00914.30
5.5.160.0040.00714.23
5.5.150.0090.00614.32
5.5.140.0060.00614.41
5.5.130.0030.01214.26
5.5.120.0070.00714.13
5.5.110.0040.01114.16
5.5.100.0040.00714.30
5.5.90.0050.00514.29
5.5.80.0000.01614.16
5.5.70.0040.01114.48
5.5.60.0030.00614.18
5.5.50.0030.00714.37
5.5.40.0030.00914.21
5.5.30.0080.00413.93
5.5.20.0070.00714.11
5.5.10.0080.00414.27
5.5.00.0070.01013.79
5.4.450.0230.03515.77
5.4.440.0260.02815.76
5.4.430.0280.03215.98
5.4.420.0260.03015.99
5.4.410.0200.03015.93
5.4.400.0260.02815.74
5.4.390.0110.03615.68
5.4.380.0160.03615.77
5.4.370.0150.02815.75
5.4.360.0120.03715.67
5.4.350.0100.03015.71
5.4.340.0100.03115.72
5.4.330.0000.00612.37
5.4.320.0150.02715.76
5.4.310.0120.02715.75
5.4.300.0150.03015.87
5.4.290.0140.02915.71
5.4.280.0100.03215.76
5.4.270.0160.02215.62
5.4.260.0120.03015.81
5.4.250.0100.02915.81
5.4.240.0150.04215.67
5.4.230.0170.03515.82
5.4.220.0110.03315.79
5.4.210.0120.03515.67
5.4.200.0130.02815.83
5.4.190.0100.03215.60
5.4.180.0100.03315.80
5.4.170.0140.03015.61
5.4.160.0190.03515.80
5.4.150.0140.03415.70
5.4.140.0130.04014.49
5.4.130.0170.03214.48
5.4.120.0150.03614.48
5.4.110.0170.03014.42
5.4.100.0070.03814.47
5.4.90.0150.02414.53
5.4.80.0100.02514.41
5.4.70.0170.03414.46
5.4.60.0120.03514.36
5.4.50.0070.03814.40
5.4.40.0130.03314.31
5.4.30.0020.04114.29
5.4.20.0170.01914.35
5.4.10.0200.03014.44
5.4.00.0040.00812.37

preferences:
45.86 ms | 401 KiB | 5 Q