3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class User{ private string $email; private string $password; Private $errors = []; public function __construct(int $id, string $email, string $password){ $this->id = $id; $this->email = $email; $this->password = $password; } public function validateEmail($email){ if(!filter_var($this->email, FILTER_VALIDATE_EMAIL){ $errors = ['email' -> "falsche email"]; return false; } else { return true; } } } ?>
Output for 8.4.1 - 8.4.17, 8.5.0 - 8.5.2
Parse error: syntax error, unexpected token "{" in /in/7NOpe on line 16
Process exited with code 255.
Output for 8.3.0 - 8.3.30
Parse error: syntax error, unexpected double-quoted string "falsche email", expecting identifier or variable or "{" or "$" in /in/7NOpe on line 17
Process exited with code 255.

preferences:
151.23 ms | 1306 KiB | 6 Q