3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Example { private int $_nextNumber; public int $nextNumber { get { $this->_nextNumber ??= 0; return $this->_nextNumber++; } } } $foo = new Example; var_dump($foo->nextNumber, $foo->nextNumber, $foo->nextNumber); $foo->nextNumber = 42;
Output for 8.3.5
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/cAfAI on line 5
Process exited with code 255.

preferences:
46.54 ms | 493 KiB | 3 Q