Jump to content

what is -> ?


golem

Recommended Posts

It's used to access things in a class
example:
[code]
class class_name
{
$number=5;
$foo=6;
$bar="hello";

function bar()
{
echo $this->number;
echo $this->foo;
echo $this->bar;
}
}

$thingy=new class_name;

echo $thingy->number; // will output 5
echo $thingy->foo; //will output 6
echo $thingy->bar; //will output 'hello'

$thingy->bar(); will output the same thing as above
[/code]
Link to comment
https://forums.phpfreaks.com/topic/28197-what-is/#findComment-128977
Share on other sites

[quote author=ProjectFear link=topic=116002.msg472476#msg472476 date=1164262621]
i think a mod or something should make a sticky thread because this question has been asked a lot lately.
[/quote]

There is an FAQ thread in the [url=http://=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository]=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository[/url] forum made by me.
Link to comment
https://forums.phpfreaks.com/topic/28197-what-is/#findComment-129211
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.