|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-20 07:04 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2010-08-20 07:04 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 16:00:01 2025 UTC |
Description: ------------ When i put a direct number or variable in a for block, it works fine, but if i do an equation it fails. Even if it is very simple. Test script: --------------- <?php error_reporting(0); $index = "0"; $a = "0"; $b = "0"; //As you can see variable returns 1. echo ">" . ($a==$b) . "<" . "<br>"; // So... this should go from 1 to 10. // replace "($a==$b)" with 1 and everything works as it should. for ($index=($a==$b); $index<=10; $index++) { // this always prints 1. An endless loop. echo $index . "<br>"; } ?> Expected result: ---------------- >1< 1 2 3 4 5 6 7 8 9 10 Actual result: -------------- >1< 1 1 1 1 1 1 1 1 1 1 1 1 (infinite)