WOW! Now that _is_ cool. I figures as much that it creates an object.
The "->" is what PHP uses in oop. Saaaa-wweeeeeet!
Thanks all!
-Wes
Wayne wrote:[color=blue]
> On 11 Feb 2005 09:15:55 -0800,
gmac63@charter.net wrote:
>
>[color=green]
> >You can "echo $CFG->dbtype;" and get "mysql"
> >
> >This isn't calling functions from an object, rather seems to be
> >applying properties to a new "object"??? There is no $something =[/color][/color]
new[color=blue][color=green]
> >ClassName, so This is what I figure.[/color]
>
> If you use a variable as an object PHP automatically creates an[/color]
object[color=blue]
> (I believe this behavior is depreciated in PHP5). There's an[/color]
implicit[color=blue]
> "$something = new stdClass;" if you use a variable as an object.
>[color=green]
> >This
> >seems like a realy good way to apply a number of atttribs to a
> >"variable" without having to create an array -- unless that is a
> >shorthand way of creating an array...[/color]
>
> Yeah, I use this all the time. It works with any class...
>
> class SomeClass()
> {
> }
>
> $test = new SomeClass();
> $test->newVar = 'hello';
>
> echo $test->newVar; // prints 'hello';[/color]