3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { static $p = "some property"; } echo test::$p; final class valueobject { private $prop; function __construct() { $this->prop = test::p; } function getProp(){ return $this->prop; } } $vo = new valueobject; var_dump($vo); echo $vo->getProp(),"\n";

preferences:
64.21 ms | 402 KiB | 5 Q