Reply to Basic PHP4 Class question

Your name:

Reply:


Posted by Aggelos on 12/20/06 16:25

Hello,
if i have the folowing class:

class person {
var $name;
var $surname;
var $flag;
function person($name=NULL,$surname=NULL) {
$this->name = $name;
$this->surname = $surname;
$this->flag = 1;
}
function displayPerson($person) {
print_r($person);
}
}

I can do the folowing without instantiating the class :
$person = new person('Fred','Jones');
person::displayPerson($person);

is there anyway to access the $flag variable in the contructor without
having to do $person = new person() ?

Something like echo person::$flag; ? <------- I know that this is not
right. I am just asking if there is something simmilar tha I can do.

Thank you,
Angelos.
Is there anyway

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация