Differences in code

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
eddy05
New php-forum User
New php-forum User
Posts: 10
Joined: Tue Mar 04, 2003 6:46 pm
Location: Singapore
Contact:

Differences in code

Postby eddy05 » Thu Mar 13, 2003 7:38 pm

What are the differences between:

Object("Something");
Object["Something");
Object->Something;
Object=>Something;

I've seen these in php.net but not fully sure what is it.

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Thu Mar 13, 2003 8:00 pm

Object("Something");

This will call a function called Object and will put the variable "Something" in it.


$Object["Something"];

This will get the contents of the array Object from its child "Something".


$Object->Something;

This will call the class $Object and will get the contents of the variable $Something in it.


Object => Something;

Syntax for defining array child Object to equal Something.

User avatar
eddy05
New php-forum User
New php-forum User
Posts: 10
Joined: Tue Mar 04, 2003 6:46 pm
Location: Singapore
Contact:

Postby eddy05 » Thu Mar 13, 2003 11:32 pm

THANKS! It was very useful. Got it into my head :)

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Fri Mar 14, 2003 12:21 pm

No problem, I'm glad to help :)


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest