|  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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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:

   $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

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, Apache 1.2.6, PHP 3.0RC;  PHP has
support for GD and MySQL compiled-in (not modules).


Add a Patch

Pull Requests

Add a Pull Request


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

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 01 10:03:45 2023 UTC