3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php final class Time { private $hours, $minutes; public function __construct($hours, $minutes) { $this->hours = (int) $hours; $this->minutes = (int) $minutes; } public static function fromString($time) { list($hours, $minutes) = explode($time, ':', 2); return new static($hours, $minutes); } public static function fromString($time) { list($hours, $minutes) = explode($time, ':', 2); return new self($hours, $minutes); } } var_dump(Time::fromString('10:45')); var_dump(Time::fromString2('10:45'));
Output for 5.3.0 - 5.4.29
Fatal error: Cannot redeclare Time::fromString() in /in/DtSed on line 19
Process exited with code 255.