[PHP-dev 409] [Fwd: declare example crash on win32]

Yasuo Ohgaki php-dev@php.gr.jp
Thu, 06 Jun 2002 12:04:50 +0900


大垣です。

declareでクラッシュするそうです。最近のdeclareの変更と関連が
ありそうなので転送します。

--
Yasuo Ohgaki
http://www.webds.net/

-------- Original Message --------
Subject: declare example crash on win32
Date: Thu, 06 Jun 2002 01:01:26 +0100
From: mike@blueroot.net (Michael Dransfield)
To: php-qa@lists.php.net
Newsgroups: php.qa

This script from the manual (control structures->declare) crashes win32
using apache... it only seems to crash the child - it keeps generating the
crash error every couple of seconds, the server is available for other
requests afterwards.

using

PHP Version 4.3.0-dev
System Windows NT localhost 5.0 build 2195
Build Date Apr 26 2002 04:10:45
Server API Apache
Virtual Directory Support enabled
Configuration File (php.ini)
PathC:\WINNT\php.ini
Debug Build no
Thread Safety enabled
PHP Streams enabled
Apache 1.3.24

<?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));
?>