3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo; protected $bar; protected $baz; } $aHydrator = function(array $data) { $this->a = $data['a']; $this->b = $data['b']; $this->c = $data['c']; } $data = array('foo' => 1, 'bar' => 2, 'baz' => 3); $hydrated = new Foo(); $data = array('a' => 1, 'b' => 2, 'c' => 3); $a = new A(); ($aHydrator->bindTo($a, $a))($data); var_dump($hydrated);

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.0200.08320.07
7.0.10.0030.08720.25
7.0.00.0030.08720.02
5.6.170.0300.08320.55
5.6.160.0070.08720.48
5.6.150.0030.05018.15
5.6.140.0070.06718.11
5.6.130.0000.04718.13
5.6.120.0030.04721.02
5.6.110.0070.08321.02
5.6.100.0000.04321.00
5.6.90.0130.06321.04
5.6.80.0000.07320.38
5.5.310.0270.07720.32
5.5.300.0130.07017.92
5.5.290.0130.04718.05
5.5.280.0100.07320.89
5.5.270.0130.05720.80
5.5.260.0230.06020.68
5.5.250.0130.08020.70
5.5.240.4300.03720.36

preferences:
142.2 ms | 1394 KiB | 7 Q