A: 

The second one is calling a method of an instantiated object.

What this means, is that somewhere there is

$user = new User() // It may not necessarily be named user
alex
the question was edited so you can understand me better
DomingoSL
A: 

When you use the "->" operator you dealing with a method or property of an object. Do you have the $user object/class defined?

John
the question was edited so you can understand me better
DomingoSL
+1  A: 

Start the file with <?php not just <?. In WAMP short_open_tag is not enabled in php.ini by default.

stormdrain
It works. Can you explain me the difference?
DomingoSL
There is a setting file called php.ini where a variable `short_open_tag` is set. In WAMP this is disabled by default. It is good practice to always use `<?php` instead of `<?` as sometimes (like in this case) it's not enabled, and it's only 3 extra letters :)
stormdrain
you can also set it up to use other programming styles if you are comfortable with those. But it is not recommended.
John