ID:               25699
 User updated by:  richy at smilingsouls dot net
 Reported By:      richy at smilingsouls dot net
-Status:           Open
+Status:           Closed
 Bug Type:         *Programming Data Structures
 Operating System: Windows XP Home
 PHP Version:      4.3.3
 New Comment:

I figured out that the condition wasn't ever being met.


Previous Comments:
------------------------------------------------------------------------

[2003-09-30 02:18:23] richy at smilingsouls dot net

Description:
------------
I have tried several variations of trying to use a for loop from within
a foreach.  In no case did the for loop execute.

I have no idea if this is simply not allowed, or a bug.  But it has
frustrated me enough to report it!

This works neither on my home dev. server (Xitami, Windows XP, PHP
4.3.3 R4) or on my remote ISP which sports some flavor of Unix.  See
server config at http://www.smilingsouls.net/phpinfo.php



Reproduce code:
---------------
function foo()
{
        $foo[1] = 'test1';
        $foo[2] = 'test2';      
                        
        foreach($foo as $key => $value)
        {
        
                for($d = 0; $d == 10; $d++) {echo $d;}
                                        
        }
                        
}

function foo2()
{
        $foo[1] = 'test1';
        $foo[2] = 'test2';      
                        
        foreach($foo as $key => $value)
        {
        
                loop_it();
                                        
        }
                        
}
                
function loop_it()
{
        for($d = 0; $d == 10; $d++) {echo $d;}                  
}
                
$foo[1] = 'test1';
$foo[2] = 'test2';
                        
foreach($foo as $key => $value)
{
                        
        loop_it();
                                        
}

Expected result:
----------------
each should output:
012345678910
012345678910



Actual result:
--------------
blank, nothing!


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25699&edit=1

Reply via email to