Just trying to learn PHP. Following the example in the book I study OOP. It describes the creation of a class and an object of this class. Here is the code:
<? php $object = new User; print_r($object); class User { public $name, $password; function save_user() { echo "Текст функции Сэйв_юсер"; } } ?> But when trying to start this code in OpenServer, it gives an error:
Parse error: syntax error, unexpected '$ object' (T_VARIABLE) in D: \ WebServer \ domains \ php.learn \ index.php on line 3
But I wrote off everything from the textbook, why doesn't it work?