Re: How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




the question is what is __set() doing, if it's throwing an exception
for undefined properties then obviously it with 'blow up'.



But why should __set() even be called if I'm accessing the property
directly? This seems stupid.

$this->oraclecustomerid =  1122;

should NOT be the same as

$this->set_oraclecustomerid(1122);

The second one I agree should call __set(), but the first one should NOT
be triggering __call() or __set()

Yes it should.

http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members

__set() is run when writing data to inaccessible members.

if it's a protected/private variable, it'll call __set.

If it's a variable that doesn't exist, it'll call __set.

--
Postgresql & php tutorials
http://www.designmagick.com/


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux