|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-14 21:43 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 19:00:01 2025 UTC |
Description: ------------ if you use -- on a variable inside a loop in global scope, it doesn't initialize the variable. ++ does. Reproduce code: --------------- <?php while ($aglobal < 10) { $aglobal++; $j--; $another = $j; } print "aglobal $aglobal, j $j, another $another\n"; ?> Expected result: ---------------- aglobal 10, j -10, another -10 Actual result: -------------- aglobal 10, j , another