This may seem like a stupid question, but what is -> and what does it do? i see it in many pre-written scripts however have never come accross it in a tuorial. im hoping someone could she a light.
benevolent001
6:21 pm on Mar 8, 2007 (gmt 0)
Are you pointing to comments sort of thing?
cameraman
7:15 pm on Mar 8, 2007 (gmt 0)
It's used to access member functions and variables of a class: class foo { var $a; function bar() { echo "bar"; } // end bar() } // end class
$object = new foo(); $object2 = new foo();
$object -> bar(); // executes the function, outputs 'bar' $object -> a = "hi "; $object2 -> a = "there";
If my memory serves me correctly, I believe it's called the arrow membership operator. :)
phranque
1:02 am on Mar 9, 2007 (gmt 0)
the arrow operator is actually an infix dereference operator. generally the left side is a reference or something could be made into a reference and the right side is some method of addressing a resource in that reference.