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() { eval('$time = date("' . $this->format . '", strtotime("' . $this->prediction . '"));'); return isset($time) ? $time : 'Something went terribly wrong'; } } $format = "r"; $timeModel = new TimeModel($format); echo $timeModel->getTime(); ?>
Output for git.master
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Creation of dynamic property TimeModel::$format is deprecated in /in/7S4GO on line 6 Deprecated: Creation of dynamic property TimeModel::$prediction is deprecated in /in/7S4GO on line 9 Thu, 23 Mar 2023 09:06:55 +0100
Output for git.master_jit
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/7S4GO on line 9 Deprecated: Creation of dynamic property TimeModel::$format is deprecated in /in/7S4GO on line 6 Deprecated: Creation of dynamic property TimeModel::$prediction is deprecated in /in/7S4GO on line 9 Mon, 20 Mar 2023 03:04:30 +0100

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.09 ms | 402 KiB | 7 Q