3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Protocol { public function setProtocolId($id) {return $this;} public function setCreationDate($id) {return $this;} public function setFleet($fleet) { return $this;} } class Fleet {} $data = array('status_date' => 'abc'); map($data); function map(Array $data) { @if (isset($data['protocol_id'])) { $data = array($data); } $protocols = array(); try { foreach ($data as $_data) { $protocol = new Protocol(); $protocol->setProtocolId($_data['protocol_id']) ->setCreationDate(new DateTime($_data['creation_date'], new DateTimeZone('UTC'))); if (!empty($_data['fleet_id'])) { $protocol->setFleet(new Fleet($_data['fleet_id'])); } $protocols[] = $protocol; } } catch (Exception $e) { echo $e; throw new Exception('Error when trying to map result into Protocol object'); } }

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.290.0230.10312.52
5.4.280.0120.08512.41
5.4.270.0200.09012.41
5.4.260.0080.05312.41
5.4.250.0060.05512.41
5.4.240.0040.04412.41
5.4.230.0070.03912.40
5.4.220.0080.05112.41
5.4.210.0110.04712.41
5.4.200.0130.04812.40
5.4.190.0070.05312.40
5.4.180.0090.05412.40
5.4.170.0070.05212.41
5.4.160.0080.04912.41
5.4.150.0060.04712.40
5.4.140.0040.04012.09
5.4.130.0080.03512.07
5.4.120.0040.03612.04
5.4.110.0050.03812.04
5.4.100.0040.04512.04
5.4.90.0090.03612.03
5.4.80.0070.04912.04
5.4.70.0030.03712.03
5.4.60.0030.03712.03
5.4.50.0050.04012.03
5.4.40.0080.04012.02
5.4.30.0070.03712.02
5.4.20.0090.03712.01
5.4.10.0060.04312.02
5.4.00.0120.07711.51
5.3.280.0060.05312.71
5.3.270.0090.05412.73
5.3.260.0080.06612.72
5.3.250.0110.05012.72
5.3.240.0060.04812.72
5.3.230.0150.04912.71
5.3.220.0100.04112.68
5.3.210.0060.04612.68
5.3.200.0080.03812.68
5.3.190.0050.04112.68
5.3.180.0060.03712.68
5.3.170.0070.03512.67
5.3.160.0070.04212.68
5.3.150.0060.04112.67
5.3.140.0050.04112.66
5.3.130.0050.04312.66
5.3.120.0080.03912.66
5.3.110.0070.03812.66
5.3.100.0070.03612.13
5.3.90.0060.03812.11
5.3.80.0030.04112.10
5.3.70.0060.05212.10
5.3.60.0090.03712.09
5.3.50.0040.03812.03
5.3.40.0070.03512.02
5.3.30.0070.03711.99
5.3.20.0050.03611.77
5.3.10.0070.04011.73
5.3.00.0070.03511.73

preferences:
137.64 ms | 1398 KiB | 7 Q