php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31557 -- doesn't initialize global variable
Submitted: 2005-01-14 19:31 UTC Modified: 2005-01-14 21:43 UTC
From: tim at tenkan dot org Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.10 OS: debian linux
Private report: No CVE-ID: None
 [2005-01-14 19:31 UTC] tim at tenkan dot org
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 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-14 21:43 UTC] tony2001@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See #20548.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 17:01:34 2024 UTC