i mean, specifically, the "->"?

i don't see that in PHP documentation, nor anyplace in the drupal documentation i can find.

it's not exactly easy to search the forums on that string ;)

thanks,
--derek

Comments

ezheidtmann’s picture

It's an element access syntax also used by Perl. See the docs:

http://www.php.net/manual/en/language.oop.php

gauravb’s picture

$user->uid is the user id of the user represented by the $user object. Note that $user is also a global variable so

global $user;
print $user->uid

will print the uid of the currently logged in user.

ezheidtmann’s picture

Both PHP and Perl use the -> syntax for accessing object elements and functions. It is also used in C++ when you have a pointer to an object rather than the object itself.

Mr Maggoo’s picture

It means 'inside'. so the uid var is inside the 'user' var.

gordon’s picture

Close. to be more precise, "->" means property y in object x, eg x->y

See Objects and classes (php4)
--
Gordon Heydon
Heydon Consulting

--
Gordon Heydon

philosophe’s picture

i appreciate the responses. This is the information i needed.

-- derek