3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php use B\D, C\E as F; namespace A ; use B\D, C\E as F; // function calls function foo() { echo __NAMESPACE__;} namespace B; use B\D, C\E as F; class D { function foo() { echo __NAMESPACE__;}} //* namespace{ use B\D, C\E as F; echo __NAMESPACE__; // function calls*/ new D(); D:foo(); // first tries to call "foo" defined in namespace "A" // then calls global function "foo" new D(); // using import rules, creates object of class "D" defined in namespace "B" // if not found, it tries to autoload class "B\D" new F(); // using import rules, creates object of class "E" defined in namespace "C" // if not found, it tries to autoload class "C\E" new \B(); // creates object of class "B" defined in global scope // if not found, it tries to autoload class "B" new \D(); // creates object of class "D" defined in global scope // if not found, it tries to autoload class "D" new \F(); // creates object of class "F" defined in global scope // if no ?>

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.00.0040.00816.61
7.2.130.0070.00716.93
7.2.120.0000.01416.91
7.2.110.0000.01316.73
7.2.100.0030.01016.88
7.2.90.0000.01016.98
7.2.80.0060.00616.92
7.2.70.0040.01216.79
7.2.60.0050.00916.75
7.2.50.0090.00316.78
7.2.40.0060.01016.90
7.2.30.0110.00016.93
7.2.20.0080.00316.94
7.2.10.0040.00716.73
7.2.00.0040.00717.88
7.1.250.0090.00315.86
7.1.240.0030.00915.67
7.1.230.0140.00015.70
7.1.220.0040.01115.64
7.1.210.0000.01115.50
7.1.200.0020.00715.63
7.1.190.0050.01215.52
7.1.180.0000.01115.77
7.1.170.0000.01115.38
7.1.160.0040.01115.76
7.1.150.0060.00315.68
7.1.140.0000.01315.49
7.1.130.0040.00415.45
7.1.120.0080.00815.50
7.1.110.0030.00915.75
7.1.100.0060.00716.89
7.1.90.0070.00715.63
7.1.80.0060.00615.59
7.1.70.0040.00416.39
7.1.60.0070.00917.62
7.1.50.0040.00816.29
7.1.40.0000.01515.57
7.1.30.0070.00715.66
7.1.20.0030.01215.40
7.1.10.0070.01015.57
7.1.00.0020.04518.96
7.0.330.0060.00615.39
7.0.320.0100.00015.27
7.0.310.0000.01315.17
7.0.300.0000.01515.29
7.0.290.0110.00315.26
7.0.280.0090.00315.39
7.0.270.0000.00915.39
7.0.260.0000.00715.21
7.0.250.0090.00615.45
7.0.240.0070.00315.21
7.0.230.0000.00915.48
7.0.220.0070.00715.30
7.0.210.0000.01115.48
7.0.200.0040.00716.09
7.0.190.0040.01115.45
7.0.180.0100.00015.47
7.0.170.0030.00515.29
7.0.160.0040.01015.43
7.0.150.0070.00715.53
7.0.140.0050.04218.81
7.0.130.0030.00715.32
7.0.120.0070.00715.36
7.0.110.0060.00615.09
7.0.100.0030.04317.62
7.0.90.0050.04617.67
7.0.80.0030.04317.60
7.0.70.0030.04517.64
7.0.60.0100.04017.60
7.0.50.0130.03717.78
7.0.40.0120.04216.75
7.0.30.0100.03016.64
7.0.20.0110.03716.76
7.0.10.0130.04016.80
7.0.00.0080.04216.85
5.6.380.0030.00914.52
5.6.370.0000.01314.34
5.6.360.0040.00413.95
5.6.350.0100.00313.99
5.6.340.0040.01114.27
5.6.330.0070.01014.38
5.6.320.0070.00314.22
5.6.310.0030.01413.87
5.6.300.0030.00614.12
5.6.290.0040.00414.31
5.6.280.0030.04317.72
5.6.270.0030.01414.28
5.6.260.0090.00014.25
5.6.250.0110.03417.36
5.6.240.0020.04617.47
5.6.230.0070.04817.54
5.6.220.0030.03117.42
5.6.210.0030.04617.30
5.6.200.0070.03517.61
5.6.190.0100.03817.64
5.6.180.0110.04017.71
5.6.170.0120.03717.57
5.6.160.0040.04717.71
5.6.150.0050.04517.63
5.6.140.0030.05017.61
5.6.130.0080.04017.71
5.6.120.0050.03817.62
5.6.110.0050.04717.61
5.6.100.0060.04317.52
5.6.90.0090.04217.70
5.6.80.0080.04217.44
5.6.70.0030.04517.33
5.6.60.0070.04217.19
5.6.50.0030.04217.31
5.6.40.0060.04317.25
5.6.30.0100.03817.24
5.6.20.0040.02617.27
5.6.10.0030.04617.42
5.6.00.0050.04217.13
5.5.380.0130.03615.75
5.5.370.0050.02215.88
5.5.360.0060.04115.76
5.5.350.0090.04015.80
5.5.340.0030.04715.96
5.5.330.0100.04015.98
5.5.320.0080.04316.03
5.5.310.0030.04815.91
5.5.300.0070.04015.98
5.5.290.0020.04416.03
5.5.280.0040.04916.04
5.5.270.0050.04316.02
5.5.260.0000.04816.05
5.5.250.0050.04015.95
5.5.240.0080.04215.73
5.5.230.0030.04215.65
5.5.220.0030.02615.65
5.5.210.0030.02315.74
5.5.200.0110.03815.71
5.5.190.0030.04515.65
5.5.180.0150.03315.71
5.5.170.0000.01111.18
5.5.160.0050.04015.73
5.5.150.0070.04015.73
5.5.140.0070.04115.67
5.5.130.0060.04115.70
5.5.120.0120.03815.64
5.5.110.0030.03715.72
5.5.100.0080.04015.68
5.5.90.0070.03715.61
5.5.80.0050.04215.63
5.5.70.0050.04215.67
5.5.60.0070.02815.56
5.5.50.0080.03715.66
5.5.40.0100.03815.67
5.5.30.0110.01915.66
5.5.20.0150.03315.67
5.5.10.0130.03015.60
5.5.00.0030.04315.66
5.4.450.0050.04515.28
5.4.440.0080.04215.37
5.4.430.0060.02315.30
5.4.420.0020.04015.28
5.4.410.0090.03815.12
5.4.400.0070.04215.04
5.4.390.0050.04215.18
5.4.380.0050.02715.16
5.4.370.0000.02415.15
5.4.360.0030.04615.15
5.4.350.0050.04015.21
5.4.340.0000.05115.19
5.4.330.0040.00711.18
5.4.320.0050.04015.16
5.4.310.0030.04315.04
5.4.300.0070.03715.18
5.4.290.0050.04115.19
5.4.280.0080.03615.11
5.4.270.0070.04115.04
5.4.260.0080.03915.04
5.4.250.0070.04015.04
5.4.240.0100.03915.10
5.4.230.0040.04015.18
5.4.220.0050.04415.11
5.4.210.0060.04115.12
5.4.200.0030.04615.10
5.4.190.0060.04315.01
5.4.180.0050.02915.14
5.4.170.0050.03715.16
5.4.160.0030.04415.18
5.4.150.0080.03515.05
5.4.140.0050.04013.83
5.4.130.0070.03213.74
5.4.120.0050.03313.79
5.4.110.0020.04213.79
5.4.100.0060.04113.83
5.4.90.0110.02813.83
5.4.80.0100.03313.81
5.4.70.0060.03813.82
5.4.60.0080.03613.76
5.4.50.0070.03913.76
5.4.40.0050.04013.86
5.4.30.0060.04013.79
5.4.20.0050.04213.83
5.4.10.0040.04013.79
5.4.00.0040.03513.54
5.3.290.0050.02212.97
5.3.280.0050.03712.85
5.3.270.0110.03112.92
5.3.260.0070.03912.92
5.3.250.0100.03612.94
5.3.240.0020.04212.95
5.3.230.0050.03812.95
5.3.220.0090.03512.90
5.3.210.0020.03712.84
5.3.200.0070.04112.94
5.3.190.0020.04412.86
5.3.180.0100.03812.94
5.3.170.0110.03312.94
5.3.160.0020.03412.94
5.3.150.0050.04012.83
5.3.140.0100.03712.90
5.3.130.0080.03812.88
5.3.120.0050.04012.85
5.3.110.0030.04512.89
5.3.100.0030.04112.60
5.3.90.0050.03812.63
5.3.80.0000.04412.63
5.3.70.0070.03312.65
5.3.60.0010.04512.62
5.3.50.0040.03012.51
5.3.40.0080.03812.57
5.3.30.0100.03512.54
5.3.20.0030.04212.47
5.3.10.0020.04012.36
5.3.00.0050.04012.37
5.2.170.0040.03411.15
5.2.160.0020.03411.18
5.2.150.0050.03511.07
5.2.140.0080.03011.08
5.2.130.0030.02511.17
5.2.120.0030.03311.06
5.2.110.0030.03311.07
5.2.100.0030.02611.13
5.2.90.0030.03011.05
5.2.80.0060.02811.15
5.2.70.0000.03511.13
5.2.60.0080.02711.04
5.2.50.0030.03311.12
5.2.40.0030.03211.08
5.2.30.0000.04011.00
5.2.20.0040.03011.01
5.2.10.0040.02811.05
5.2.00.0080.02810.98
5.1.60.0020.03010.60
5.1.50.0030.02710.62
5.1.40.0040.02210.62
5.1.30.0020.02210.79
5.1.20.0030.02910.79
5.1.10.0080.02410.63
5.1.00.0000.02610.65
5.0.50.0030.02210.07
5.0.40.0030.01910.07
5.0.30.0000.03410.07
5.0.20.0020.02210.07
5.0.10.0030.02110.07
5.0.00.0030.03410.07
4.4.90.0020.02010.07
4.4.80.0000.02010.07
4.4.70.0020.02010.07
4.4.60.0020.01910.07
4.4.50.0060.01210.07
4.4.40.0050.02410.07
4.4.30.0040.01810.07
4.4.20.0030.01710.07
4.4.10.0010.01810.07
4.4.00.0020.02910.07
4.3.110.0020.01710.07
4.3.100.0000.01310.07
4.3.90.0010.01810.07
4.3.80.0030.02210.07
4.3.70.0020.01810.07
4.3.60.0020.01810.07
4.3.50.0050.01710.07
4.3.40.0030.02710.07
4.3.30.0000.02210.07
4.3.20.0030.01810.07
4.3.10.0010.02010.07
4.3.00.0020.02010.07