3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace{ function foo(){ echo "I'm (g)root!\n"; } function foo2(){ echo "I'm (g)root2!\n"; } function foo3(){ echo "I'm (g)root3!\n"; } } namespace Baz{ Class Test { function foobar(){ foo3(); } } Class Test2 { function foobar(){ foo3(); } } echo 'Function resolved at runtime so output changes' . "\n"; foo(); if(true){function foo(){ echo "I'm not (g)root!\n"; }} foo(); echo '------' . "\n"; echo 'Call for test purpose before Baz\foo3() has been defined' . "\n"; $test = new Test(); $test->foobar(); echo '------' . "\n"; echo 'Function resolved at parsing time so output does not change' . "\n"; foo2(); function foo2(){ echo "I'm not (g)root2!\n"; } foo2(); echo '------' . "\n"; echo 'Function resolved at runtime so output changes' . "\n"; foo3(); eval("namespace Baz; function foo3(){echo 'I\'m not (g)root3!\n';}"); foo3(); echo '------' . "\n"; echo 'Method has already been called so using the old version' . "\n"; $test->foobar(); echo 'Method is called for the first time so using the new version' . "\n"; $test2 = new Test2(); $test2->foobar(); }

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.00718.56
8.3.50.0100.00716.40
8.3.40.0120.00618.80
8.3.30.0100.00718.63
8.3.20.0050.00319.29
8.3.10.0040.00423.65
8.3.00.0040.00420.67
8.2.180.0070.00716.63
8.2.170.0040.01122.96
8.2.160.0110.00421.06
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00820.94
8.2.120.0000.00826.35
8.2.110.0190.00322.07
8.2.100.0120.00017.91
8.2.90.0060.00318.09
8.2.80.0040.00418.97
8.2.70.0030.00717.50
8.2.60.0060.00317.63
8.2.50.0080.00017.93
8.2.40.0000.00719.30
8.2.30.0040.00420.65
8.2.20.0000.00718.14
8.2.10.0030.00618.77
8.2.00.0070.00518.56
8.1.280.0100.01025.92
8.1.270.0090.00023.87
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00019.01
8.1.230.0080.00417.82
8.1.220.0090.00017.79
8.1.210.0060.00318.77
8.1.200.0030.00717.35
8.1.190.0040.00417.23
8.1.180.0030.00918.10
8.1.170.0090.00018.90
8.1.160.0000.00818.88
8.1.150.0000.00718.82
8.1.140.0080.00218.28
8.1.130.0090.00119.11
8.1.120.0090.00217.51
8.1.110.0080.00417.47
8.1.100.0080.00417.55
8.1.90.0050.00817.45
8.1.80.0000.01117.53
8.1.70.0070.00417.46
8.1.60.0070.00617.55
8.1.50.0120.00017.57
8.1.40.0080.00517.57
8.1.30.0070.00617.68
8.1.20.0100.00217.64
8.1.10.0070.00717.54
8.1.00.0140.00017.47
8.0.300.0070.00018.77
8.0.290.0050.00216.75
8.0.280.0000.00718.48
8.0.270.0070.00716.82
8.0.260.0040.00617.68
8.0.250.0050.00517.05
8.0.240.0050.00716.96
8.0.230.0080.00217.03
8.0.220.0020.00916.90
8.0.210.0070.00416.89
8.0.200.0110.00017.01
8.0.190.0070.00416.97
8.0.180.0030.00716.96
8.0.170.0090.00316.96
8.0.160.0030.00616.90
8.0.150.0100.00516.94
8.0.140.0080.00316.91
8.0.130.0060.00515.18
8.0.120.0070.00416.92
8.0.110.0050.00516.93
8.0.100.0060.00416.82
8.0.90.0060.00516.97
8.0.80.0100.00616.92
8.0.70.0040.00716.94
8.0.60.0100.00216.85
8.0.50.0080.00316.91
8.0.30.0110.00717.14
8.0.20.0100.01017.22
8.0.10.0120.00717.09
8.0.00.0100.00716.99
7.4.330.0070.00015.92
7.4.320.0020.01016.61
7.4.300.0080.00316.60
7.4.290.0080.00416.54
7.4.280.0120.00016.48
7.4.270.0090.00316.61
7.4.260.0080.00416.50
7.4.250.0110.00116.51
7.4.240.0100.00216.41
7.4.230.0070.00416.57
7.4.220.0090.00216.55
7.4.210.0100.00716.51
7.4.200.0100.00116.40
7.4.190.0130.00016.67
7.4.180.0140.00016.49
7.4.160.0090.00716.53
7.4.150.0100.00616.57
7.4.140.0090.00917.46
7.4.130.0130.00416.44
7.4.120.0090.01216.56
7.4.110.0110.00716.54
7.4.100.0130.00616.56
7.4.90.0090.01116.45
7.4.80.0130.00617.45
7.4.70.0120.00816.46
7.4.60.0180.00316.45
7.4.50.0110.00816.41
7.4.40.0080.00916.46
7.4.30.0090.00716.44
7.4.20.0110.00516.49
7.4.10.0100.00716.52
7.4.00.0100.00615.76
7.3.330.0100.00014.81
7.3.320.0060.00414.83
7.3.310.0030.00716.34
7.3.300.0090.00216.31
7.3.290.0050.00516.28
7.3.280.0110.00716.27
7.3.270.0140.00716.52
7.3.260.0100.01016.40
7.3.250.0100.00616.34
7.3.240.0100.00816.45
7.3.230.0110.00616.30
7.3.220.0080.01016.39
7.3.210.0090.00916.37
7.3.200.0180.00516.40
7.3.190.0170.00416.36
7.3.180.0150.00616.37
7.3.170.0150.00316.47
7.3.160.0070.00816.37
7.3.150.0150.00316.39
7.3.140.0120.00816.34
7.3.130.0100.00716.29
7.3.120.0120.00415.89
7.3.110.0120.00815.75
7.3.100.0080.01015.85
7.3.90.0090.00815.81
7.3.80.0080.00915.86
7.3.70.0100.00315.84
7.3.60.0030.01315.85
7.3.50.0080.00815.77
7.3.40.0060.00815.83
7.3.30.0100.00615.83
7.3.20.0050.00717.07
7.3.10.0070.00917.10
7.3.00.0080.00717.04
7.2.340.0110.01116.50
7.2.330.0190.00316.49
7.2.320.0140.00816.38
7.2.310.0160.00616.58
7.2.300.0180.01016.67
7.2.290.0140.00716.54
7.2.280.0200.00316.39
7.2.270.0170.00616.36
7.2.260.0170.00816.55
7.2.250.0150.00716.02
7.2.240.0150.00716.02
7.2.230.0120.00816.08
7.2.220.0090.01115.99
7.2.210.0140.00716.05
7.2.200.0140.00615.98
7.2.190.0150.00616.04
7.2.180.0100.01015.98
7.2.170.0120.01016.03
7.2.160.0180.00616.09
7.2.150.0140.00717.26
7.2.140.0150.00617.20
7.2.130.0160.00717.26
7.2.120.0100.00917.30
7.2.110.0130.00717.35
7.2.100.0160.00517.25
7.2.90.0430.00716.68
7.2.80.0430.00916.54
7.2.70.0510.00516.80
7.2.60.0390.01116.83
7.2.50.0390.00816.66
7.2.40.0360.00516.78
7.2.30.0280.00916.73
7.2.20.0360.01016.72
7.2.10.0350.00816.60
7.2.00.0360.00416.80
7.1.330.0110.00915.91
7.1.320.0100.01016.22
7.1.310.0120.00716.07
7.1.300.0100.00816.14
7.1.290.0150.00416.12
7.1.280.0160.00516.11
7.1.270.0110.00816.17
7.1.260.0260.00716.20
7.1.250.0170.00316.01
7.1.240.0110.00816.05
7.1.230.0120.00716.05
7.1.220.0120.00715.98
7.1.210.0340.00615.55
7.1.200.0410.00215.54
7.1.190.0510.00715.60
7.1.180.0560.01015.49
7.1.170.0560.00515.47
7.1.160.0310.00815.48
7.1.150.0320.00615.42
7.1.140.0430.01115.44
7.1.130.0310.00515.48
7.1.120.0320.00615.55
7.1.110.0280.01015.56
7.1.100.0300.00715.58
7.1.90.0370.00415.54
7.1.80.0280.00715.48
7.1.70.0140.00815.54
7.1.60.0140.01120.04
7.1.50.0140.00920.04
7.1.40.0170.00620.01
7.1.30.0380.00820.05
7.1.20.0260.01019.97
7.1.10.0300.00815.47
7.1.00.0230.00915.60
7.0.330.0110.00615.80
7.0.320.0110.00715.71
7.0.310.0090.00915.78
7.0.300.0150.00515.75
7.0.290.0120.00715.75
7.0.280.0130.00615.79
7.0.270.0150.00615.62
7.0.260.0110.00815.78
7.0.250.0130.00515.89
7.0.240.0170.00415.79
7.0.230.0150.00415.82
7.0.220.0070.00915.81
7.0.210.0100.00715.81
7.0.200.0090.00815.82
7.0.190.0190.00715.84
7.0.180.0140.00615.78
7.0.170.0140.00415.65
7.0.160.0090.00815.79
7.0.150.0110.00715.78
7.0.140.0130.00315.73
7.0.130.0130.00615.76
7.0.120.0100.00815.80
7.0.110.0110.00815.85
7.0.100.0200.00415.75
7.0.90.0110.01015.79
7.0.80.0130.00515.69
7.0.70.0130.00615.70
7.0.60.0150.00515.76
7.0.50.0090.01015.74
7.0.40.0080.01215.02
7.0.30.0100.00815.13
7.0.20.0190.00515.00
7.0.10.0100.00815.04
7.0.00.0100.00714.99
5.6.400.0110.01115.56
5.6.390.0120.00615.53
5.6.380.0130.00715.63
5.6.370.0130.00615.49
5.6.360.0150.00615.52
5.6.350.0120.01015.61
5.6.340.0110.00915.47
5.6.330.0140.00815.58
5.6.320.0130.00615.47
5.6.310.0100.00815.67
5.6.300.0110.00815.50
5.6.290.0140.00715.46
5.6.280.0070.01015.43
5.6.270.0120.00615.52
5.6.260.0120.00715.50
5.6.250.0080.01015.54
5.6.240.0150.00515.55
5.6.230.0110.00715.52
5.6.220.0120.00715.54
5.6.210.0090.01215.46
5.6.200.0090.01115.45
5.6.190.0120.00715.48
5.6.180.0150.00415.61
5.6.170.0090.01015.51
5.6.160.0100.00915.68
5.6.150.0080.01115.60
5.6.140.0150.00515.63
5.6.130.0120.00915.41
5.6.120.0120.00815.52
5.6.110.0130.00615.48
5.6.100.0080.01215.50
5.6.90.0110.01015.54
5.6.80.0120.00715.55
5.6.70.0110.00915.42
5.6.60.0130.00715.49
5.6.50.0130.00915.44
5.6.40.0150.00615.41
5.6.30.0140.00715.38
5.6.20.0150.00615.40
5.6.10.0090.01015.43
5.6.00.0100.00715.42
5.5.380.0100.00316.30
5.5.370.0130.00016.30
5.5.360.0090.00416.30
5.5.350.0100.00316.30
5.5.340.0070.00716.30
5.5.330.0090.00416.30
5.5.320.0130.00016.30
5.5.310.0110.00316.30
5.5.300.0130.00016.30
5.5.290.0030.00916.30
5.5.280.0040.00916.30
5.5.270.0130.00016.30
5.5.260.0080.00416.30
5.5.250.0080.00516.30
5.5.240.0130.00016.30
5.5.230.0080.00416.30
5.5.220.0120.00016.30
5.5.210.0130.00016.30
5.5.200.0120.00016.30
5.5.190.0080.00416.30
5.5.180.0100.00316.30
5.5.170.0090.00316.30
5.5.160.0130.00016.30
5.5.150.0080.00416.30
5.5.140.0110.00416.30
5.5.130.0120.00016.30
5.5.120.0030.00916.30
5.5.110.0100.00316.30
5.5.100.0080.00416.30
5.5.90.0040.00816.30
5.5.80.0120.00016.30
5.5.70.0060.00616.30
5.5.60.0120.00016.30
5.5.50.0060.00616.30
5.5.40.0090.00316.30
5.5.30.0070.00516.30
5.5.20.0060.00616.30
5.5.10.0040.00816.30
5.5.00.0080.00516.30
5.4.450.0080.00316.30
5.4.440.0030.00716.30
5.4.430.0070.00316.30
5.4.420.0100.00016.30
5.4.410.0070.00316.30
5.4.400.0100.00016.30
5.4.390.0050.00516.30
5.4.380.0100.00016.30
5.4.370.0070.00316.30
5.4.360.0060.00616.30
5.4.350.0110.00016.30
5.4.340.0090.00216.30
5.4.330.0080.00416.30
5.4.320.0090.00216.30
5.4.310.0070.00516.30
5.4.300.0090.00216.30
5.4.290.0080.00316.30
5.4.280.0060.00616.30
5.4.270.0090.00216.30
5.4.260.0090.00216.30
5.4.250.0050.00516.30
5.4.240.0070.00316.30
5.4.230.0090.00216.30
5.4.220.0040.00916.30
5.4.210.0000.01016.30
5.4.200.0100.00016.30
5.4.190.0110.00016.30
5.4.180.0080.00416.30
5.4.170.0110.00016.30
5.4.160.0070.00316.30
5.4.150.0070.00316.30
5.4.140.0110.00016.30
5.4.130.0050.00516.30
5.4.120.0080.00316.30
5.4.110.0060.00616.30
5.4.100.0070.00416.30
5.4.90.0080.00216.30
5.4.80.0050.00516.30
5.4.70.0050.00516.30
5.4.60.0070.00316.30
5.4.50.0030.00616.30
5.4.40.0090.00316.30
5.4.30.0030.00716.30
5.4.20.0100.00016.30
5.4.10.0050.00516.30
5.4.00.0100.00016.30
5.3.290.0050.00516.30
5.3.280.0110.00016.30
5.3.270.0080.00216.30
5.3.260.0080.00416.30
5.3.250.0050.00516.30
5.3.240.0070.00316.30
5.3.230.0070.00316.30
5.3.220.0070.00416.30
5.3.210.0110.00016.30
5.3.200.0100.00016.30
5.3.190.0040.00716.30
5.3.180.0110.00016.30
5.3.170.0070.00316.30
5.3.160.0050.00516.30
5.3.150.0070.00416.30
5.3.140.0050.00516.30
5.3.130.0110.00016.30
5.3.120.0040.00816.30
5.3.110.0110.00016.30
5.3.100.0070.00216.30
5.3.90.0100.00016.30
5.3.80.0100.00016.30
5.3.70.0070.00216.30
5.3.60.0100.00016.30
5.3.50.0070.00316.30
5.3.40.0050.00516.30
5.3.30.0060.00316.30
5.3.20.0070.00216.30
5.3.10.0040.00716.30
5.3.00.0110.00016.30
5.2.170.0080.00016.30
5.2.160.0080.00016.30
5.2.150.0040.00416.30
5.2.140.0080.00016.30
5.2.130.0080.00016.30
5.2.120.0070.00216.30
5.2.110.0090.00016.30
5.2.100.0090.00016.30
5.2.90.0060.00316.30
5.2.80.0100.00016.30
5.2.70.0000.00916.30
5.2.60.0060.00316.30
5.2.50.0050.00316.30
5.2.40.0080.00016.30
5.2.30.0080.00016.30
5.2.20.0080.00016.30
5.2.10.0030.00516.30
5.2.00.0040.00416.30
5.1.60.0050.00316.30
5.1.50.0070.00016.30
5.1.40.0040.00216.30
5.1.30.0070.00016.30
5.1.20.0070.00016.30
5.1.10.0040.00416.30
5.1.00.0080.00016.30
5.0.50.0000.00716.30
5.0.40.0000.00616.30
5.0.30.0000.00616.30
5.0.20.0000.00616.30
5.0.10.0040.00216.30
5.0.00.0000.00616.30
4.4.90.0030.00016.30
4.4.80.0030.00016.30
4.4.70.0020.00216.30
4.4.60.0020.00216.30
4.4.50.0030.00016.30
4.4.40.0000.00416.30
4.4.30.0040.00016.30
4.4.20.0010.00316.30
4.4.10.0000.00316.30
4.4.00.0040.00016.30
4.3.110.0000.00416.30
4.3.100.0000.00316.30
4.3.90.0040.00016.30
4.3.80.0020.00216.30
4.3.70.0000.00316.30
4.3.60.0030.00016.30
4.3.50.0030.00016.30
4.3.40.0000.00316.30
4.3.30.0000.00316.30
4.3.20.0000.00316.30
4.3.10.0030.00016.30
4.3.00.0000.00316.30

preferences:
59.18 ms | 401 KiB | 5 Q