3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); class A{ protected $stuff; function __construct(int $foo){ $this->stuff = $foo; } function getStuff(): int{ return $this->stuff; } } $x = new A(10); eval('$y = ' . var_export($x, true)); $y->getStuff();
based on gfXIC
Output for 7.0.0 - 7.2.0
Parse error: syntax error, unexpected end of file in /in/ULEnW(14) : eval()'d code on line 3
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/ULEnW on line 1 Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/ULEnW on line 8
Process exited with code 255.