On 4/02/11 3:30 PM, Chris Stockton wrote:
Hello,I haven't seen a magic method proposed in a while so I am not sure how people feel about them, obviously adding them can break BC (although it is recommended people should not use __). I'm sure a good amount of use/desire needs to be shown for inclusion. Here is what I decided I would like to have and just implemented: Loader.php: -- class Loader { static public function __compiled() { echo "I was ran at the end of zend_do_end_class_declaration"; } } Run script: <?php include "Loader.php"; Prints: I was ran at the end of zend_do_end_class_declaration At first thought I figured this would be pretty simple to implement, which it is.. for a basic use case. It seems I will need a bit more work to handle issues when you do certain things inside __compiled. If anyone has any interest I would fix it and make a clean patch, so would anyone find this useful?
Do you yourself have any situation where this is useful? Does it solve some problem? Does it enable you to do things better than before? Ben. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
