3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mimicking($obj, $exec){ return (function() use($exec){ return $exec(); })->bindTo($obj, $obj)() } class A{ protected $stuff = 10; function test(){ return new class($this){ function __construct(A $s){ $this->s = $s; } function asd(){ return mimicking($this->s, function(){ return $this->s->stuff; }); } }; } } $x = new A; echo $x->test()->asd();

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.0230.03720.23
7.0.10.0100.08320.16
7.0.00.0100.08720.30
5.6.170.0200.04020.52
5.6.160.0070.04020.39
5.6.150.0030.04718.14
5.6.140.0000.08718.15
5.6.130.0070.05318.16
5.6.120.0130.07721.01
5.6.110.0070.08021.01
5.6.100.0130.07321.02
5.6.90.0270.05720.97
5.6.80.0070.08720.52
5.5.310.0230.04020.31
5.5.300.0170.07017.92
5.5.290.0100.07718.07
5.5.280.0000.05020.69
5.5.270.0000.05320.77
5.5.260.0070.08320.88
5.5.250.0070.08320.59
5.5.240.0030.06320.28

preferences:
145.18 ms | 1394 KiB | 7 Q