3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new CatchMeIfYouCan(); var_dump($foo->bar); final class CatchMeIfYouCan { private int $_bar; private(set) int $bar { get => $this->_bar ??= $this->fooBar(); set { $this->_bar = $value; } } public function fooBar(): int { isset($this->_bar); return 42; } }
Output for 8.4.6
int(42)

preferences:
162.11 ms | 1002 KiB | 7 Q