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 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.0120.00916.63
8.3.50.0100.00621.98
8.3.40.0120.00418.75
8.3.30.0040.01119.17
8.3.20.0000.00820.39
8.3.10.0050.00323.60
8.3.00.0000.00920.95
8.2.180.0150.00616.88
8.2.170.0100.00722.96
8.2.160.0070.00720.58
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00020.56
8.2.110.0050.00522.30
8.2.100.0040.00817.91
8.2.90.0060.00319.17
8.2.80.0030.00517.97
8.2.70.0030.00517.36
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0050.00320.07
8.2.30.0040.00418.27
8.2.20.0000.00717.64
8.2.10.0040.00418.15
8.2.00.0050.00217.69
8.1.280.0090.00625.92
8.1.270.0060.00323.71
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0040.00423.92
8.1.230.0040.00719.15
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.36
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00818.41
8.1.160.0040.00422.04
8.1.150.0080.00018.77
8.1.140.0000.00717.35
8.1.130.0030.00317.80
8.1.120.0070.00017.51
8.1.110.0000.00717.38
8.1.100.0040.00417.48
8.1.90.0030.00617.39
8.1.80.0000.00717.50
8.1.70.0000.00717.34
8.1.60.0080.00017.59
8.1.50.0050.00317.50
8.1.40.0000.00817.43
8.1.30.0040.00417.52
8.1.20.0050.00317.65
8.1.10.0030.00617.66
8.1.00.0030.00617.42
8.0.300.0040.00418.77
8.0.290.0050.00217.04
8.0.280.0050.00218.47
8.0.270.0040.00417.15
8.0.260.0080.00017.29
8.0.250.0000.00717.07
8.0.240.0000.00717.05
8.0.230.0050.00317.04
8.0.220.0030.00316.96
8.0.210.0030.00316.98
8.0.200.0060.00017.07
8.0.190.0000.00817.10
8.0.180.0040.00416.89
8.0.170.0040.00416.90
8.0.160.0000.00716.96
8.0.150.0030.00316.89
8.0.140.0000.00716.98
8.0.130.0030.00313.45
8.0.120.0040.00416.89
8.0.110.0060.00316.88
8.0.100.0030.00516.97
8.0.90.0000.00716.93
8.0.80.0030.01316.96
8.0.70.0040.00416.86
8.0.60.0050.00216.80
8.0.50.0030.00317.01
8.0.30.0080.01517.05
8.0.20.0160.00317.40
8.0.10.0040.00417.01
8.0.00.0090.01116.79
7.4.330.0000.00515.00
7.4.320.0070.00016.48
7.4.300.0000.00616.60
7.4.290.0030.00316.61
7.4.280.0060.00316.51
7.4.270.0030.00316.52
7.4.260.0000.00816.53
7.4.250.0000.00816.57
7.4.240.0000.00716.55
7.4.230.0050.00316.32
7.4.220.0070.01016.50
7.4.210.0150.00016.70
7.4.200.0000.00716.65
7.4.190.0000.00716.75
7.4.160.0170.00616.46
7.4.150.0090.00917.40
7.4.140.0080.01217.86
7.4.130.0080.01116.75
7.4.120.0110.00816.54
7.4.110.0150.00416.63
7.4.100.0070.01116.65
7.4.90.0030.01316.42
7.4.80.0070.01119.39
7.4.70.0110.00616.52
7.4.60.0110.00716.46
7.4.50.0030.00316.22
7.4.40.0140.00316.46
7.4.30.0090.00616.34
7.4.00.0060.00815.01
7.3.330.0000.00613.43
7.3.320.0000.00513.30
7.3.310.0000.00716.36
7.3.300.0030.00316.40
7.3.290.0030.01016.41
7.3.280.0070.01116.36
7.3.270.0090.00917.40
7.3.260.0130.00316.35
7.3.250.0080.01316.46
7.3.240.0090.00916.51
7.3.230.0080.00816.39
7.3.210.0140.00416.49
7.3.200.0130.01019.39
7.3.190.0070.01116.68
7.3.180.0100.00616.45
7.3.170.0110.00616.37
7.3.160.0030.02016.47
7.3.120.0050.01014.96
7.3.110.0030.01614.48
7.3.100.0070.00414.82
7.3.90.0060.00314.91
7.3.80.0060.00615.02
7.3.70.0070.00314.95
7.3.60.0060.00814.76
7.3.50.0030.00915.02
7.3.40.0060.00914.95
7.3.30.0000.01714.89
7.3.20.0030.00716.85
7.3.10.0080.00616.52
7.3.00.0080.00716.50
7.2.330.0070.01016.87
7.2.320.0140.00316.43
7.2.310.0000.01716.45
7.2.300.0100.00616.35
7.2.290.0160.00316.59
7.2.250.0070.01115.20
7.2.240.0130.00315.08
7.2.230.0070.00315.21
7.2.220.0060.00915.27
7.2.210.0070.00415.02
7.2.200.0030.01214.82
7.2.190.0090.00615.05
7.2.180.0030.01114.84
7.2.170.0060.01314.99
7.2.130.0060.00616.86
7.2.120.0080.00816.57
7.2.110.0040.00816.68
7.2.100.0050.00517.09
7.2.90.0100.00316.80
7.2.80.0060.00917.14
7.2.70.0050.00516.92
7.2.60.0340.01116.84
7.2.50.0080.00417.09
7.2.40.0000.01217.07
7.2.30.0120.00017.04
7.2.20.0060.01016.95
7.2.10.0100.00316.93
7.2.00.0040.01117.15
7.1.330.0030.01215.76
7.1.320.0040.00815.84
7.1.310.0030.01215.68
7.1.300.0070.00715.57
7.1.290.0070.01015.77
7.1.280.0030.00715.66
7.1.270.0000.01715.48
7.1.260.0070.00715.84
7.1.250.0070.00715.73
7.1.200.0030.00915.84
7.1.100.0090.00317.39
7.1.70.0000.00816.75
7.1.60.0100.01419.70
7.1.50.0070.01716.89
7.1.00.0030.07722.39
7.0.200.0000.00716.83
7.0.140.0000.07021.96
7.0.110.0100.07719.88
7.0.100.0070.08019.85
7.0.90.0130.07019.99
7.0.80.0030.08319.98
7.0.70.0100.04719.88
7.0.60.0170.04019.93
7.0.50.0070.08319.97
7.0.40.0070.05019.71
7.0.30.0130.07319.78
7.0.20.0100.07719.81
7.0.10.0130.07319.73
7.0.00.0100.07319.65
5.6.280.0130.06321.03
5.6.260.0100.07720.71
5.6.250.0100.08020.68
5.6.240.0030.08320.57
5.6.230.0030.08020.70
5.6.220.0100.05720.71
5.6.210.0100.08320.68
5.6.200.0070.08020.48
5.6.190.0170.07020.66
5.6.180.0100.07720.48
5.6.170.0130.08320.63
5.6.160.0100.07320.57
5.6.150.0070.08020.69
5.6.140.0070.08720.56
5.6.130.0070.08020.62
5.6.120.0030.08720.71
5.6.110.0030.09020.65
5.6.100.0070.05320.55
5.6.90.0100.07320.45
5.6.80.0100.08020.05
5.6.70.0130.07720.04
5.6.60.0130.07319.92
5.6.50.0130.04719.86
5.6.40.0070.07019.84
5.6.30.0100.06319.93
5.6.20.0100.06320.02
5.6.10.0100.06719.98
5.6.00.0030.07720.02
5.5.380.0130.07317.70
5.5.370.0030.07017.70
5.5.360.0070.08017.51
5.5.350.0000.08017.77
5.5.340.0100.08317.93
5.5.330.0100.07317.91
5.5.320.0130.07017.83
5.5.310.0170.07018.13
5.5.300.0130.06717.91
5.5.290.0100.08317.82
5.5.280.0100.08017.91
5.5.270.0070.04717.92
5.5.260.0130.04318.22
5.5.250.0070.08017.91
5.5.240.0070.07717.48
5.5.230.0100.07017.25
5.5.220.0070.07717.60
5.5.210.0100.06717.29
5.5.200.0100.07017.43
5.5.190.0030.04717.57
5.5.180.0030.06717.28
5.5.160.0130.03717.44
5.5.150.0130.06317.57
5.5.140.0070.04317.47
5.5.130.0070.07017.25
5.5.120.0000.06017.45
5.5.110.0070.07317.43
5.5.100.0030.06717.18
5.5.90.0130.07017.08
5.5.80.0030.07317.48
5.5.70.0070.07317.47
5.5.60.0100.06717.31
5.5.50.0030.08017.37
5.5.40.0130.07317.07
5.5.30.0000.05717.46
5.5.20.0070.08017.03
5.5.10.0100.07017.14
5.5.00.0100.07017.32
5.4.450.0070.07719.33
5.4.440.0070.06019.30
5.4.430.0030.06719.41
5.4.420.0130.05719.38
5.4.410.0070.04319.44
5.4.400.0030.07719.19
5.4.390.0070.07719.34
5.4.380.0070.07719.23
5.4.370.0100.07319.09
5.4.360.0130.07019.18
5.4.350.0130.06719.19
5.4.340.0130.07018.99
5.4.320.0000.04719.18
5.4.310.0100.07719.34
5.4.300.0070.06319.14
5.4.290.0000.05319.22
5.4.280.0100.07319.18
5.4.270.0000.07319.01
5.4.260.0070.07719.18
5.4.250.0030.07719.08
5.4.240.0100.05719.00
5.4.230.0170.04019.13
5.4.220.0100.06719.02
5.4.210.0170.06318.95
5.4.200.0170.06719.16
5.4.190.0070.07719.23
5.4.180.0130.07019.17
5.4.170.0170.06719.32
5.4.160.0100.07019.22
5.4.150.0100.07018.96
5.4.140.0100.06716.34
5.4.130.0070.06716.60
5.4.120.0100.07016.66
5.4.110.0100.07316.47
5.4.100.0100.07016.65
5.4.90.0070.07716.51
5.4.80.0070.07016.45
5.4.70.0000.05316.54
5.4.60.0070.07316.29
5.4.50.0030.07716.52
5.4.40.0130.07016.59
5.4.30.0070.06016.42
5.4.20.0070.07016.41
5.4.10.0130.06716.43
5.4.00.0100.07015.99
5.3.290.0070.07014.64
5.3.280.0100.08014.74
5.3.270.0100.07314.71
5.3.260.0100.04014.62
5.3.250.0030.06714.59
5.3.240.0030.07714.70
5.3.230.0130.03314.75
5.3.220.0030.07014.70
5.3.210.0070.07014.70
5.3.200.0100.05314.70
5.3.190.0070.07714.80
5.3.180.0070.07314.59
5.3.170.0030.07314.56
5.3.160.0070.07714.71
5.3.150.0100.06314.57
5.3.140.0000.07314.58
5.3.130.0070.08014.70
5.3.120.0030.07314.57
5.3.110.0030.08314.42
5.3.100.0130.06713.92
5.3.90.0070.07314.04
5.3.80.0100.06714.04
5.3.70.0130.06714.03
5.3.60.0070.07714.02
5.3.50.0130.06314.04
5.3.40.0170.05713.95
5.3.30.0130.06014.15
5.3.20.0030.05313.71
5.3.10.0100.04313.74
5.3.00.0000.04313.79
5.2.170.0070.06311.12
5.2.160.0030.06311.38
5.2.150.0030.05311.38
5.2.140.0030.06711.13
5.2.130.0100.02311.34
5.2.120.0000.03011.20
5.2.110.0070.03011.17
5.2.100.0030.03311.09
5.2.90.0030.02711.12
5.2.80.0000.03711.07
5.2.70.0070.02311.10
5.2.60.0030.02711.06
5.2.50.0030.02711.12
5.2.40.0030.02711.00
5.2.30.0000.04310.95
5.2.20.0030.02710.98
5.2.10.0030.02310.93
5.2.00.0000.05310.74
5.1.60.0000.02710.18
5.1.50.0000.04710.14
5.1.40.0000.02310.14
5.1.30.0070.04310.34
5.1.20.0030.05310.38
5.1.10.0100.05010.14
5.1.00.0070.02010.14
5.0.50.0030.04010.14
5.0.40.0000.02710.14
5.0.30.0000.03010.14
5.0.20.0000.03710.14
5.0.10.0070.01710.14
5.0.00.0100.02010.14
4.4.90.0030.02010.14
4.4.80.0030.01710.14
4.4.70.0000.01710.14
4.4.60.0000.02310.14
4.4.50.0030.01710.14
4.4.40.0000.02310.14
4.4.30.0030.01310.14
4.4.20.0000.03010.14
4.4.10.0030.03310.14
4.4.00.0030.02010.14
4.3.110.0030.01710.14
4.3.100.0030.02710.14
4.3.90.0000.01710.14
4.3.80.0000.02710.14
4.3.70.0030.01010.14
4.3.60.0030.01310.14
4.3.50.0000.01710.14
4.3.40.0030.02010.14
4.3.30.0000.02010.14
4.3.20.0030.02710.14
4.3.10.0030.02710.14
4.3.00.0000.01310.14

preferences:
40.41 ms | 401 KiB | 5 Q