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.4.9 - 8.4.24, 8.5.7 - 8.5.9
Deprecated: Creation of dynamic property x::$f is deprecated in /in/bD8OB on line 11 bb
Output for 8.2.32, 8.3.5 - 8.3.33
Parse error: syntax error, unexpected token "=>" in /in/bD8OB on line 5
Process exited with code 255.

preferences:
49.89 ms | 526 KiB | 4 Q