[PHP] Looking for some PHP OO programming guides

2009-02-10 Thread Michael Kubler

Hi,
I'm just getting into programming in an Object Oriented fashion, and am 
looking for some guides, tutorials, hints, tips, etc...


I only just found out that you remove the $ from variables when calling 
them from $this-


e.g :
?php
class People
{
private $person = not set;
   function __construct()
   {
*$person* = A person; //This doesn't work (well it creates a 
variable $person that only has the scope of the current function from 
what I can gather)..

$this-*person* = A person; //This works properly
}
   function display_list()
   {
   echo $person; //This doesn't work
 echo $this-person; //This works.
   }
}

$person= new People;
$person-display_list();
?


Instead of painstakingly working out most of the other mistakes I'm 
likely to make, I'd love to read about other peoples issues they had 
with learning OO so I can skip most of the hard stuff, and only make 
small mistakes (hopefully).

--

Michael Kubler
*G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz



Re: [PHP] Looking for some PHP OO programming guides

2009-02-10 Thread Stuart
2009/2/10 Michael Kubler mdk...@gmail.com:
 Hi,
 I'm just getting into programming in an Object Oriented fashion, and am
 looking for some guides, tutorials, hints, tips, etc...

 I only just found out that you remove the $ from variables when calling them
 from $this-

 e.g :
 ?php
 class People
 {
 private $person = not set;
   function __construct()
   {
*$person* = A person; //This doesn't work (well it creates a variable
 $person that only has the scope of the current function from what I can
 gather)..
$this-*person* = A person; //This works properly
}
   function display_list()
   {
   echo $person; //This doesn't work
 echo $this-person; //This works.
   }
 }

 $person= new People;
 $person-display_list();
 ?


 Instead of painstakingly working out most of the other mistakes I'm likely
 to make, I'd love to read about other peoples issues they had with learning
 OO so I can skip most of the hard stuff, and only make small mistakes
 (hopefully).

Ok, because it's you I'm going to offer you this ebook at the very
very very low limited time price of $49 and I'll throw in a free
watermelon.

Ahh, hell, I can't be arsed. It's in the frickin' manual: http://php.net/oop

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php