3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $x; public function __construct($x) { $this->x = $x; } public function printX() { var_dump($this->x); return $this; } } $test = (new Test("Hello"))->printX(); var_dump($test);

preferences:
39.48 ms | 402 KiB | 5 Q