3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function bar() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class Baz { function test() { $objDateTime = new DateTime('NOW'); echo 'Baz->test()::DEBUT: ' . $objDateTime->format('c').'\n'; for($index=1; $index <10; $index++) { Foo::bar(); } $objDateTime = new DateTime('NOW'); echo 'Baz->test()::FIN: ' . $objDateTime->format('c').'\n'; } } $baz = new Baz; $baz->test(); class FooPropre { public static function barPropre() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class BazPropre { function testPropre() { $objDateTime = new DateTime('NOW'); echo 'BazPropre->testPropre()::DEBUT: ' . $objDateTime->format('c').'\n'; for($index=1; $index <10; $index++) { FooPropre::barPropre(); } $objDateTime = new DateTime('NOW'); echo 'BazPropre->testPropre()::FIN: ' . $objDateTime->format('c').'\n'; } } $baz = new BazPropre; $baz->testPropre();

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.0160.00318.56
8.3.50.0080.00616.62
8.3.40.0090.00619.07
8.3.30.0100.00318.98
8.3.20.0080.00018.98
8.3.10.0060.00320.65
8.3.00.0090.00017.75
8.2.180.0140.00716.88
8.2.170.0070.00722.96
8.2.160.0030.01022.11
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00019.95
8.2.110.0180.00622.13
8.2.100.0110.00017.97
8.2.90.0050.00318.09
8.2.80.0030.00517.97
8.2.70.0060.00317.88
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0000.00818.34
8.2.30.0000.00818.20
8.2.20.0040.00417.95
8.2.10.0030.00717.85
8.2.00.0040.00417.93
8.1.280.0080.00825.92
8.1.270.0050.00223.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.19
8.1.230.0070.00421.03
8.1.220.0060.00317.91
8.1.210.0040.00418.89
8.1.200.0060.00317.48
8.1.190.0040.00417.52
8.1.180.0030.00618.10
8.1.170.0050.00318.82
8.1.160.0070.00018.83
8.1.150.0000.00818.76
8.1.140.0060.00317.66
8.1.130.0030.00317.88
8.1.120.0050.00317.70
8.1.110.0090.00017.67
8.1.100.0040.00417.68
8.1.90.0000.00717.67
8.1.80.0000.00817.56
8.1.70.0070.00017.59
8.1.60.0000.00717.69
8.1.50.0040.00417.52
8.1.40.0000.00717.67
8.1.30.0020.00517.72
8.1.20.0030.00517.77
8.1.10.0050.00317.75
8.1.00.0040.00417.71
8.0.300.0040.00419.89
8.0.290.0080.00016.88
8.0.280.0030.00318.51
8.0.270.0030.00317.26
8.0.260.0060.00017.08
8.0.250.0070.00017.19
8.0.240.0060.00617.20
8.0.230.0080.00017.14
8.0.220.0040.00417.12
8.0.210.0070.00017.06
8.0.200.0100.00017.21
8.0.190.0030.00617.11
8.0.180.0050.00217.09
8.0.170.0000.00917.07
8.0.160.0050.00217.13
8.0.150.0050.00316.98
8.0.140.0030.00917.18
8.0.130.0030.00313.41
8.0.120.0090.00017.14
8.0.110.0030.00617.06
8.0.100.0080.00016.97
8.0.90.0000.00717.13
8.0.80.0080.00817.20
8.0.70.0040.00416.98
8.0.60.0000.00716.99
8.0.50.0070.00017.14
8.0.30.0120.00817.13
8.0.20.0080.01317.17
8.0.10.0000.00717.21
8.0.00.0120.00616.83
7.4.330.0050.00014.89
7.4.320.0000.00616.66
7.4.300.0070.00016.74
7.4.290.0040.00416.65
7.4.280.0050.00516.65
7.4.270.0000.00816.54
7.4.260.0030.00313.39
7.4.250.0080.00016.60
7.4.240.0040.00416.71
7.4.230.0040.00416.80
7.4.220.0190.00416.61
7.4.210.0080.00816.72
7.4.200.0000.00716.74
7.4.190.0070.00016.59
7.4.160.0140.00716.59
7.4.150.0070.01117.07
7.4.140.0140.00717.22
7.4.130.0130.00416.62
7.4.120.0070.01016.79
7.4.110.0120.00616.62
7.4.100.0120.00616.72
7.4.90.0120.01216.72
7.4.80.0170.00718.80
7.4.70.0030.01416.63
7.4.60.0100.00716.61
7.4.50.0000.01016.85
7.4.40.0030.01322.27
7.4.30.0060.01616.70
7.4.00.0070.01115.06
7.3.330.0030.00313.50
7.3.320.0000.00613.29
7.3.310.0000.00716.48
7.3.300.0030.00316.48
7.3.290.0100.00316.55
7.3.280.0080.00816.49
7.3.270.0090.00917.07
7.3.260.0100.00618.24
7.3.250.0090.00916.55
7.3.240.0100.00716.58
7.3.230.0110.00616.68
7.3.210.0170.00016.66
7.3.200.0160.00019.39
7.3.190.0100.01016.68
7.3.180.0120.00416.56
7.3.170.0030.01316.63
7.3.160.0030.01416.57
7.3.120.0060.01015.08
7.2.330.0070.01117.02
7.2.320.0070.01016.76
7.2.310.0130.00616.59
7.2.300.0060.01016.92
7.2.290.0060.01016.91
7.2.60.0070.00717.02
7.2.00.0070.01019.68
7.1.200.0070.00715.81
7.1.100.0040.00818.23
7.1.70.0060.01017.37
7.1.60.0150.00919.40
7.1.50.0090.01216.98
7.1.00.0000.07722.48
7.0.200.0070.00316.88
7.0.140.0000.08022.00
7.0.120.0100.02721.95
7.0.60.0030.07020.03
7.0.50.0100.04717.75
7.0.40.0170.07720.26
7.0.30.0370.07320.07
7.0.20.0270.08320.25
7.0.10.0100.05720.09
7.0.00.0030.05020.16
5.6.210.0130.07720.52
5.6.200.0100.05718.18
5.6.190.0000.07320.57
5.6.180.4030.04320.47
5.6.170.0300.07720.47
5.6.160.0070.05020.50
5.6.150.0130.03718.29
5.6.140.0070.08018.18
5.6.130.0100.08318.29
5.6.120.0070.08321.11
5.6.110.0030.04320.90
5.6.100.0230.06321.09
5.6.90.0070.05320.98
5.6.80.0100.03320.38
5.6.70.3530.03320.54
5.5.350.0330.05720.45
5.5.340.0030.04018.09
5.5.330.0130.07720.40
5.5.320.3500.04720.27
5.5.310.0330.07020.27
5.5.300.0100.07718.10
5.5.290.0070.07317.93
5.5.280.0030.05021.00
5.5.270.0030.07720.77
5.5.260.0100.07720.88
5.5.250.0070.06720.67
5.5.240.0100.03320.20
5.4.450.0000.06719.38
5.4.440.0070.06319.33
5.4.430.0100.03319.30
5.4.420.0070.03719.48
5.4.410.0100.07319.34
5.4.400.0100.07019.13
5.4.390.0030.08018.93
5.4.380.0030.07719.14
5.4.370.0070.07719.24
5.4.360.0130.05319.16
5.4.350.0070.07319.24
5.4.340.0070.06319.15
5.4.320.0130.07018.87
5.4.310.0100.06719.24
5.4.300.0030.07719.23
5.4.290.0100.06718.87
5.4.280.0000.06019.23
5.4.270.0100.04019.19
5.4.260.0030.08018.85
5.4.250.0030.04718.87
5.4.240.0070.06718.85
5.4.230.0070.06019.23
5.4.220.0200.06318.86
5.4.210.0130.06719.11
5.4.200.0030.07718.99
5.4.190.0070.07319.01
5.4.180.0070.06319.11
5.4.170.0070.08019.09
5.4.160.0100.07318.96
5.4.150.0100.07019.13
5.4.140.0030.07716.30
5.4.130.0130.04016.42
5.4.120.0100.07316.48
5.4.110.0070.04716.48
5.4.100.0130.06016.50
5.4.90.0030.04716.43
5.4.80.0100.06316.50
5.4.70.0030.08316.44
5.4.60.0000.05016.47
5.4.50.0030.04716.50
5.4.40.0030.05016.37
5.4.30.0000.07716.35
5.4.20.0030.08016.42
5.4.10.0100.05016.50
5.4.00.0070.07315.79
5.3.290.0030.07714.67
5.3.280.0100.07014.68
5.3.270.0070.08014.54
5.3.260.0070.07714.68
5.3.250.0030.05014.64
5.3.240.0030.07714.62
5.3.230.0100.07314.61
5.3.220.0070.07714.62
5.3.210.0100.04014.61
5.3.200.0100.07314.62
5.3.190.0070.06014.63
5.3.180.0070.07314.61
5.3.170.0130.06714.62
5.3.160.0030.07714.60
5.3.150.0100.07714.50
5.3.140.0070.07314.60
5.3.130.0070.04714.57
5.3.120.0030.08014.56
5.3.110.0130.05314.59
5.3.100.0100.07014.04
5.3.90.0070.06014.09
5.3.80.0100.07314.07
5.3.70.0100.06714.04
5.3.60.0030.07714.05
5.3.50.0070.05314.13
5.3.40.0030.07714.02
5.3.30.0100.06313.81
5.3.20.0000.04313.70
5.3.10.0030.06713.67
5.3.00.0000.07713.65
5.2.170.0030.04011.09
5.2.160.0000.04011.05
5.2.150.0100.04311.18
5.2.140.0070.06011.24
5.2.130.0070.02711.09
5.2.120.0130.04311.09
5.2.110.0030.06311.27
5.2.100.0070.06011.18
5.2.90.0030.06011.03
5.2.80.0000.04011.16
5.2.70.0130.05311.26
5.2.60.0070.06311.03
5.2.50.0030.06711.04
5.2.40.0030.05710.98
5.2.30.0070.06710.98
5.2.20.0100.03310.94
5.2.10.0000.04310.93
5.2.00.0070.04010.70
5.1.60.0030.03710.05
5.1.50.0070.03310.01
5.1.40.0030.04710.13
5.1.30.0070.05710.40
5.1.20.0070.03310.42
5.1.10.0030.04310.23
5.1.00.0000.03010.08
5.0.50.0000.0278.64
5.0.40.0030.0438.58
5.0.30.0000.0438.39
5.0.20.0000.0308.17
5.0.10.0070.0408.15
5.0.00.0030.0678.33
4.4.90.0000.0278.15
4.4.80.0000.0408.15
4.4.70.0000.0378.15
4.4.60.0070.0278.15
4.4.50.0030.0278.15
4.4.40.0030.0508.15
4.4.30.0000.0308.15
4.4.20.0030.0208.15
4.4.10.0000.0178.15
4.4.00.0000.0338.15
4.3.110.0070.0138.15
4.3.100.0000.0308.15
4.3.90.0130.0208.15
4.3.80.0070.0238.15
4.3.70.0030.0178.15
4.3.60.0070.0108.15
4.3.50.0000.0178.15
4.3.40.0000.0238.15
4.3.30.0030.0138.15
4.3.20.0030.0238.15
4.3.10.0000.0208.15
4.3.00.0030.0338.15

preferences:
56.86 ms | 401 KiB | 5 Q