Professional Web Applications Themes

#40608 [NEW]: break within foreach causes strange behaviour - PHP Bugs

From: eric dot broersma at phil dot uu dot nl Operating system: Sun Solaris PHP version: 5.2.1 PHP Bug Type: Arrays related Bug description: break within foreach causes strange behaviour Description: ------------ A break within a foreach construct may cause an infinite loop when the foreach construct is nested within another foreach construct, possibly as a result of the internal array pointer of the array being foreach'ed not being reset. This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1. Reproduce code: --------------- $w = array ( 0, 1 ); echo 'a'; foreach ( $w as ...

  1. #1

    Default #40608 [NEW]: break within foreach causes strange behaviour

    From: eric dot broersma at phil dot uu dot nl
    Operating system: Sun Solaris
    PHP version: 5.2.1
    PHP Bug Type: Arrays related
    Bug description: break within foreach causes strange behaviour

    Description:
    ------------
    A break within a foreach construct may cause an infinite loop when the
    foreach construct is nested within another foreach construct, possibly as
    a result of the internal array pointer of the array being foreach'ed not
    being reset.

    This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

    Reproduce code:
    ---------------
    $w = array ( 0, 1 );

    echo 'a';
    foreach ( $w as $x ) {
    echo 'b' . $x;
    foreach ( $w as $z ) {
    echo 'c' . $z;
    break 1;
    }
    echo 'e' . $x;
    }
    echo 'f';

    Expected result:
    ----------------
    ab0c0e0b1c0e1f


    (Behaviour in PHP 5.0.5)

    Actual result:
    --------------
    ab0c0e0b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c 0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e 2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b 1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c 0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e 1b2c0e2b1c0e1b2c0e2b1c0e1b2c0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e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
    (infinite loop)

    (Behaviour in PHP 5.2.1)

    --
    Edit bug report at [url]http://bugs.php.net/?id=40608&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40608&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40608&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40608&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40608&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40608&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40608&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40608&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40608&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40608&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40608&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40608&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40608&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40608&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40608&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40608&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40608&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40608&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40608&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40608&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40608&r=mysqlcfg[/url]
    eric dot broersma at phil dot uu dot nl Guest

  2. #2

    Default #40608 [Opn->Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: [email]tony2001php.net[/email]
    Reported By: eric dot broersma at phil dot uu dot nl
    -Status: Open
    +Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    Cannot reproduce.
    Make sure you don't have any zend_extension's like ionCube, Zend
    Optimizer, APC, eAccelerator etc.


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

    [2007-02-23 16:49:12] eric dot broersma at phil dot uu dot nl

    Description:
    ------------
    A break within a foreach construct may cause an infinite loop when the
    foreach construct is nested within another foreach construct, possibly
    as a result of the internal array pointer of the array being foreach'ed
    not being reset.

    This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

    Reproduce code:
    ---------------
    $w = array ( 0, 1 );

    echo 'a';
    foreach ( $w as $x ) {
    echo 'b' . $x;
    foreach ( $w as $z ) {
    echo 'c' . $z;
    break 1;
    }
    echo 'e' . $x;
    }
    echo 'f';

    Expected result:
    ----------------
    ab0c0e0b1c0e1f


    (Behaviour in PHP 5.0.5)

    Actual result:
    --------------
    ab0c0e0b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c 0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e 2b1c0e1b2c0e2b1c0e1b2c0e2b1c0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e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
    (infinite loop)

    (Behaviour in PHP 5.2.1)


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40608&edit=1[/url]
    tony2001@php.net Guest

  3. #3

    Default #40608 [NoF->Opn]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    -Status: No Feedback
    +Status: Open
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    I am experiencing this problem using PHP v5.2.1, exactly as described,
    whereas it works as described in v5.2.0.

    I am running a vanilla compilation of PHP 5.2.0 (./configure, make,
    make install) with no compiler options added. I'm running it on WinXP
    via Cygwin. I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.0, where PhpDoentor's code has a function
    containing an inner foreach (inside an outer foreach) that is returning
    explicitly to the caller. This function is being called from inside a
    foreach in the main code. The array that is being iterated through in
    the caller's foreach is being passed to the function, and in the
    function that same array is being iterated through by the inner foreach.
    This also results in an infinite loop. What I see happening is that
    the array counter in the innermost foreach is reaching the end and then
    inexplicably jumping back to "3".

    During discussion on the bug file against PhpDoentor (PEAR #10289),
    this particular PHP code change was discovered and considered a possible
    culprit:
    http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?annotate=1.647.2.27.2.26#l3791


    It was considered suspect due to the explicit subtraction of "3", too
    much of a coincidence with the behavior seen in PhpDoentor.

    Just to help rule out PhpDoentor code itself, please realize that
    the same PhpDoc code runs fine on all PHP versions prior to v5.2.1 that
    I tested it on (5.2.0, 5.1.6, 4.4.6, 4.4.5, 4.4.4, 4.4.2).

    Since this was "closed" due to no feedback, rather than being a
    duplicate or actually fixed, I'm reopening it so the PHP developers can
    revisit it based on my additional info.


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

    [2007-03-03 01:00:00] php-bugs at lists dot php dot net

    No feedback was provided for this bug for over a week, so it is
    being suspended automatically. If you are able to provide the
    information that was originally requested, please do so and change
    the status of the bug back to "Open".

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

    [2007-02-23 20:56:28] net

    Cannot reproduce.
    Make sure you don't have any zend_extension's like ionCube, Zend
    Optimizer, APC, eAccelerator etc.

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

    [2007-02-23 16:49:12] eric dot broersma at phil dot uu dot nl

    Description:
    ------------
    A break within a foreach construct may cause an infinite loop when the
    foreach construct is nested within another foreach construct, possibly
    as a result of the internal array pointer of the array being foreach'ed
    not being reset.

    This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

    Reproduce code:
    ---------------
    $w = array ( 0, 1 );

    echo 'a';
    foreach ( $w as $x ) {
    echo 'b' . $x;
    foreach ( $w as $z ) {
    echo 'c' . $z;
    break 1;
    }
    echo 'e' . $x;
    }
    echo 'f';

    Expected result:
    ----------------
    ab0c0e0b1c0e1f


    (Behaviour in PHP 5.0.5)

    Actual result:
    --------------
    ab0c0e0b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c 0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0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0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
    (infinite loop)

    (Behaviour in PHP 5.2.1)


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


    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  4. #4

    Default #40608 [Opn]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Open
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    That was supposed to read:

    "I am running a vanilla compilation of PHP 5.2.1"

    "I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.1"


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

    [2007-03-19 18:47:25] net

    I am experiencing this problem using PHP v5.2.1, exactly as described,
    whereas it works as described in v5.2.0.

    I am running a vanilla compilation of PHP 5.2.0 (./configure, make,
    make install) with no compiler options added. I'm running it on WinXP
    via Cygwin. I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.0, where PhpDoentor's code has a function
    containing an inner foreach (inside an outer foreach) that is returning
    explicitly to the caller. This function is being called from inside a
    foreach in the main code. The array that is being iterated through in
    the caller's foreach is being passed to the function, and in the
    function that same array is being iterated through by the inner foreach.
    This also results in an infinite loop. What I see happening is that
    the array counter in the innermost foreach is reaching the end and then
    inexplicably jumping back to "3".

    During discussion on the bug file against PhpDoentor (PEAR #10289),
    this particular PHP code change was discovered and considered a possible
    culprit:
    http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?annotate=1.647.2.27.2.26#l3791


    It was considered suspect due to the explicit subtraction of "3", too
    much of a coincidence with the behavior seen in PhpDoentor.

    Just to help rule out PhpDoentor code itself, please realize that
    the same PhpDoc code runs fine on all PHP versions prior to v5.2.1 that
    I tested it on (5.2.0, 5.1.6, 4.4.6, 4.4.5, 4.4.4, 4.4.2).

    Since this was "closed" due to no feedback, rather than being a
    duplicate or actually fixed, I'm reopening it so the PHP developers can
    revisit it based on my additional info.

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

    [2007-03-03 01:00:00] php-bugs at lists dot php dot net

    No feedback was provided for this bug for over a week, so it is
    being suspended automatically. If you are able to provide the
    information that was originally requested, please do so and change
    the status of the bug back to "Open".

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

    [2007-02-23 20:56:28] net

    Cannot reproduce.
    Make sure you don't have any zend_extension's like ionCube, Zend
    Optimizer, APC, eAccelerator etc.

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

    [2007-02-23 16:49:12] eric dot broersma at phil dot uu dot nl

    Description:
    ------------
    A break within a foreach construct may cause an infinite loop when the
    foreach construct is nested within another foreach construct, possibly
    as a result of the internal array pointer of the array being foreach'ed
    not being reset.

    This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

    Reproduce code:
    ---------------
    $w = array ( 0, 1 );

    echo 'a';
    foreach ( $w as $x ) {
    echo 'b' . $x;
    foreach ( $w as $z ) {
    echo 'c' . $z;
    break 1;
    }
    echo 'e' . $x;
    }
    echo 'f';

    Expected result:
    ----------------
    ab0c0e0b1c0e1f


    (Behaviour in PHP 5.0.5)

    Actual result:
    --------------
    ab0c0e0b1c0e1b2c0e2b1c0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e2b1c0e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
    (infinite loop)

    (Behaviour in PHP 5.2.1)


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


    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  5. #5

    Default #40608 [Opn->Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    -Status: Open
    +Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    We would gladly revisit it, but your reproduce code works perfectly
    fine on Linux i386, Linux x86, Linux PPC, Solaris/SPARC, AIX/PPC and
    MacOS.


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

    [2007-03-19 18:51:05] net

    That was supposed to read:

    "I am running a vanilla compilation of PHP 5.2.1"

    "I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.1"

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

    [2007-03-19 18:47:25] net

    I am experiencing this problem using PHP v5.2.1, exactly as described,
    whereas it works as described in v5.2.0.

    I am running a vanilla compilation of PHP 5.2.0 (./configure, make,
    make install) with no compiler options added. I'm running it on WinXP
    via Cygwin. I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.0, where PhpDoentor's code has a function
    containing an inner foreach (inside an outer foreach) that is returning
    explicitly to the caller. This function is being called from inside a
    foreach in the main code. The array that is being iterated through in
    the caller's foreach is being passed to the function, and in the
    function that same array is being iterated through by the inner foreach.
    This also results in an infinite loop. What I see happening is that
    the array counter in the innermost foreach is reaching the end and then
    inexplicably jumping back to "3".

    During discussion on the bug file against PhpDoentor (PEAR #10289),
    this particular PHP code change was discovered and considered a possible
    culprit:
    http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?annotate=1.647.2.27.2.26#l3791


    It was considered suspect due to the explicit subtraction of "3", too
    much of a coincidence with the behavior seen in PhpDoentor.

    Just to help rule out PhpDoentor code itself, please realize that
    the same PhpDoc code runs fine on all PHP versions prior to v5.2.1 that
    I tested it on (5.2.0, 5.1.6, 4.4.6, 4.4.5, 4.4.4, 4.4.2).

    Since this was "closed" due to no feedback, rather than being a
    duplicate or actually fixed, I'm reopening it so the PHP developers can
    revisit it based on my additional info.

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

    [2007-03-03 01:00:00] php-bugs at lists dot php dot net

    No feedback was provided for this bug for over a week, so it is
    being suspended automatically. If you are able to provide the
    information that was originally requested, please do so and change
    the status of the bug back to "Open".

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

    [2007-02-23 20:56:28] net

    Cannot reproduce.
    Make sure you don't have any zend_extension's like ionCube, Zend
    Optimizer, APC, eAccelerator etc.

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

    [2007-02-23 16:49:12] eric dot broersma at phil dot uu dot nl

    Description:
    ------------
    A break within a foreach construct may cause an infinite loop when the
    foreach construct is nested within another foreach construct, possibly
    as a result of the internal array pointer of the array being foreach'ed
    not being reset.

    This problem did not occur in PHP 5.0.5, but did occur in PHP 5.2.1.

    Reproduce code:
    ---------------
    $w = array ( 0, 1 );

    echo 'a';
    foreach ( $w as $x ) {
    echo 'b' . $x;
    foreach ( $w as $z ) {
    echo 'c' . $z;
    break 1;
    }
    echo 'e' . $x;
    }
    echo 'f';

    Expected result:
    ----------------
    ab0c0e0b1c0e1f


    (Behaviour in PHP 5.0.5)

    Actual result:
    --------------
    ab0c0e0b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c 0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e 2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b 1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c 0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e 1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c 0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e 2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b 1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c 0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e 1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c 0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e 2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b 1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c 0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e 1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b 2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0!
    e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2 b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1 c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0 e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1 b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2 c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b2c0 e2b1c0e1b2c0e2b1c0e1b2c0e2b1c0e1b...
    (infinite loop)

    (Behaviour in PHP 5.2.1)


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


    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    tony2001@php.net Guest

  6. #6

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    Do I need to open a separate bug to have this looked at on Windows?


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

    [2007-03-19 19:01:37] net

    We would gladly revisit it, but your reproduce code works perfectly
    fine on Linux i386, Linux x86, Linux PPC, Solaris/SPARC, AIX/PPC and
    MacOS.

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

    [2007-03-19 18:51:05] net

    That was supposed to read:

    "I am running a vanilla compilation of PHP 5.2.1"

    "I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.1"

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

    [2007-03-19 18:47:25] net

    I am experiencing this problem using PHP v5.2.1, exactly as described,
    whereas it works as described in v5.2.0.

    I am running a vanilla compilation of PHP 5.2.0 (./configure, make,
    make install) with no compiler options added. I'm running it on WinXP
    via Cygwin. I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.0, where PhpDoentor's code has a function
    containing an inner foreach (inside an outer foreach) that is returning
    explicitly to the caller. This function is being called from inside a
    foreach in the main code. The array that is being iterated through in
    the caller's foreach is being passed to the function, and in the
    function that same array is being iterated through by the inner foreach.
    This also results in an infinite loop. What I see happening is that
    the array counter in the innermost foreach is reaching the end and then
    inexplicably jumping back to "3".

    During discussion on the bug file against PhpDoentor (PEAR #10289),
    this particular PHP code change was discovered and considered a possible
    culprit:
    http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?annotate=1.647.2.27.2.26#l3791


    It was considered suspect due to the explicit subtraction of "3", too
    much of a coincidence with the behavior seen in PhpDoentor.

    Just to help rule out PhpDoentor code itself, please realize that
    the same PhpDoc code runs fine on all PHP versions prior to v5.2.1 that
    I tested it on (5.2.0, 5.1.6, 4.4.6, 4.4.5, 4.4.4, 4.4.2).

    Since this was "closed" due to no feedback, rather than being a
    duplicate or actually fixed, I'm reopening it so the PHP developers can
    revisit it based on my additional info.

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

    [2007-03-03 01:00:00] php-bugs at lists dot php dot net

    No feedback was provided for this bug for over a week, so it is
    being suspended automatically. If you are able to provide the
    information that was originally requested, please do so and change
    the status of the bug back to "Open".

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

    [2007-02-23 20:56:28] net

    Cannot reproduce.
    Make sure you don't have any zend_extension's like ionCube, Zend
    Optimizer, APC, eAccelerator etc.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  7. #7

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    No.


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

    [2007-03-19 19:20:13] net

    Do I need to open a separate bug to have this looked at on Windows?

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

    [2007-03-19 19:01:37] net

    We would gladly revisit it, but your reproduce code works perfectly
    fine on Linux i386, Linux x86, Linux PPC, Solaris/SPARC, AIX/PPC and
    MacOS.

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

    [2007-03-19 18:51:05] net

    That was supposed to read:

    "I am running a vanilla compilation of PHP 5.2.1"

    "I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.1"

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

    [2007-03-19 18:47:25] net

    I am experiencing this problem using PHP v5.2.1, exactly as described,
    whereas it works as described in v5.2.0.

    I am running a vanilla compilation of PHP 5.2.0 (./configure, make,
    make install) with no compiler options added. I'm running it on WinXP
    via Cygwin. I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.0, where PhpDoentor's code has a function
    containing an inner foreach (inside an outer foreach) that is returning
    explicitly to the caller. This function is being called from inside a
    foreach in the main code. The array that is being iterated through in
    the caller's foreach is being passed to the function, and in the
    function that same array is being iterated through by the inner foreach.
    This also results in an infinite loop. What I see happening is that
    the array counter in the innermost foreach is reaching the end and then
    inexplicably jumping back to "3".

    During discussion on the bug file against PhpDoentor (PEAR #10289),
    this particular PHP code change was discovered and considered a possible
    culprit:
    http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?annotate=1.647.2.27.2.26#l3791


    It was considered suspect due to the explicit subtraction of "3", too
    much of a coincidence with the behavior seen in PhpDoentor.

    Just to help rule out PhpDoentor code itself, please realize that
    the same PhpDoc code runs fine on all PHP versions prior to v5.2.1 that
    I tested it on (5.2.0, 5.1.6, 4.4.6, 4.4.5, 4.4.4, 4.4.2).

    Since this was "closed" due to no feedback, rather than being a
    duplicate or actually fixed, I'm reopening it so the PHP developers can
    revisit it based on my additional info.

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

    [2007-03-03 01:00:00] php-bugs at lists dot php dot net

    No feedback was provided for this bug for over a week, so it is
    being suspended automatically. If you are able to provide the
    information that was originally requested, please do so and change
    the status of the bug back to "Open".

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

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

    tony2001@php.net Guest

  8. #8

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    It's not necessary to compile 5.2.1 from source to test this on
    Windows. You can use the 5.2.1 zip file available at php.net. That's
    what I had installed first, encountered this problem, then compiled from
    source to see if the problem remained.


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

    [2007-03-19 19:22:58] net

    No.

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

    [2007-03-19 19:20:13] net

    Do I need to open a separate bug to have this looked at on Windows?

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

    [2007-03-19 19:01:37] net

    We would gladly revisit it, but your reproduce code works perfectly
    fine on Linux i386, Linux x86, Linux PPC, Solaris/SPARC, AIX/PPC and
    MacOS.

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

    [2007-03-19 18:51:05] net

    That was supposed to read:

    "I am running a vanilla compilation of PHP 5.2.1"

    "I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.1"

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

    [2007-03-19 18:47:25] net

    I am experiencing this problem using PHP v5.2.1, exactly as described,
    whereas it works as described in v5.2.0.

    I am running a vanilla compilation of PHP 5.2.0 (./configure, make,
    make install) with no compiler options added. I'm running it on WinXP
    via Cygwin. I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.0, where PhpDoentor's code has a function
    containing an inner foreach (inside an outer foreach) that is returning
    explicitly to the caller. This function is being called from inside a
    foreach in the main code. The array that is being iterated through in
    the caller's foreach is being passed to the function, and in the
    function that same array is being iterated through by the inner foreach.
    This also results in an infinite loop. What I see happening is that
    the array counter in the innermost foreach is reaching the end and then
    inexplicably jumping back to "3".

    During discussion on the bug file against PhpDoentor (PEAR #10289),
    this particular PHP code change was discovered and considered a possible
    culprit:
    http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?annotate=1.647.2.27.2.26#l3791


    It was considered suspect due to the explicit subtraction of "3", too
    much of a coincidence with the behavior seen in PhpDoentor.

    Just to help rule out PhpDoentor code itself, please realize that
    the same PhpDoc code runs fine on all PHP versions prior to v5.2.1 that
    I tested it on (5.2.0, 5.1.6, 4.4.6, 4.4.5, 4.4.4, 4.4.2).

    Since this was "closed" due to no feedback, rather than being a
    duplicate or actually fixed, I'm reopening it so the PHP developers can
    revisit it based on my additional info.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  9. #9

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    I don't have a Windows machine handy at the moment (not mentioning MSVC
    and other tools required to get something useful on Windows).


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

    [2007-03-19 19:34:17] net

    It's not necessary to compile 5.2.1 from source to test this on
    Windows. You can use the 5.2.1 zip file available at php.net. That's
    what I had installed first, encountered this problem, then compiled from
    source to see if the problem remained.

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

    [2007-03-19 19:22:58] net

    No.

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

    [2007-03-19 19:20:13] net

    Do I need to open a separate bug to have this looked at on Windows?

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

    [2007-03-19 19:01:37] net

    We would gladly revisit it, but your reproduce code works perfectly
    fine on Linux i386, Linux x86, Linux PPC, Solaris/SPARC, AIX/PPC and
    MacOS.

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

    [2007-03-19 18:51:05] net

    That was supposed to read:

    "I am running a vanilla compilation of PHP 5.2.1"

    "I first encountered the issue while running PhpDoentor
    v1.3.1 on PHP v5.2.1"

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    tony2001@php.net Guest

  10. #10

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.


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

    [2007-03-19 19:52:07] net

    I don't have a Windows machine handy at the moment (not mentioning MSVC
    and other tools required to get something useful on Windows).

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

    [2007-03-19 19:34:17] net

    It's not necessary to compile 5.2.1 from source to test this on
    Windows. You can use the 5.2.1 zip file available at php.net. That's
    what I had installed first, encountered this problem, then compiled from
    source to see if the problem remained.

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

    [2007-03-19 19:22:58] net

    No.

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

    [2007-03-19 19:20:13] net

    Do I need to open a separate bug to have this looked at on Windows?

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

    [2007-03-19 19:01:37] net

    We would gladly revisit it, but your reproduce code works perfectly
    fine on Linux i386, Linux x86, Linux PPC, Solaris/SPARC, AIX/PPC and
    MacOS.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  11. #11

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip




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

    [2007-03-19 19:55:06] net

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.

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

    [2007-03-19 19:52:07] net

    I don't have a Windows machine handy at the moment (not mentioning MSVC
    and other tools required to get something useful on Windows).

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

    [2007-03-19 19:34:17] net

    It's not necessary to compile 5.2.1 from source to test this on
    Windows. You can use the 5.2.1 zip file available at php.net. That's
    what I had installed first, encountered this problem, then compiled from
    source to see if the problem remained.

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

    [2007-03-19 19:22:58] net

    No.

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

    [2007-03-19 19:20:13] net

    Do I need to open a separate bug to have this looked at on Windows?

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  12. #12

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    Are you asking yourself to try fresh snapshot?
    Or did you click wrong link?


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

    [2007-03-19 20:40:35] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip



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

    [2007-03-19 19:55:06] net

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.

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

    [2007-03-19 19:52:07] net

    I don't have a Windows machine handy at the moment (not mentioning MSVC
    and other tools required to get something useful on Windows).

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

    [2007-03-19 19:34:17] net

    It's not necessary to compile 5.2.1 from source to test this on
    Windows. You can use the 5.2.1 zip file available at php.net. That's
    what I had installed first, encountered this problem, then compiled from
    source to see if the problem remained.

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

    [2007-03-19 19:22:58] net

    No.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    tony2001@php.net Guest

  13. #13

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    My bad... pretending to be a dev myself there, by selecting the "Quick
    Fix" option to "notify" the original bug submitter (and all readers)
    about the snapshot option.


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

    [2007-03-19 20:48:54] net

    Are you asking yourself to try fresh snapshot?
    Or did you click wrong link?

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

    [2007-03-19 20:40:35] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip



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

    [2007-03-19 19:55:06] net

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.

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

    [2007-03-19 19:52:07] net

    I don't have a Windows machine handy at the moment (not mentioning MSVC
    and other tools required to get something useful on Windows).

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

    [2007-03-19 19:34:17] net

    It's not necessary to compile 5.2.1 from source to test this on
    Windows. You can use the 5.2.1 zip file available at php.net. That's
    what I had installed first, encountered this problem, then compiled from
    source to see if the problem remained.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  14. #14

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    I wasn't feeling spunky enough to mark the bug "closed", though...
    figured I'd better leave that to the real PHP devs...


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

    [2007-03-20 16:35:58] net

    My bad... pretending to be a dev myself there, by selecting the "Quick
    Fix" option to "notify" the original bug submitter (and all readers)
    about the snapshot option.

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

    [2007-03-19 20:48:54] net

    Are you asking yourself to try fresh snapshot?
    Or did you click wrong link?

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

    [2007-03-19 20:40:35] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip



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

    [2007-03-19 19:55:06] net

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.

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

    [2007-03-19 19:52:07] net

    I don't have a Windows machine handy at the moment (not mentioning MSVC
    and other tools required to get something useful on Windows).

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    ashnazg@php.net Guest

  15. #15

    Default #40608 [Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1
    New Comment:

    I cannot reproduce this on Gentoo with 5.2.1


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

    [2007-03-20 16:40:30] net

    I wasn't feeling spunky enough to mark the bug "closed", though...
    figured I'd better leave that to the real PHP devs...

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

    [2007-03-20 16:35:58] net

    My bad... pretending to be a dev myself there, by selecting the "Quick
    Fix" option to "notify" the original bug submitter (and all readers)
    about the snapshot option.

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

    [2007-03-19 20:48:54] net

    Are you asking yourself to try fresh snapshot?
    Or did you click wrong link?

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

    [2007-03-19 20:40:35] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip



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

    [2007-03-19 19:55:06] net

    Tested this example against the 5.2 snapshot
    (php5.2-win32-200703191630.zip) from php.net, and it works properly.
    So, looks like it has been fixed on the 5.2 branch after 5.2.1 was
    released.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    cweiske@php.net Guest

  16. #16

    Default #40608 [Fbk->Opn]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    -Status: Feedback
    +Status: Open
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1


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

    [2007-03-23 07:53:12] net

    I cannot reproduce this on Gentoo with 5.2.1

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

    [2007-03-20 16:40:30] net

    I wasn't feeling spunky enough to mark the bug "closed", though...
    figured I'd better leave that to the real PHP devs...

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

    [2007-03-20 16:35:58] net

    My bad... pretending to be a dev myself there, by selecting the "Quick
    Fix" option to "notify" the original bug submitter (and all readers)
    about the snapshot option.

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

    [2007-03-19 20:48:54] net

    Are you asking yourself to try fresh snapshot?
    Or did you click wrong link?

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

    [2007-03-19 20:40:35] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip



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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    cweiske@php.net Guest

  17. #17

    Default #40608 [Opn->Fbk]: break within foreach causes strange behaviour

    ID: 40608
    Updated by: net
    Reported By: eric dot broersma at phil dot uu dot nl
    -Status: Open
    +Status: Feedback
    Bug Type: Arrays related
    Operating System: Sun Solaris
    PHP Version: 5.2.1


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

    [2007-03-23 07:53:12] net

    I cannot reproduce this on Gentoo with 5.2.1

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

    [2007-03-20 16:40:30] net

    I wasn't feeling spunky enough to mark the bug "closed", though...
    figured I'd better leave that to the real PHP devs...

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

    [2007-03-20 16:35:58] net

    My bad... pretending to be a dev myself there, by selecting the "Quick
    Fix" option to "notify" the original bug submitter (and all readers)
    about the snapshot option.

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

    [2007-03-19 20:48:54] net

    Are you asking yourself to try fresh snapshot?
    Or did you click wrong link?

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

    [2007-03-19 20:40:35] net

    Please try using this CVS snapshot:

    http://snaps.php.net/php5.2-latest.tar.gz

    For Windows:

    http://snaps.php.net/win32/php5.2-win32-latest.zip



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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://bugs.php.net/40608

    --
    Edit this bug report at http://bugs.php.net/?id=40608&edit=1
    cweiske@php.net Guest

Similar Threads

  1. #40768 [NEW]: nested foreach break -- infinite loop - serious
    By rave235 at gmail dot com in forum PHP Bugs
    Replies: 3
    Last Post: March 19th, 07:56 PM
  2. strange SQL behaviour
    By platho in forum IBM DB2
    Replies: 1
    Last Post: September 6th, 04:05 PM
  3. Very strange behaviour
    By Mark in forum AIX
    Replies: 0
    Last Post: September 1st, 04:19 PM
  4. Strange CLI behaviour
    By Frank Passek in forum PHP Development
    Replies: 0
    Last Post: August 10th, 07:45 PM
  5. strange foreach behaviour
    By Martin Peck in forum PHP Development
    Replies: 2
    Last Post: August 5th, 02:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139