about 7 years ago

Named starting with __ as magical


will be called on each newly-created object


will be called there are no other references to a particular object in any order during the shutdown sequence.


is triggered by calling isset() or empty() on inaccessible properties.


is invoked when unset() is used on inaccessible properties.


is run when writing data to inaccessible properties.


is utilized for reading data from inaccessible properties.


is triggered when invoking inaccessible methods in an object context.


is triggered when invoking inaccessible methods in a static context.


serialize() checks __sleep().

executed prior to any serialization.


unserialize() checks __wakeup().

this function can reconstruct any resources that the object may have.


when it is treated like a string. must return a string


call an object as a function.


be called for classes exported by var


Once the cloning is complete,

if a __clone() method is defined,

then the newly created object's _
clone() method will be called


http://php.net/manual/en/language.oop5.magic.php 石頭閒語 - http://blog.roodo.com/rocksaying/archives/10796767.html

石頭閒語 - http://blog.roodo.com/rocksaying/archives/2683180.html

← [PHP] Equal vs. Identical [MySQL] char vs. varchar →
comments powered by Disqus