Re: BC problem

From: Date: Thu, 29 Nov 2001 11:16:02 +0000
Subject: Re: BC problem
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-71998@lists.php.net to get a copy of this message
Can you verify that this problem is gone in the latest CVS of PHP_4_0_7 (make sure you update the Zend directory)

Zeev

At 20:05 28/11/2001, Markus Fischer wrote:
    A small example which shows that BC seems to be broken for a
    certain (but not uncommon) case:
    cat include_me.php
    <?
        if (!defined('I_AM_INCLUDED')) {
                define('I_AM_INCLUDED', 1);
        } else {
                echo "returning<br>\n";
                return;
        }
        function cant_be_redefined() {
        }
    ?>
    cat include_it.php
    <?
        echo "1<br>\n";
        include 'include_me.php';
        echo "2<br>\n";
        include 'include_me.php';
        echo "3<br>\n";
    ?>
    Now run include_it.php (it doesn't matter if its CGI or
    module):
    On PHP 4.0.4pl1 up to 4.0.6 this gives:
    1<br>
    2<br>
    returning<br>
    3<br>
    But now I get:
    1<br>
    2<br>
    <br />
    Fatal error - Cannot redeclare cant_be_redefined()
    (previously declared in include_me.php:9)
    [I shortened the error message to be more readable]
    If this is 'now the way it is' this should be mentioned
    somewhere very clearly I think. Doesn't seem to be fixable in
    some way? Couldn't find a reference to it e.g. in the NEWS
    file.
    I know that there should be used include_once() but
    I'm talking about existing code writing that way which
    definitely won't work without modifications.
    - Markus
    ps: thanks to Jan for verifying this!
-- Please always Cc to me when replying to me on the lists. -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


Thread (24 messages)

« previous php.dev (#71998) next »