3v4l.org

run code in 300+ PHP versions simultaneously
<?php // File "load.php". namespace Foo\Bar { class load { static public function arithmetic() { require_once __DIR__ . '/arithmetic.php'; } } } // File "arithmetic.php". namespace Foo\Bar\Functions { function add($a, $b) { return $a + $b; } const add = 'Foo\Bar\Functions\add'; } // User app. namespace Some\App { use Foo\Bar\load; use Foo\Bar\Functions as f; load::arithmetic(); <-- commented out only for this demo (cause we have no real file) echo f\add(5, 6) . "\n"; // 11 $callable = f\add; echo $callable(5, 6); // 11 }

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)
5.6.80.0100.07720.37
5.5.240.0070.07320.19
5.4.400.1030.05018.73
5.4.390.1030.05318.77
5.4.380.1070.05018.48
5.4.370.1200.06018.74
5.4.360.0930.05318.70
5.4.350.0830.05718.54
5.4.340.1100.06318.79
5.4.320.0930.05018.73
5.4.310.0870.05718.57
5.4.300.1070.05018.74
5.4.290.1100.05718.70
5.4.280.0830.06318.76
5.4.270.0900.08018.74
5.4.260.0830.07718.61
5.4.250.0270.06318.75
5.4.240.0330.06018.47
5.4.230.0200.05718.77
5.4.220.0270.05018.79
5.4.210.0270.04718.55
5.4.200.0300.05016.60
5.4.190.0230.05718.59
5.4.180.0270.07718.79
5.4.170.0300.05018.71
5.4.160.0200.05318.74
5.4.150.0300.05018.74
5.4.140.0170.07016.29
5.4.130.0270.05016.20
5.4.120.0370.04716.25
5.4.110.0370.04716.34
5.4.100.0400.05716.27
5.4.90.0370.04316.23
5.4.80.0500.04716.25
5.4.70.0230.05316.28
5.4.60.0370.04716.32
5.4.50.0330.04716.16
5.4.40.0370.06716.26
5.4.30.0270.05016.38
5.4.20.0270.05316.25
5.4.10.0430.05716.23
5.4.00.0330.06015.78
5.3.290.0330.07014.88
5.3.280.0300.06014.80
5.3.270.0370.06714.85
5.3.260.0370.04014.81
5.3.250.0100.05314.79
5.3.240.0500.07014.59
5.3.230.1070.07714.60
5.3.220.0930.05314.67
5.3.210.1070.05014.58
5.3.200.0830.06314.62
5.3.190.0870.06014.68
5.3.180.0970.05014.66
5.3.170.1000.06014.62
5.3.160.1000.06714.59
5.3.150.1100.05314.61
5.3.140.1130.07314.69
5.3.130.1000.06314.68
5.3.120.1000.04714.57
5.3.110.0900.05714.59
5.3.100.1270.06314.09
5.3.90.1100.06714.05
5.3.80.1130.06314.02
5.3.70.1200.06714.07
5.3.60.0630.06314.13
5.3.50.1030.04314.01
5.3.40.1100.05014.04
5.3.30.1030.06714.07
5.3.20.1070.05313.92
5.3.10.1000.04713.71
5.3.00.0870.04013.63
5.2.170.0770.04711.29
5.2.160.0800.03711.12
5.2.150.0900.04011.20
5.2.140.0830.05011.29
5.2.130.0870.04311.08
5.2.120.0870.04311.09
5.2.110.0730.05011.13
5.2.100.0830.03711.05
5.2.90.0930.05311.27
5.2.80.0970.06311.13
5.2.70.0970.05011.17
5.2.60.1030.06011.08
5.2.50.0870.06711.05
5.2.40.0800.06010.97
5.2.30.0930.03311.11
5.2.20.0470.04010.90
5.2.10.0500.05010.96
5.2.00.0500.03710.71
5.1.60.0470.04010.01
5.1.50.0570.0379.95
5.1.40.0470.03710.00
5.1.30.0430.05010.30
5.1.20.0570.04010.38
5.1.10.0430.04310.14
5.1.00.0470.04310.08
5.0.50.0370.0238.52
5.0.40.0370.0238.46
5.0.30.0330.0438.24
5.0.20.0300.0338.32
5.0.10.0430.0308.20
5.0.00.0300.0408.29
4.4.90.0300.0235.88
4.4.80.0230.0235.91
4.4.70.0330.0235.86
4.4.60.0130.0275.86
4.4.50.0270.0235.90
4.4.40.0330.0375.82
4.4.30.0300.0205.89
4.4.20.0270.0205.88
4.4.10.0300.0205.98
4.4.00.0270.0375.90
4.3.110.0230.0235.86
4.3.100.0400.0175.83
4.3.90.0230.0175.87
4.3.80.0270.0375.80
4.3.70.0370.0275.83
4.3.60.0370.0275.79
4.3.50.0370.0235.80
4.3.40.0370.0335.88
4.3.30.0130.0204.56
4.3.20.0100.0234.52
4.3.10.0200.0234.46
4.3.00.0030.0207.32

preferences:
143.26 ms | 1394 KiB | 7 Q