php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #211 Functions min() and max() on arrays crash PHP without trace
Submitted: 1998-03-29 09:24 UTC Modified: 1998-03-30 05:54 UTC
From: david at uws dot edu dot au Assigned: ssb (profile)
Status: Closed Package: Reproducible Crash
PHP Version: 3.0 Release Cand OS: Debian/GNU Linux 1.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at uws dot edu dot au
New email:
PHP Version: OS:

 

 [1998-03-29 09:24 UTC] david at uws dot edu dot au
The following script illustrates the problem:

<?PHP
   $results["a"] = 1;
   $results["b"] = 3;
   $results["c"] = 4;
   $results["d"] = 2;
   echo min($results) . "\n";
   echo max($results) . "\n";
   if( is_array($results) )
      echo "yes, \$results is an array\n";
?>

Comment-out the lines using min/max and the output indicates
that the variable is in fact an array.  According to the PHP3
documentation, min/max on an array should work (the larger
application in which this crashes is the survey demo from
PHP/FI2).

Leave the min/max lines uncommented and there will be no
trace of any problems - browser says document contains no
data, server returns no headers or part page, with full
pedantic warnings/errors/logging enabled, PHP's error log
file contains nothing, server's log file contains nothing,
there is even no evidence of the request in the server's
access log!  Server just ups and crashes without trace (sorry,
no core dump).

Environment is Debian/GNU Linux 1.3 (kernel 2.0.33, libc
5.4.33, gcc 2.7.2.1), Apache 1.2.6, PHP 3.0RC;  PHP has
support for GD and MySQL compiled-in (not modules).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-30 05:54 UTC] ssb
Fixed in 3.0RC2

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC