|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-15 00:04 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2012-02-15 00:04 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 04:00:02 2025 UTC |
Description: ------------ the script below work as well only if the content of test.php is copied inside the "declare" in main.php instead using "include". Then the Tick system conflicts with include() Test script: --------------- main.php <?php function track_variables ($key) { static $last = ''; if ($last !== $GLOBALS[$key]) { echo "-variable $key changed to{".$GLOBALS[$key]."}-"; } $last = $GLOBALS[$key]; } register_tick_function ('track_variables', 'foo'); declare (ticks=1) { include("test.php"); } ?> test.php <?php $foo = 10; echo "<br>Hi!"; $foo *= $foo; $foo = 'bar'; echo "<br>Gotta run"; echo "<br>Bye!"; ?> Expected result: ---------------- -variable foo changed to{10}- Hi!-variable foo changed to{100}--variable foo changed to{bar}- Gotta run Bye! Actual result: -------------- Hi! Gotta run Bye!-variable foo changed to{bar}-