3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function foo() { echo "success!" . get_class($this) . \n"; } public function test() { $this->foo(); static::foo(); } } class B extends A { /* foo() will be copied to B, hence its scope will still be A and * the call be successful */ } class C extends A { private function foo() { /* original method is replaced; the scope of the new one is C */ } } $b = new B(); $b->test(); $c = new C(); $c->test(); //fails

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)
7.0.20.0170.04320.25
7.0.10.0100.08720.09
7.0.00.0030.09020.25
5.6.170.0370.06320.55
5.6.160.0030.07020.39
5.6.150.0130.07718.29
5.6.140.0100.05718.28
5.6.130.0100.04718.15
5.6.120.0000.04721.00
5.6.110.0100.07721.01
5.6.100.0030.09021.09
5.6.90.0000.05021.08
5.6.80.0070.05320.51
5.5.310.0400.04320.30
5.5.300.0070.03718.03
5.5.290.0000.04717.98
5.5.280.0070.08320.66
5.5.270.0070.07020.84
5.5.260.0170.07320.96
5.5.250.0030.08720.80
5.5.240.3970.04020.29

preferences:
139.66 ms | 1394 KiB | 7 Q