note 117797 added to control-structures.goto
| From: | JonathanKim | Date: | Tue, 11 Aug 2015 21:24:10 +0000 |
| Subject: | note 117797 added to control-structures.goto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203310@lists.php.net to get a copy of this message | ||
I am using GOTO in my ajax php file.
This ajax returns warning, "Cannot use a scalar value as an array", when I don't
declare array before using it, so I did.
However, if execution takes route of GOTO, I still get the same warning message, as if the array
declaration is unset.
Working around, I had to adjust my code to ensure that
1. no data is stored to the array before the last GOTO appears
2. use a variable to verify if GOTO was executed
3. conditionally declare array variable again after GOTO anchor.
Google did not find anything about it.
I wonder if anyone else has the same experience.
Jonathan Kim
----
Server IP: 72.52.91.14
Probable Submitter: 96.88.180.177
----
Manual Page -- http://php.net/manual/en/control-structures.goto.php
Edit -- https://master.php.net/note/edit/117797
Del: integrated -- https://master.php.net/note/delete/117797/integrated
Del: useless -- https://master.php.net/note/delete/117797/useless
Del: bad code -- https://master.php.net/note/delete/117797/bad+code
Del: spam -- https://master.php.net/note/delete/117797/spam
Del: non-english -- https://master.php.net/note/delete/117797/non-english
Del: in docs -- https://master.php.net/note/delete/117797/in+docs
Del: other reasons-- https://master.php.net/note/delete/117797
Reject -- https://master.php.net/note/reject/117797
Search -- https://master.php.net/manage/user-notes.php