|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-02 12:53 UTC] thomas at ecommerce dot com
[2005-09-02 12:54 UTC] thomas at ecommerce dot com
[2005-09-02 16:15 UTC] sniper@php.net
[2005-09-02 16:27 UTC] thomas at ecommerce dot com
[2005-09-02 16:39 UTC] sniper@php.net
[2005-09-02 16:48 UTC] thomas at ecommerce dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 19:00:02 2025 UTC |
Description: ------------ When trying to call the register_shutdown_function() inside class like this: register_shutdown_function(array(&$this, "_log")); and the method _log() is a private method it don't work. We assign $this here to the function so register_shutdown_function() should be allowed to call a private function inside of the class or at least throw allready here an error message when this function is called and _log() is a private function. Its also not documented that this wouldn't work.... Reproduce code: --------------- <?php final class TestClass { public function TestClass() { echo "Class init call!\n"; $this->_init(); } private function _init() { echo "Registrering shutdown function..\n"; //-- register log function register_shutdown_function(array(&$this, "_log")); echo "done\n"; } private function _log() { //-- send mail mail("thomas@ecommerce.com", "subject", "content"); } } echo "Script start! Init Class.\n"; $TestClass = new TestClass(); echo "Class inited!\n"; Expected result: ---------------- email will be send to thomas@ecommerce.com when script is done. Actual result: -------------- Script will not call the shutdown function