ID:               15651
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Open
 Bug Type:         *General Issues
 Operating System: Win2K-Server / UNIX
 PHP Version:      4.1.1
 New Comment:

I made test using the advised method, and found that crush appears in
one my simple function "call". A simple example goes below:

<?
// --------------------------------------\
// Apply specified function to arguments
//   if 2'nd argument is an array, its elements replace arguments
//   it's a way to apply function to arguments by their references
// Examples:
//   list($c1)=call("intval",$a1);
//   list($c2,$c3)=call("htmlspecialchars",$b2,$b3);
//   call("htmlspecialchars",array(&$b2,&$b3));
// ------------------------------------\
function call() {
  if (func_num_args()<2) return false;
  $argv=func_get_args();
  $func=array_shift($argv);
error_log(__FILE__.'('.__LINE__.')');                   //
  if (is_array($argv[0])) $argv=&$argv[0];              // Crush is here
error_log(__FILE__.'('.__LINE__.')');                   //
  reset($argv);
  while (list($k,$v)=each($argv)) $argv[$k]=$func($v);
  reset($argv);
  return $argv;
  }
// ------------------------------------/


call("intval",1);               // OK
call("intval",array(1));        // Crush
?>

Note: actually cutting line goes some earlier than that crush point,
but, I think it's because some PHP bufferization, and is not important
now.


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

[2002-02-22 06:35:16] [EMAIL PROTECTED]

Could you set up linux/freebsd box to reproduce this bug? 
And generate backtrace. (Or get exit code with gdb)

You can write "error_log(__FILE__.'(.'__LINE__.')')"
to locate to find ofending function/line also.



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

[2002-02-21 21:27:48] [EMAIL PROTECTED]

Sorry. I wanted to say "... My site is complex enough..."

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

[2002-02-21 21:25:45] [EMAIL PROTECTED]

I tryed to make some small scripts before, but there were no problems
with them. My site is complete enough, there is a lot of includes (but
execution time for homepage on my PC is less than 1 sec.). It looks
like there are no problems for simply scripts, but I'll try again to
make something ...
By that time, if you like you may watch the results on different
servers:
1) php4.0.6: http://www.sec4.wfdns.com/www.freetakeout.com/
2) php4.1.1: http://vh110014.radntech.ca/fto/ 
- you may try to click some links there ("log-in to your account", for
example) to see the difference in cutting point.

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

[2002-02-21 20:26:05] [EMAIL PROTECTED]

If you can create _short_ & _complete_ script that reproduces the
problem. We can fix it :)

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

[2002-02-21 18:37:26] [EMAIL PROTECTED]

Unfortunately, my home OS is Win2K-Server, and I myself don't have VC++
to try to build PHP from sources...
Can I provide any useful information for you, using my OS software
which I already have?
I have both IIS and Apache web servers.

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

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/15651

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

Reply via email to