3v4l.org

run code in 300+ PHP versions simultaneously
<?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();

preferences:
53.11 ms | 402 KiB | 5 Q