From:             [EMAIL PROTECTED]
Operating system: win 98
PHP version:      4.1.1
PHP Bug Type:     Reproducible crash
Bug description:  declare makes apacke crahs burn and die!!

Apache crashes, burns and dies when i copy and paste the first “declare”
example in the php documentation....

dont ask me why it is happening. I am having troubles learning how to use
declare and ticks. may be declare or ticks is not causing the problem....
beats the heck out of me.

php4.0.6 did the same thing with apache 1.3.20, but when i upgraded to
apache 1.3.22, it caused and internal server error. After i updated my php
to the current version, apache decided it liked to crash and burn better.

It might be good idea to update the documentation to a different example,
one that does not crash.... just a thought. I know it might not be
possible.

The source code is as follows:

<pre>
<?php
// A function that records the time when it is called
function profile ($dump = FALSE)
{
    static $profile;

    // Return the times stored in profile, then erase it
    if ($dump) {
        $temp = $profile;
        unset ($profile);
        return ($temp);
    }

    $profile[] = microtime ();
}

// Set up a tick handler
register_tick_function("profile");

// Initialize the function before the declare block
profile ();

// Run a block of code, throw a tick every 2nd statement
declare (ticks=2) {
    for ($x = 1; $x < 50; ++$x) {
        echo similar_text (md5($x), md5($x*$x)), "&lt;br&gt;";
    }
}

// Display the data stored in the profiler
print_r (profile (TRUE));
?>
</pre>

good luck...

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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to