PHP 4.0 Bug #5098: min() and max() functions broken if parameter is an array
| From: | jesusmc at scripps dot edu | Date: | Sat, 17 Jun 2000 04:00:27 +0000 |
| Subject: | PHP 4.0 Bug #5098: min() and max() functions broken if parameter is an array | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21583@lists.php.net to get a copy of this message | ||
From: jesusmc@scripps.edu
Operating system: Solaris 2.6
PHP version: 4.0.0 Release
PHP Bug Type: Misbehaving function
Bug description: min() and max() functions broken if parameter is an array
The min() and max() functions work OK if a set of numeric values are passed, but if the parameter is
an array it dies in PHP 4.0.0 Release.
The following script:
<?php
echo "Finding the min and max of some integers: 100,22,3,35,2,56,21<br>";
echo "Max val: ".max(100,22,3,35,2,56,21)."<br>";
echo "Min val: ".min(100,22,3,35,2,56,21)."<br>";
echo "<hr>";
echo "Now creating array from that list...";
$test = array(100,22,3,35,2,56,21);
echo "array created<br>";
echo "This shows the bug, the array will make the interpreter die<br>";
flush();
echo "Max val: ".max($test)."<br>";
echo "Min val: ".min($test)."<br>";
echo "This will not show";
?>
Will only output:
Finding the min and max of some integers: 100,22,3,35,2,56,21
Max val: 100
Min val: 2
_________________________________________________
Now creating array from that list...array created
This shows the bug, the array will make the interpreter die
As you can see it dies when the array is passed.
My config line was:
./configure --prefix=/asd/dredox3/development/php4 \
--with-config-file-path=/asd/dredox3/development/php4 \
--enable-track-vars --enable-magic-quotes \
--enable-xml --enable-wddx --disable-debug\
--enable-ftp --enable-calendar\
--enable-bcmath --enable-trans-id\
--with-gd=/asd/metallo1/server/libs/gd \
--with-msql=/asd/dredox3/development/msql \
--with-mysql --disable-debug \
--with-apxs=/asd/dredox3/development/apache/sbin/apxs
And this happens irrespective of whether I use the Zend Optimizer or not.
The error log from Apache shows (from 2 tests of the script above):
...
[Fri Jun 16 20:33:45 2000] [notice] child pid 19188 exit signal Segmentation Fault (11)
[Fri Jun 16 20:36:52 2000] [notice] child pid 19165 exit signal Segmentation Fault (11)
...
Had not tested on a Linux (RH 6.1) box at home, will post more info later when I test there.
Tried checking the latest code on bonsai.php.net, but that site is out cold right now, it just shows
a dir listing.