View Single Post
Old 11-12-2012, 03:56 PM   PM User | #3
BluePanther
Senior Coder

 
Join Date: Jul 2011
Posts: 1,226
Thanks: 3
Thanked 171 Times in 171 Posts
BluePanther is on a distinguished road
Right. Had a look, and there's a very valid reason why you won't be able to get .a, but retrieve .b.

The self keyword passes the class object into the initiation function. So, to assign a property to the class you need to use self.property name.

In other words, using a on it's own keeps it in the function scope, but using self.a assigns a property to the class object.
__________________
Useful function to retrieve difference in times
The best PHP resource
A good PHP FAQ
PLEASE remember to wrap your code in [PHP] tags.
PHP Code:
// Replace this
if(isset($_POST['submitButton']))
// With this
if(!empty($_POST))
// Then check for values/forms. Some IE versions don't send the submit button 
Quote:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
BluePanther is offline   Reply With Quote