3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { static $b = 0; public function __construct() { $this->b = 'hot dogs'; } public function getB() { return $this->$b; } } $a = new A; var_dump($a->getB());

preferences:
36.32 ms | 402 KiB | 5 Q