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.0130.00316.63
8.3.50.0100.00517.51
8.3.40.0060.00918.82
8.3.30.0110.00418.81
8.3.20.0040.00418.70
8.3.10.0000.00918.91
8.3.00.0050.00319.38
8.2.180.0110.00716.75
8.2.170.0060.00922.96
8.2.160.0110.00418.93
8.2.150.0060.00324.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0040.00420.73
8.2.110.0060.00321.18
8.2.100.0030.00917.78
8.2.90.0070.00319.50
8.2.80.0050.00219.28
8.2.70.0060.00317.50
8.2.60.0050.00317.93
8.2.50.0000.00918.07
8.2.40.0040.00418.16
8.2.30.0000.00818.04
8.2.20.0060.00317.56
8.2.10.0040.00417.57
8.2.00.0040.00417.68
8.1.280.0160.00325.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00022.46
8.1.230.0110.00020.97
8.1.220.0060.00317.74
8.1.210.0000.00818.91
8.1.200.0090.00717.38
8.1.190.0060.00317.53
8.1.180.0000.00818.10
8.1.170.0000.00818.78
8.1.160.0000.00818.75
8.1.150.0000.00718.59
8.1.140.0000.00817.30
8.1.130.0030.00317.75
8.1.120.0000.00717.42
8.1.110.0070.00017.29
8.1.100.0040.00417.41
8.1.90.0040.00417.31
8.1.80.0050.00317.30
8.1.70.0000.00717.42
8.1.60.0000.00817.54
8.1.50.0080.00017.38
8.1.40.0040.00417.51
8.1.30.0000.00817.62
8.1.20.0000.00817.55
8.1.10.0000.00817.55
8.1.00.0080.00017.59
8.0.300.0040.00419.82
8.0.290.0000.00916.75
8.0.280.0000.00718.44
8.0.270.0040.00417.27
8.0.260.0070.00016.88
8.0.250.0000.00716.89
8.0.240.0000.00716.93
8.0.230.0000.00916.94
8.0.220.0000.00716.77
8.0.210.0030.00316.78
8.0.200.0000.00617.00
8.0.190.0070.00016.98
8.0.180.0030.00716.93
8.0.170.0040.00416.75
8.0.160.0040.00416.86
8.0.150.0060.00316.83
8.0.140.0080.00016.86
8.0.130.0030.00313.34
8.0.120.0030.00616.93
8.0.110.0040.00416.75
8.0.100.0040.00416.79
8.0.90.0000.00717.00
8.0.80.0070.01416.88
8.0.70.0000.00816.70
8.0.60.0030.00516.75
8.0.50.0050.00316.75
8.0.30.0060.01317.06
8.0.20.0170.00517.12
8.0.10.0000.00716.89
8.0.00.0070.01316.79
7.4.330.0050.00012.96
7.4.320.0030.00316.50
7.4.300.0000.00616.41
7.4.290.0000.00716.50
7.4.280.0040.00416.46
7.4.270.0040.00416.66
7.4.260.0030.00313.28
7.4.250.0040.00416.54
7.4.240.0030.00316.45
7.4.230.0040.00416.72
7.4.220.0000.01716.64
7.4.210.0060.01016.52
7.4.200.0000.00716.35
7.4.190.0000.00716.67
7.4.160.0100.00716.61
7.4.150.0140.01116.43
7.4.140.0130.00316.54
7.4.130.0130.00316.39
7.4.120.0070.01116.47
7.4.110.0130.00316.79
7.4.100.0120.00816.51
7.4.90.0070.01016.57
7.4.80.0100.00719.39
7.4.70.0060.01016.66
7.4.60.0130.00316.64
7.4.50.0000.00516.72
7.4.40.0050.00516.31
7.4.30.0060.01116.73
7.4.00.0060.01114.99
7.3.330.0000.00613.38
7.3.320.0030.00313.30
7.3.310.0000.00716.48
7.3.300.0030.00316.24
7.3.290.0110.00316.36
7.3.280.0100.01016.35
7.3.270.0110.00716.34
7.3.260.0110.00616.54
7.3.250.0090.00916.31
7.3.240.0090.01316.39
7.3.230.0160.00316.39
7.3.210.0110.00716.36
7.3.200.0030.01316.54
7.3.190.0080.00816.35
7.3.180.0160.00016.43
7.3.170.0120.00316.43
7.3.160.0030.01216.38
7.3.120.0110.00714.94
7.3.110.0040.01314.76
7.3.100.0100.00714.72
7.3.90.0090.00414.68
7.3.80.0070.01014.63
7.3.70.0080.00514.71
7.3.60.0070.00714.78
7.3.50.0080.00614.70
7.3.40.0050.00814.80
7.3.30.0080.00814.78
7.3.20.0080.00716.69
7.3.10.0080.00616.52
7.3.00.0050.00816.51
7.2.330.0170.00716.75
7.2.320.0100.01316.46
7.2.310.0060.01516.51
7.2.300.0080.00816.66
7.2.290.0090.00916.40
7.2.250.0130.00514.95
7.2.240.0050.01415.04
7.2.230.0030.01315.07
7.2.220.0060.00614.88
7.2.210.0040.01015.16
7.2.200.0050.01215.02
7.2.190.0050.00915.05
7.2.180.0040.01015.02
7.2.170.0060.00815.12
7.2.130.0000.01216.62
7.2.120.0070.00716.68
7.2.110.0030.00716.59
7.2.100.0040.01116.73
7.2.90.0040.00716.98
7.2.80.0040.01416.96
7.2.70.0090.00916.98
7.2.60.0210.00916.91
7.2.50.0060.00916.86
7.2.40.0030.00817.00
7.2.30.0070.01117.12
7.2.20.0030.01317.09
7.2.10.0040.01116.89
7.2.00.0070.00718.24
7.1.330.0020.01115.66
7.1.320.0050.00715.74
7.1.310.0050.01115.53
7.1.300.0070.00715.59
7.1.290.0070.00115.48
7.1.280.0070.00715.72
7.1.270.0080.00715.68
7.1.260.0040.00615.71
7.1.250.0040.00415.34
7.1.240.0060.00915.69
7.1.230.0110.00415.75
7.1.220.0030.01015.80
7.1.210.0000.01415.55
7.1.200.0080.00715.80
7.1.190.0000.01515.67
7.1.180.0000.01715.86
7.1.170.0030.01015.45
7.1.160.0000.01315.80
7.1.150.0110.00415.79
7.1.140.0070.00715.43
7.1.130.0000.01315.64
7.1.120.0060.00315.80
7.1.110.0030.01015.53
7.1.100.0050.00916.86
7.1.90.0040.01215.77
7.1.80.0030.01015.46
7.1.70.0090.00216.55
7.1.60.0070.01217.46
7.1.50.0080.00816.23
7.1.40.0060.00915.66
7.1.30.0030.01015.54
7.1.20.0110.00315.78
7.1.10.0060.00615.47
7.1.00.0020.04019.01
7.0.330.0000.01415.45
7.0.320.0080.00015.36
7.0.310.0000.01415.21
7.0.300.0070.00715.46
7.0.290.0030.01215.33
7.0.280.0040.00415.22
7.0.270.0000.00915.31
7.0.260.0000.01515.50
7.0.250.0120.00015.32
7.0.240.0030.00615.24
7.0.230.0000.01515.45
7.0.220.0000.00915.34
7.0.210.0030.00615.51
7.0.200.0080.00515.97
7.0.190.0090.00314.95
7.0.180.0060.00614.73
7.0.170.0000.01015.59
7.0.160.0060.00715.48
7.0.150.0070.00715.50
7.0.140.0050.04018.72
7.0.130.0060.00915.58
7.0.120.0060.03318.61
7.0.110.0120.00315.32
7.0.100.0060.00815.06
7.0.90.0080.00415.25
7.0.80.0040.00815.38
7.0.70.0060.00614.97
7.0.60.0080.04017.46
7.0.50.0070.02216.74
7.0.40.0140.03316.82
7.0.30.0330.03016.87
7.0.20.0200.04416.84
7.0.10.0120.03616.82
7.0.00.0080.04416.81
5.6.380.0040.01113.93
5.6.370.0040.00814.44
5.6.360.0070.00714.02
5.6.350.0040.00414.32
5.6.340.0060.01014.01
5.6.330.0100.00314.30
5.6.320.0100.00314.13
5.6.310.0090.00314.35
5.6.300.0100.00314.23
5.6.290.0060.00614.20
5.6.280.0100.03817.75
5.6.270.0060.00614.31
5.6.260.0030.00914.16
5.6.250.0080.00414.25
5.6.240.0080.00614.26
5.6.230.0100.00313.99
5.6.220.0090.00614.22
5.6.210.0070.03717.40
5.6.200.0000.03816.04
5.6.190.0070.04717.38
5.6.180.0200.02717.36
5.6.170.0220.04117.33
5.6.160.0130.02817.26
5.6.150.0080.02316.15
5.6.140.0120.03816.14
5.6.130.0070.04016.21
5.6.120.0050.04317.72
5.6.110.0010.04617.70
5.6.100.0120.03817.59
5.6.90.0090.04417.55
5.6.80.0040.02117.27
5.6.70.0190.03517.41
5.6.60.0000.01214.26
5.6.50.0090.00314.07
5.6.40.0110.00314.02
5.6.30.0030.01314.14
5.6.20.0090.00314.29
5.6.10.0000.01514.40
5.6.00.0060.00614.00
5.5.380.0070.00311.25
5.5.370.0000.00810.96
5.5.360.0060.00611.30
5.5.350.0170.04015.66
5.5.340.0000.02414.42
5.5.330.0020.02515.56
5.5.320.0020.04915.77
5.5.310.0190.01715.66
5.5.300.0060.02314.45
5.5.290.0020.02414.52
5.5.280.0020.03015.83
5.5.270.0030.02316.06
5.5.260.0040.04915.91
5.5.250.0030.04715.70
5.5.240.0060.03515.65
5.5.230.0080.00011.20
5.5.220.0060.00310.66
5.5.210.0000.01311.12
5.5.200.0000.01111.03
5.5.190.0000.00911.23
5.5.180.0030.00510.70
5.5.170.0000.01010.92
5.5.160.0030.00310.86
5.5.150.0030.00310.81
5.5.140.0040.00711.02
5.5.130.0050.00510.83
5.5.120.0000.01210.89
5.5.110.0040.00810.75
5.5.100.0030.00711.11
5.5.90.0070.00611.07
5.5.80.0060.00011.10
5.5.70.0000.01310.82
5.5.60.0030.00611.13
5.5.50.0060.00310.96
5.5.40.0000.01111.17
5.5.30.0040.00711.09
5.5.20.0040.00411.18
5.5.10.0050.00310.66
5.5.00.0030.00910.84
5.4.450.0050.03615.17
5.4.440.0020.04315.24
5.4.430.0070.01915.16
5.4.420.0050.02015.30
5.4.410.0020.02315.13
5.4.400.0070.02015.13
5.4.390.0020.02314.92
5.4.380.0070.02214.97
5.4.370.0080.02414.94
5.4.360.0030.02315.02
5.4.350.0070.02015.00
5.4.340.0050.02114.93
5.4.330.0000.00610.78
5.4.320.0030.02515.05
5.4.310.0080.01815.05
5.4.300.0030.03115.11
5.4.290.0030.02014.96
5.4.280.0020.02415.06
5.4.270.0070.01714.88
5.4.260.0020.02515.06
5.4.250.0040.02214.78
5.4.240.0030.02215.08
5.4.230.0080.01514.79
5.4.220.0040.02015.06
5.4.210.0070.02015.12
5.4.200.0000.02514.99
5.4.190.0000.03214.98
5.4.180.0050.02014.88
5.4.170.0120.03314.94
5.4.160.0050.02714.93
5.4.150.0140.02315.08
5.4.140.0060.02113.72
5.4.130.0130.02713.65
5.4.120.0050.02313.59
5.4.110.0090.02913.78
5.4.100.0070.02413.65
5.4.90.0100.01813.68
5.4.80.0080.02013.73
5.4.70.0020.04213.55
5.4.60.0050.02813.72
5.4.50.0100.03513.78
5.4.40.0070.02013.79
5.4.30.0060.02013.65
5.4.20.0010.02313.67
5.4.10.0020.04313.62
5.4.00.0030.02913.21
5.3.290.0060.02012.72
5.3.280.0020.02212.63
5.3.270.0070.01812.64
5.3.260.0040.04112.64
5.3.250.0070.02712.54
5.3.240.0050.02012.59
5.3.230.0060.02412.54
5.3.220.0010.03612.43
5.3.210.0050.04112.63
5.3.200.0030.04312.45
5.3.190.0050.03612.61
5.3.180.0050.04112.64
5.3.170.0040.04312.57
5.3.160.0050.02412.65
5.3.150.0050.03412.49
5.3.140.0030.02512.61
5.3.130.0030.02412.50
5.3.120.0030.02412.45
5.3.110.0050.04212.60
5.3.100.0070.03712.34
5.3.90.0070.03312.31
5.3.80.0080.03212.28
5.3.70.0050.03612.20
5.3.60.0060.02312.31
5.3.50.0090.01612.21
5.3.40.0060.03012.26
5.3.30.0060.04112.22
5.3.20.0100.03512.13
5.3.10.0090.02812.01
5.3.00.0120.03711.90
5.2.170.0080.02610.43
5.2.160.0050.02410.35
5.2.150.0000.02710.41
5.2.140.0070.03510.48
5.2.130.0080.02810.38
5.2.120.0050.03310.42
5.2.110.0040.02010.47
5.2.100.0030.02310.41
5.2.90.0060.03110.39
5.2.80.0060.03210.41
5.2.70.0050.02310.41
5.2.60.0050.03310.36
5.2.50.0020.02010.38
5.2.40.0030.02310.30
5.2.30.0080.02810.26
5.2.20.0020.02810.27
5.2.10.0030.02510.34
5.2.00.0030.03010.17
5.1.60.0050.0219.84
5.1.50.0020.0149.82
5.1.40.0030.0189.81
5.1.30.0090.02510.00
5.1.20.0010.03310.03
5.1.10.0050.0279.85
5.1.00.0060.0289.87
5.0.50.0030.0259.23
5.0.40.0060.0139.23
5.0.30.0010.0239.23
5.0.20.0040.0209.23
5.0.10.0000.0299.23
5.0.00.0000.0329.23
4.4.90.0040.0179.23
4.4.80.0000.0229.23
4.4.70.0020.0209.23
4.4.60.0000.0239.23
4.4.50.0000.0149.23
4.4.40.0020.0329.23
4.4.30.0030.0139.23
4.4.20.0050.0179.23
4.4.10.0000.0149.23
4.4.00.0000.0239.23
4.3.110.0020.0169.23
4.3.100.0010.0139.23
4.3.90.0080.0159.23
4.3.80.0030.0219.23
4.3.70.0020.0109.23
4.3.60.0020.0129.23
4.3.50.0020.0209.23
4.3.40.0000.0239.23
4.3.30.0010.0119.23
4.3.20.0000.0209.23
4.3.10.0050.0109.23
4.3.00.0030.0139.23

preferences:
37.94 ms | 401 KiB | 5 Q