3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A; use B\D, C\E as F; // function calls function foo() { echo __NAMESPACE__;} namespace B{; class D{{ { function foo() { echo __NAMESPACE__;}} // function calls 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 not found, it tries to autoload class "F" // static methods/namespace functions from another namespace B\foo(); // calls function "foo" from namespace "A\B" B::foo(); // calls method "foo" of class "B" defined in namespace "A" // if class "A\B" not found, it tries to autoload class "A\B" D::foo(); // using import rules, calls method "foo" of class "D" defined in namespace "B" // if class "B\D" not found, it tries to autoload class "B\D" \B\foo(); // calls function "foo" from namespace "B" \B::foo(); // calls method "foo" of class "B" from global scope // if class "B" not found, it tries to autoload class "B" // static methods/namespace functions of current namespace A\B::foo(); // calls method "foo" of class "B" from namespace "A\A" // if class "A\A\B" not found, it tries to autoload class "A\A\B" \A\B::foo(); // calls method "foo" of class "B" from namespace "A" // if class "A\B" not found, it tries to autoload class "A\B" ?>

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.0230.07312.38
5.4.180.0180.04612.38
5.4.170.0350.10712.39
5.4.160.0370.09212.39
5.4.150.0170.04512.39
5.4.140.0170.04412.07
5.4.130.0140.04812.06
5.4.120.0220.03912.01
5.4.110.0130.04412.01
5.4.100.0140.04612.01
5.4.90.0160.04612.01
5.4.80.0170.04212.01
5.4.70.0180.07112.01
5.4.60.0180.04512.00
5.4.50.0210.03612.00
5.4.40.0110.04911.99
5.4.30.0190.04111.99
5.4.20.0140.04311.98
5.4.10.0200.04611.98
5.4.00.0180.04511.48
5.3.270.0250.07012.72
5.3.260.0190.04412.72
5.3.250.0140.05012.72
5.3.240.0190.04412.72
5.3.230.0180.04912.71
5.3.220.0170.04612.68
5.3.210.0190.04312.68
5.3.200.0160.05212.68
5.3.190.0170.04612.68
5.3.180.0170.04412.67
5.3.170.0160.05112.67
5.3.160.0150.04712.67
5.3.150.0180.04112.67
5.3.140.0140.04612.66
5.3.130.0160.04512.66
5.3.120.0440.07912.66
5.3.110.0170.04612.66
5.3.100.0160.04712.12
5.3.90.0180.04412.09
5.3.80.0160.04712.09
5.3.70.0180.04412.09
5.3.60.0100.05012.06
5.3.50.0150.05412.02
5.3.40.0160.04512.02
5.3.30.0140.04411.99
5.3.20.0110.04911.77
5.3.10.0140.04311.72
5.3.00.0160.04111.71

preferences:
140.55 ms | 1386 KiB | 7 Q