3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo; protected $bar; protected $baz; } class FooSelfHydratingProxy extends Foo { /** zero-argument constructor since this is just a helper class for hydration */ public function __construct() { } /** * the `Foo` typehint is not part of the interface - here only for the sake of readability/clearness */ public function hydrate($data, Foo $object) { $object->foo = $data['foo']; $object->bar = $data['bar']; $object->baz = $data['baz']; } /** * the `Foo` typehint is not part of the interface - here only for the sake of readability/clearness */ public function extract(Foo $object) { return array('foo' => $object->foo, 'bar' => $object->bar, 'baz' => $object->baz); } } $data = array('foo' => 1, 'bar' => 2, 'baz' => 3) $hydrator = new FooSelfHydratingProxy(); $hydrated = new Foo(); $hydrator->hydrate(array('foo' => 1, 'bar' => 2, 'baz' => 3), $hydrated); 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)
5.4.200.0140.05612.40
5.4.190.0190.06712.39
5.4.180.0140.05912.39
5.4.170.0100.04312.40
5.4.160.0090.04712.39
5.4.150.0140.04712.39
5.4.140.0100.05012.08
5.4.130.0130.05212.06
5.4.120.0130.04812.03
5.4.110.0190.04712.03
5.4.100.0130.05312.03
5.4.90.0150.04912.03
5.4.80.0190.07312.03
5.4.70.0130.04912.02
5.4.60.0380.08712.02
5.4.50.0290.07412.02
5.4.40.0290.06512.01
5.4.30.0140.04512.01
5.4.20.0300.06512.00
5.4.10.0130.04812.01
5.4.00.0130.04511.50
5.3.270.0260.08212.72
5.3.260.0120.04612.72
5.3.250.0110.04912.72
5.3.240.0140.05012.72
5.3.230.0250.07212.71
5.3.220.0170.04612.68
5.3.210.0200.04712.68
5.3.200.0110.05212.68
5.3.190.0250.06912.68
5.3.180.0130.04712.67
5.3.170.0190.05912.67
5.3.160.0160.04512.68
5.3.150.0260.06512.67
5.3.140.0210.07012.66
5.3.130.0140.04712.66
5.3.120.0150.04312.66
5.3.110.0150.04212.65
5.3.100.0150.04512.13
5.3.90.0110.04312.10
5.3.80.0120.04312.09
5.3.70.0140.04712.09
5.3.60.0120.04912.08
5.3.50.0130.04612.02
5.3.40.0110.05312.02
5.3.30.0190.07211.98
5.3.20.0110.04911.77
5.3.10.0130.04511.73
5.3.00.0180.04211.72

preferences:
139.58 ms | 1394 KiB | 7 Q