3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(ticks=1) function tick_handler() { echo "tick_handler() called\n"; } 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*tick_handler()/ new D(); tick_handler(); echo __NAMESPACE__; 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).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.190.0140.04112.38
5.4.180.0140.04012.38
5.4.170.0160.04812.39
5.4.160.0140.04112.38
5.4.150.0130.04312.38
5.4.140.0170.04812.07
5.4.130.0200.05512.05
5.4.120.0120.04212.01
5.4.110.0130.04112.01
5.4.100.0190.05612.01
5.4.90.0100.04412.01
5.4.80.0130.05112.01
5.4.70.0110.04112.01
5.4.60.0140.04212.01
5.4.50.0190.05612.01
5.4.40.0140.04912.00
5.4.30.0190.06611.99
5.4.20.0130.04111.99
5.4.10.0140.04311.99
5.4.00.0120.04111.48
5.3.270.0190.04912.72
5.3.260.0150.04212.72
5.3.250.0120.04312.72
5.3.240.0120.04312.72
5.3.230.0210.05612.71
5.3.220.0130.04312.68
5.3.210.0140.04312.68
5.3.200.0180.04912.68
5.3.190.0210.05612.68
5.3.180.0150.04112.67
5.3.170.0130.04312.67
5.3.160.0250.05512.67
5.3.150.0160.04712.67
5.3.140.0170.04412.66
5.3.130.0210.05612.66
5.3.120.0150.04212.66
5.3.110.0170.04512.66
5.3.100.0150.05212.12
5.3.90.0140.04212.08
5.3.80.0210.05612.08
5.3.70.0160.04412.08
5.3.60.0190.06112.07
5.3.50.0150.04412.00
5.3.40.0140.04512.00
5.3.30.0130.04111.95
5.3.20.0140.04011.73
5.3.10.0140.04211.70
5.3.00.0150.04211.68

preferences:
136.01 ms | 1386 KiB | 7 Q