3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php final class EmptyWarning { public function __construct() { } public function message(): string { return ''; } public function __toString(): string { return $this->message(); } public function __isset($a) { var_dump('ss'); return false; } } $a = new EmptyWarning(); var_dump($a); var_dump(empty($a));
based on vf1le
Output for hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0beta1
object(EmptyWarning)#1 (0) { } bool(false)
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/cIM1L on line 11
Process exited with code 255.