3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Something { public function __construct(private string $name) {} public function equals(static $something): bool { return $this->name === $something->name; } }
Output for 8.0.1 - 8.0.14, 8.1.0 - 8.1.1
Parse error: syntax error, unexpected token "static", expecting variable in /in/05Nk7 on line 7
Process exited with code 255.
Output for 7.4.0 - 7.4.27
Parse error: syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in /in/05Nk7 on line 5
Process exited with code 255.

preferences:
28.02 ms | 456 KiB | 5 Q