3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 费了我好大功夫, 把这些都总结到一个例子里面了 // PHP5.0 - PHP5.5 测试通过 class A { //类常量 const constValue = "constValue\n"; //类属性 public $property = "properties\n"; //静态属性 static public $staticProperty = "staticProperty\n"; //普通函数 public function func() { } //静态函数 static public function staticFunc() { } } $xxoo = new A; //访问实例的属性 print $xxoo->property; //访问实例的函数 print $xxoo->func(); //也可以借助实例来访问静态成员 print $xxoo->staticFunc(); print $xxoo::$staticProperty; //如果不借助实例,那就直接用类名加双冒号 print A::staticFunc(); print A::constValue; //静态属性要加美元符号 print A::$staticProperty; //继承类A class B extends A { //覆盖父类的属性 public $property = "covered-properties\n"; //覆盖父类的静态属性 static public $staitcProperty = "covered-staitcProperties\n"; //覆盖父类的函数 public function func() { //访问自己的属性 print $this->property; //访问从父类继承来的静态属性 print self::$staticProperty; //强制指定访问父类(而不是自己)的属性 print parent::$property; //强制指定访问父类(而不是自己)的函数 print parent::func(); } //覆盖父类的静态函数 static public function staticFunc() { //因为没有$this, 所以用self访问自己的静态属性 print self::$staitcProperty; //强制访问父类的静态属性 print parent::$staitcProperty; } } //运行一下上面的例子 $xxoo = new B; $xxoo->func(); B::staticFunc();

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.00718.56
8.3.50.0110.00522.07
8.3.40.0000.01518.79
8.3.30.0070.00718.91
8.3.20.0040.00420.34
8.3.10.0050.00322.05
8.3.00.0080.00022.24
8.2.180.0120.00316.73
8.2.170.0130.00722.96
8.2.160.0090.00618.92
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0100.00326.16
8.2.120.0050.00319.36
8.2.110.0000.00922.13
8.2.100.0110.00017.78
8.2.90.0000.00818.79
8.2.80.0050.00317.97
8.2.70.0030.00617.59
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0000.00818.16
8.2.30.0000.00817.99
8.2.20.0050.00217.73
8.2.10.0050.00319.36
8.2.00.0000.00717.61
8.1.280.0110.00425.92
8.1.270.0030.00523.91
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00023.98
8.1.230.0090.00319.10
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00917.25
8.1.190.0040.00417.55
8.1.180.0030.00518.10
8.1.170.0000.00918.62
8.1.160.0040.00421.94
8.1.150.0000.00718.49
8.1.140.0000.00717.30
8.1.130.0000.00717.77
8.1.120.0040.00417.40
8.1.110.0070.00017.41
8.1.100.0040.00417.42
8.1.90.0030.00417.43
8.1.80.0030.00417.39
8.1.70.0030.00317.42
8.1.60.0040.00417.63
8.1.50.0050.00217.55
8.1.40.0070.00017.55
8.1.30.0040.00417.55
8.1.20.0000.00817.57
8.1.10.0000.00717.41
8.1.00.0040.00417.49
8.0.300.0040.00418.77
8.0.290.0050.00317.18
8.0.280.0000.00818.50
8.0.270.0000.00717.21
8.0.260.0000.00618.36
8.0.250.0070.00017.01
8.0.240.0000.00717.04
8.0.230.0040.00416.99
8.0.220.0070.00016.79
8.0.210.0060.00016.91
8.0.200.0030.00316.95
8.0.190.0000.00716.91
8.0.180.0030.00516.96
8.0.170.0060.00317.02
8.0.160.0000.01016.92
8.0.150.0000.00816.89
8.0.140.0080.00016.95
8.0.130.0070.00013.36
8.0.120.0040.00416.90
8.0.110.0020.00516.86
8.0.100.0000.00817.02
8.0.90.0000.00816.80
8.0.80.0030.01316.86
8.0.70.0020.00516.93
8.0.60.0000.00716.79
8.0.50.0000.00816.71
8.0.30.0070.01517.06
8.0.20.0170.01017.41
8.0.10.0040.00416.95
8.0.00.0090.00916.76
7.4.330.0030.00315.00
7.4.320.0000.00616.59
7.4.300.0070.00016.41
7.4.290.0040.00416.56
7.4.280.0070.00016.43
7.4.270.0040.00716.61
7.4.260.0000.00816.61
7.4.250.0060.00316.58
7.4.240.0020.00516.57
7.4.230.0000.00716.46
7.4.220.0150.00616.65
7.4.210.0070.00916.58
7.4.200.0030.00316.61
7.4.190.0000.00716.41
7.4.160.0130.00316.58
7.4.150.0100.00717.40
7.4.140.0150.00617.86
7.4.130.0070.01016.62
7.4.120.0070.01016.54
7.4.110.0150.00616.40
7.4.100.0100.01016.51
7.4.90.0090.01216.52
7.4.80.0120.00919.39
7.4.70.0090.01016.54
7.4.60.0100.00616.57
7.4.50.0020.00216.40
7.4.40.0060.00922.77
7.4.30.0120.00916.57
7.4.00.0040.01414.92
7.3.330.0000.00513.41
7.3.320.0000.00513.30
7.3.310.0060.00016.49
7.3.300.0000.00716.45
7.3.290.0140.00816.41
7.3.280.0040.01316.42
7.3.270.0090.00917.40
7.3.260.0070.01716.59
7.3.250.0100.01016.49
7.3.240.0120.00616.42
7.3.230.0070.01416.70
7.3.210.0110.00616.65
7.3.200.0110.01219.39
7.3.190.0100.00616.52
7.3.180.0120.00916.68
7.3.170.0070.01016.50
7.3.160.0070.01016.57
7.3.120.0030.01014.80
7.3.110.0030.01414.77
7.3.100.0060.00815.10
7.3.90.0020.01214.90
7.3.80.0050.01114.91
7.3.70.0100.00714.76
7.3.60.0070.00314.80
7.3.50.0040.01114.58
7.3.40.0090.00414.84
7.3.30.0090.00614.91
7.3.20.0050.01016.84
7.3.10.0060.00516.68
7.3.00.0030.00916.55
7.2.330.0030.01316.64
7.2.320.0100.00716.88
7.2.310.0080.01116.47
7.2.300.0060.01116.77
7.2.290.0100.01016.82
7.2.250.0030.01715.32
7.2.240.0090.00515.13
7.2.230.0080.00515.15
7.2.220.0100.00715.09
7.2.210.0040.01315.17
7.2.200.0050.00814.89
7.2.190.0050.00915.07
7.2.180.0080.00814.90
7.2.170.0030.01314.88
7.2.160.0040.00915.18
7.2.150.0040.01016.91
7.2.140.0090.00716.85
7.2.130.0090.00516.88
7.2.120.0060.00616.83
7.2.110.0060.00616.86
7.2.100.0100.00416.96
7.2.90.0060.00616.89
7.2.80.0070.00716.78
7.2.70.0040.00816.92
7.2.60.0070.00816.80
7.2.50.0070.00617.06
7.2.40.0060.00816.96
7.2.30.0060.00816.90
7.2.20.0060.00816.83
7.2.10.0070.00616.82
7.2.00.0080.00617.48
7.1.330.0060.01215.76
7.1.320.0090.00615.48
7.1.310.0050.00915.65
7.1.300.0050.00815.62
7.1.290.0060.00815.76
7.1.280.0070.00615.73
7.1.270.0060.00715.91
7.1.260.0050.00615.53
7.1.250.0070.00515.64
7.1.240.0030.01115.64
7.1.230.0040.00915.76
7.1.220.0100.00315.61
7.1.210.0060.00815.63
7.1.200.0030.00715.58
7.1.190.0040.00515.55
7.1.180.0060.00615.68
7.1.170.0060.00815.46
7.1.160.0050.01015.72
7.1.150.0030.01015.72
7.1.140.0090.00615.95
7.1.130.0070.00515.66
7.1.120.0030.00815.62
7.1.110.0070.00515.71
7.1.100.0050.00816.38
7.1.90.0050.00415.68
7.1.80.0040.00815.63
7.1.70.0010.01116.06
7.1.60.0050.00717.16
7.1.50.0060.01016.04
7.1.40.0130.00315.93
7.1.30.0030.00715.71
7.1.20.0030.01015.69
7.1.10.0050.00615.78
7.1.00.0060.02917.68
7.0.330.0050.00515.46
7.0.320.0060.00715.31
7.0.310.0020.00915.15
7.0.300.0060.00615.33
7.0.290.0030.00815.21
7.0.280.0050.01115.42
7.0.270.0070.00815.26
7.0.260.0110.00315.41
7.0.250.0050.00815.48
7.0.240.0050.00715.12
7.0.230.0070.00515.54
7.0.220.0070.00815.53
7.0.210.0080.00315.41
7.0.200.0050.00415.78
7.0.190.0050.00815.30
7.0.180.0080.00515.36
7.0.170.0060.00515.34
7.0.160.0060.00715.34
7.0.150.0050.00615.30
7.0.140.0040.02917.57
7.0.130.0000.00915.24
7.0.120.0060.00615.29
7.0.110.0060.00415.27
7.0.100.0080.01716.82
7.0.90.0160.02916.78
7.0.80.0040.03216.96
7.0.70.0100.02816.78
7.0.60.0040.02716.87
7.0.50.0110.02217.10
7.0.40.0080.02015.71
7.0.30.0080.01815.72
7.0.20.0090.02715.73
7.0.10.0090.02615.59
7.0.00.0090.03015.63
5.6.400.0030.01414.45
5.6.390.0040.00814.11
5.6.380.0030.01114.40
5.6.370.0030.01014.41
5.6.360.0030.00814.29
5.6.350.0060.00414.39
5.6.340.0100.00514.38
5.6.330.0030.00914.17
5.6.320.0050.00314.31
5.6.310.0050.00714.28
5.6.300.0030.01014.31
5.6.290.0080.00414.61
5.6.280.0040.02816.57
5.6.270.0050.00914.16
5.6.260.0020.01114.25
5.6.250.0090.01916.46
5.6.240.0040.03716.39
5.6.230.0090.02816.38
5.6.220.0050.02716.36
5.6.210.0070.03216.22
5.6.200.0070.02116.46
5.6.190.0090.02316.38
5.6.180.0010.03716.43
5.6.170.0070.03016.53
5.6.160.0090.01716.46
5.6.150.0090.01516.50
5.6.140.0040.01916.59
5.6.130.0110.02616.56
5.6.120.0030.02116.38
5.6.110.0080.03016.55
5.6.100.0010.02316.51
5.6.90.0060.01716.40
5.6.80.0060.01916.20
5.6.70.0100.01416.21
5.6.60.0040.03216.11
5.6.50.0010.02216.08
5.6.40.0040.03016.37
5.6.30.0120.02616.25
5.6.20.0020.03316.15
5.6.10.0070.01816.16
5.6.00.0080.02716.19
5.5.380.0050.02915.15
5.5.370.0040.03015.25
5.5.360.0040.03115.34
5.5.350.0030.02815.19
5.5.340.0070.02515.31
5.5.330.0070.02915.37
5.5.320.0040.03615.43
5.5.310.0050.03215.43
5.5.300.0070.01515.48
5.5.290.0040.02815.36
5.5.280.0010.03215.20
5.5.270.0100.02315.25
5.5.260.0000.03815.35
5.5.250.0050.02715.26
5.5.240.0020.02715.18
5.5.230.0050.02515.17
5.5.220.0070.01715.11
5.5.210.0030.03115.19
5.5.200.0060.01915.13
5.5.190.0070.02915.05
5.5.180.0060.02915.21
5.5.170.0050.00712.46
5.5.160.0060.01815.11
5.5.150.0030.03215.19
5.5.140.0010.03215.14
5.5.130.0100.02615.22
5.5.120.0020.02314.99
5.5.110.0070.03315.11
5.5.100.0040.03515.10
5.5.90.0060.03115.12
5.5.80.0070.03215.10
5.5.70.0080.02415.01
5.5.60.0040.02215.00
5.5.50.0030.02115.16
5.5.40.0050.01715.08
5.5.30.0050.03014.87
5.5.20.0040.03115.13
5.5.10.0050.02815.13
5.5.00.0020.02115.03
5.4.450.0030.01914.12
5.4.440.0050.03014.13
5.4.430.0010.02214.19
5.4.420.0030.02714.18
5.4.410.0050.01514.06
5.4.400.0060.02914.01
5.4.390.0030.02813.98
5.4.380.0060.02713.99
5.4.370.0060.02913.99
5.4.360.0070.02814.03
5.4.350.0050.03013.92
5.4.340.0050.02914.09
5.4.330.0060.00411.23
5.4.320.0060.02814.02
5.4.310.0050.02613.96
5.4.300.0070.02414.01
5.4.290.0010.02213.88
5.4.280.0070.02814.02
5.4.270.0040.03014.02
5.4.260.0070.02813.91
5.4.250.0060.03013.98
5.4.240.0090.02613.94
5.4.230.0070.02514.00
5.4.220.0030.02814.09
5.4.210.0040.01814.04
5.4.200.0080.02314.07
5.4.190.0020.02914.05
5.4.180.0050.02713.99
5.4.170.0050.01713.97
5.4.160.0050.03014.06
5.4.150.0070.01613.96
5.4.140.0030.01613.05
5.4.130.0060.02813.11
5.4.120.0060.01513.07
5.4.110.0050.03013.12
5.4.100.0060.02013.06
5.4.90.0060.02313.12
5.4.80.0030.01713.16
5.4.70.0080.02613.11
5.4.60.0050.02813.18
5.4.50.0070.01613.09
5.4.40.0070.02713.06
5.4.30.0010.03313.02
5.4.20.0060.02813.13
5.4.10.0030.02613.12
5.4.00.0010.02912.88
5.3.290.0050.02312.32
5.3.280.0060.02812.33
5.3.270.0000.02412.41
5.3.260.0040.02812.45
5.3.250.0050.02712.40
5.3.240.0040.02612.33
5.3.230.0080.02312.41
5.3.220.0050.02612.37
5.3.210.0010.03212.34
5.3.200.0040.02212.36
5.3.190.0060.03012.39
5.3.180.0050.01612.38
5.3.170.0070.02612.37
5.3.160.0010.02912.41
5.3.150.0050.01612.36
5.3.140.0070.02812.31
5.3.130.0060.02612.38
5.3.120.0020.03112.35
5.3.110.0110.02212.30
5.3.100.0030.03112.12
5.3.90.0070.02512.21
5.3.80.0060.02612.13
5.3.70.0040.03112.17
5.3.60.0070.02312.21
5.3.50.0050.01712.11
5.3.40.0060.02912.11
5.3.30.0070.02312.14
5.3.20.0040.02412.06
5.3.10.0040.02512.01
5.3.00.0050.02711.87
5.2.170.0060.03110.63
5.2.160.0020.03510.57
5.2.150.0030.03210.55
5.2.140.0090.02410.59
5.2.130.0050.03010.54
5.2.120.0030.03210.54
5.2.110.0060.01710.57
5.2.100.0000.03510.53
5.2.90.0030.03210.54
5.2.80.0060.03510.60
5.2.70.0050.03010.49
5.2.60.0030.03010.57
5.2.50.0050.01510.53
5.2.40.0020.01610.50
5.2.30.0070.01410.54
5.2.20.0030.01610.51
5.2.10.0030.01510.44
5.2.00.0030.01610.40
5.1.60.0050.01210.02
5.1.50.0010.0189.91
5.1.40.0020.0159.99
5.1.30.0050.01510.11
5.1.20.0000.01610.18
5.1.10.0020.01710.07
5.1.00.0020.01310.06
5.0.50.0020.0129.29
5.0.40.0020.0129.19
5.0.30.0030.0159.13
5.0.20.0030.0109.09
5.0.10.0030.0119.08
5.0.00.0010.0189.13
4.4.90.0020.0219.05
4.4.80.0000.0129.05
4.4.70.0020.0129.05
4.4.60.0020.0089.05
4.4.50.0030.0089.05
4.4.40.0020.0159.05
4.4.30.0030.0089.05
4.4.20.0000.0119.05
4.4.10.0000.0129.05
4.4.00.0050.0129.05
4.3.110.0020.0109.05
4.3.100.0020.0099.05
4.3.90.0010.0119.05
4.3.80.0000.0159.05
4.3.70.0020.0109.05
4.3.60.0010.0089.05
4.3.50.0010.0189.05
4.3.40.0030.0189.05
4.3.30.0020.0109.05
4.3.20.0000.0119.05
4.3.10.0030.0109.05
4.3.00.0010.0109.05

preferences:
56.76 ms | 401 KiB | 5 Q