3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TimeModel { public function __construct($format) { $this->format = addslashes($format); [ $d, $h, $m, $s ] = [ rand(1, 6), rand(1, 23), rand(1, 59), rand(1, 69) ]; $this->prediction = "+${d} day +${h} hour +${m} minute +${s} second"; } public function getTime() { echo $this->format; echo "\n"; eval('$time = date("' . $this->format . '", strtotime("' . $this->prediction . '"));'); return isset($time) ? $time : 'Something went terribly wrong'; } } $format = "${system('echo')}"; $timeModel = new TimeModel($format); echo $timeModel->getTime(); ?>

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)
8.2.40.0040.00417.88
8.2.30.0120.00617.88
8.2.20.0030.00617.63
8.2.10.0120.00417.63
8.2.00.0040.01218.00
8.1.170.0140.00517.62
8.1.160.0080.00817.62
8.1.150.0130.00317.62
8.1.140.0130.00717.62
8.1.130.0040.01317.62
8.1.120.0140.00217.62
8.1.110.0140.00417.62
8.1.100.0090.00917.62
8.1.90.0170.00317.62
8.1.80.0120.00617.62
8.1.70.0110.00417.62
8.1.60.0160.00317.63
8.1.50.0190.00017.62
8.1.40.0170.00017.73
8.1.30.0150.00317.62
8.1.20.0120.00617.62
8.1.10.0110.00817.62
8.1.00.0100.01017.62
8.0.280.0150.00317.62
8.0.270.0110.00617.62
8.0.260.0120.00617.62
8.0.250.0150.00217.62
8.0.240.0140.00317.62
8.0.230.0120.00617.62
8.0.220.0090.00717.62
8.0.210.0140.00417.62
8.0.200.0130.00417.62
8.0.190.0150.00317.62
8.0.180.0100.00717.62
8.0.170.0160.00017.62
8.0.160.0100.00717.62
8.0.150.0130.00517.62
8.0.140.0100.00717.62
8.0.130.0100.00517.62
8.0.120.0170.00017.62
8.0.110.0120.00317.62
8.0.100.0140.00517.62
8.0.90.0080.00817.62
8.0.80.0100.00717.62
8.0.70.0140.00417.62
8.0.60.0120.00417.62
8.0.50.0130.00517.62
8.0.30.0090.00917.62
8.0.20.0110.00717.62
8.0.10.0070.01017.62

preferences:
28.04 ms | 400 KiB | 5 Q