note 69360 added to ref.pcntl
| From: | codeslinger at compsalot dot com | Date: | Sat, 02 Sep 2006 02:10:14 +0000 |
| Subject: | note 69360 added to ref.pcntl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116603@lists.php.net to get a copy of this message | ||
A Warning about undocumented behavior of declare(ticks=1); -- Functions must come first.
I took a program that was working and did a substantial rewrite and code reorg. After I was done
the program wouldn't run. It kept complaining about undefined functions. After 5 hours of
head banging. I finally managed to isolate what specifically had broken my program and then found
the following bug entry:
http://bugs.php.net/bug.php?id=20924
The problem is that declare(ticks=1); modifies the compilation behavior of php and it introduces an
undocumented constraint.
When ticks are enabled, you MUST define all of your functions prior to using them. I am spoiled by
the ease of forward references and usually prefer to put my functions at the end of the program.
But when using ticks you can not do this, the functions must come before the code that calls them.
----
Server IP: 66.163.161.117
Probable Submitter: 63.226.247.49
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.pcntl.php
Edit -- https://master.php.net/note/edit/69360
Del: integrated -- https://master.php.net/note/delete/69360/integrated
Del: useless -- https://master.php.net/note/delete/69360/useless
Del: bad code -- https://master.php.net/note/delete/69360/bad+code
Del: spam -- https://master.php.net/note/delete/69360/spam
Del: non-english -- https://master.php.net/note/delete/69360/non-english
Del: in docs -- https://master.php.net/note/delete/69360/in+docs
Del: other reasons-- https://master.php.net/note/delete/69360
Reject -- https://master.php.net/note/reject/69360
Search -- https://master.php.net/manage/user-notes.php