|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-05 08:52 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 16:00:01 2025 UTC |
Description: ------------ the object's method was called as 'call back' function Reproduce code: --------------- <?php class hello { var $me; function hello() { $this->me = 1; register_shutdown_function(array(&$this, 'show')); } function show() { echo $this->me . "\n"; } function add() { $this->me++; } } $h = new hello; $h->add(); echo "real value: "; $h->show(); echo "cb value: "; ?> Expected result: ---------------- real value: 2 cb value: 2 Actual result: -------------- real value: 2 cb value: 1