I have a class look like below:
<?php
class theGodFather {
public function do() {
echo "the movie is nice";
}
}
$obj = new theGodFather;
echo $theGodFather->do;
When run I got the error: syntax error, unexpected T_DO, expecting T_STRING in /Applications/XAMPP/xamppfiles/htdocs/test/classes.php on line 3
what could I possibly did wrong?
You cannot use keywords as names for functions/classes/methods and constants,
dois one. You can use them as variable names, however.