|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
39 + 44 = ?
Subscribe to this entry?

 [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: Sat Apr 01 05:03:41 2023 UTC