aldutchcms Posted January 27, 2013 Report Posted January 27, 2013 Hi Stefan, Found you in Google. Great! Learning OOP here ! (and having 5 years of PHP experience the old way;) I thought "well this is going well" after wathing the first 4 OOP video's www.killerphp.com/tutorials/object-oriented-php and than..... I lost you in video 5 when you wrote: $stefan = new person(); I am confused about $stefan because you also made the var $name = "Stefan"; I mean... if you would do: $nicole = new person(); (in THAT example) it would still echo Stefan as a result in your example (build objects in PHP part 2 of 3). So why do you give the variable in the index file the name $stefan and not $foo or $too or $whatever ? You use a real persons name for a variable and I think that would never happen in a real script. I did notice, after downloading the Source Files, you changed var $name = "Stefan"; (see video at 06:03) to var $name; Hope you get my confusion. Regards, Arno Quote
falkencreative Posted January 30, 2013 Report Posted January 30, 2013 No one has responded to this yet, so thought I'd leave a quick comment... In regards to "$stefan = new person();" that's just what he happened to name the variable. There's no exact reason for using a person's name, and yes, using a more general name like $name or something similar would make more sense. The exact variable name doesn't change the value that it holds. Quote
administrator Posted February 2, 2013 Report Posted February 2, 2013 Thanks for getting that Ben. Stef Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.