Jump to content

In Video Lesson Five I Lost You


aldutchcms

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...