Smartest question EVER

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Smartest question EVER

Post by violet »

Um, I was wondering what this means:

Code: Select all

->
I've seen

Code: Select all

$this->
and I am not quite sure what

Code: Select all

->
means...
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

I forgot the name, but it's what you use to access members of a object.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

it's called an object dereferencer I believe (thanks feyd!)

http://us.php.net/manual/en/language.oop5.php
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Good grief, this question has been asked like four times in the last week.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

feyd wrote:Good grief, this question has been asked like four times in the last week.
Hehe, I think I asked once before.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

superdezign wrote:
feyd wrote:Good grief, this question has been asked like four times in the last week.
Hehe, I think I asked once before.
I think everyone has at one point or another :lol:
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

it's a difficult thing to search for, you have to admit
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The Ninja Space Goat wrote:it's a difficult thing to search for, you have to admit
True, it's unfortunate, although with a mild amount of playing with PHP, you can get it to tell you what it is:

Code: Select all

[feyd@home]>php4 -n -r "->"

Parse error: parse error, unexpected T_OBJECT_OPERATOR in Command line code on line 1
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

It's the idea of instant gratification. Spend ten minutes futzing around with PHP and possibly realizing that those constants actually mean something and then going to check it out, or posting on DevNetwork and getting an answer in a minute with no work at all.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Ambush Commander wrote:It's the idea of instant gratification. Spend ten minutes futzing around with PHP and possibly realizing that those constants actually mean something and then going to check it out, or posting on DevNetwork and getting an answer in a minute with no work at all.
That sums up the majority of the posts we get here. :P

Then, they quickly find that we start asking them questions rather than answering them.
Z3RO21
Forum Contributor
Posts: 130
Joined: Thu Aug 17, 2006 8:59 am

Post by Z3RO21 »

superdezign wrote:Then, they quickly find that we start asking them questions rather than answering them.
Hopefully they realize it is to their benefit that we work with them to solve a problem rather then just bluntly giving them the answer.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Z3RO21 wrote:
superdezign wrote:Then, they quickly find that we start asking them questions rather than answering them.
Hopefully they realize it is to their benefit that we work with them to solve a problem rather then just bluntly giving them the answer.
I can think of a select few who don't. :roll:
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

feyd wrote:Good grief, this question has been asked like four times in the last week.
I have not heard anyone say or use the term "good Grief" in a looooong time...

Maybe Garfield or an old Batman episode, with Burt Ward or Adam West...

Pow...Poof...Bang...Bop!!! :P
User avatar
idevlin
Forum Commoner
Posts: 78
Joined: Tue Jun 26, 2007 1:10 pm
Location: Cambridge, UK

Post by idevlin »

superdezign wrote:Then, they quickly find that we start asking them questions rather than answering them.
As a newbie here, I was going to say, the best way for said people to learn is to ask them questions. That way they formalise logically in their head what they're trying to achieve and in doing so quite often think "hang on..." and figure it out for themselves.

How many times have you done that at work when trying to explain a problem to a colleague and they don't even say anything and you realise that you've done something daft? :D

I also find myself looking at something for ages, having no idea what's up, posting the problem on some forums or sending an email to my team and then figuring out what's wrong 2 seconds after clicking "post" or "send" :D
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Some time back I was performing training for a particular system. Before the training I had some time spare. As a result I was able to create a new training course rather than use the "company official" one. Ok not always a good idea but the original course was designed to be run be "trainers" rather than a developer. The main difference between my course and the original was the fact that rather than simple "do this to create this" exercises it was more along the lines of create this and you can find out how to get it to work by doing this.. The whole scheme of the training was not only on the simple steps to create something but how to find out the answers when it doesn't work. In my opinion this "finding of information" is probably the most important thing in programming and the Web is an ideal place to look for PHP be it forums or articles. The trouble is always finding out how to get the information and what "question" you need to ask. Forums are particularly useful as they enable human interaction rather than trying to guess "key words" if you don't know the name of the thing you are asking for.
Post Reply