3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { private string $p = 'a' { get => 'c'; set => $value; } } $x = new x; $b = $x->f = 'b'; print_r($x->f); print_r($b);
Output for 8.2.32 - 8.2.34, 8.3.0 - 8.3.35
Parse error: syntax error, unexpected token "=>" in /in/bD8OB on line 5
Process exited with code 255.
Output for 8.4.9 - 8.4.26, 8.5.0 - 8.5.11
Deprecated: Creation of dynamic property x::$f is deprecated in /in/bD8OB on line 11 bb

preferences:
39.05 ms | 1155 KiB | 9 Q