ID: 27442
User updated by: kim at openphp dot cn
Reported By: kim at openphp dot cn
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Windows Server 2003
PHP Version: 4.3.4
New Comment:
Oh~My God ! Look At These two Pictures :
http://www.openphp.cn/zero.gif
http://www.openphp.cn/zero2.gif
I don't know how to use CMD ....:)
Previous Comments:
------------------------------------------------------------------------
[2004-03-02 05:21:41] derick@php.net
derick@kossu:~$ php-4.3.5RC3 -n -derror_reporting=2047 -r '$value = @
(2/0);';
derick@kossu:~$ php-5.0dev -n -derror_reporting=2047 -r '$value = @
(2/0);';
derick@kossu:~$
no output...
------------------------------------------------------------------------
[2004-03-02 05:10:44] kim at openphp dot cn
Sorry . My English is not good :(
But ,
<?php
$value = @ (2/0);
?>
On PHP4.3.4(or higher) , the output is :
Warning: Division by zero in Unknown on line 0
Not:
This also has nothing to do with your earlier example:
<?php echo @ (2/0); ?> shows no output at all on php 4.3.2,
4.3.3,4.3.5rc1 and 5.0dev
------------------------------------------------------------------------
[2004-03-02 04:45:41] derick@php.net
This is not a bug, check_date() gives an E_WARNING error since PHP
4.3.4 in case the parameter passed is not an integer. Because you
explode on a string, the first ($year) will contain the string and both
$month and $day will contain NULL, which are automatically converted to
'0', but the empty string for $year isn't.
This also has nothing to do with your earlier example:
<?php echo @ (2/0); ?> shows no output at all on php 4.3.2, 4.3.3,
4.3.5rc1 and 5.0dev
------------------------------------------------------------------------
[2004-03-02 04:09:14] kim at openphp dot cn
emm.....the logs is:
checkdate() expects parameter 3 to be long, string given
(PHP 4.3.4 or higher / Apache2.0.48 / Windows Server 2003)
------------------------------------------------------------------------
[2004-03-02 03:46:35] kim at openphp dot cn
The same .......
I thank it is different between 4.3.4(or higher) and 4.3.3 .
Or it is different between IIS and Apache .
I haven't tested On IIS/php4.3.4 , but I tested the code on IIS/4.3.3 ,
everything is OK.
The Error process have something wrong :
-------------------------------------------
<?
error_reporting( E_ALL ^ E_NOTICE ); // ÉèÖþ¯¸æ¼¶±ð
function myErrorHandler ($errno, $errstr, $errfile, $errline) {
switch ($errno)
{
case E_USER_NOTICE:
case E_USER_WARNING:
case E_NOTICE:
case E_CORE_WARNING:
case E_CORE_ERROR:
case E_COMPILE_WARNING:
break;
default:
die("here");
}
}
$old_error_handler = set_error_handler("myErrorHandler");
// mysql_connect ("localhost", "username", "secret");
$ubirth="";
$arr=explode("-", $ubirth);
print_r($arr);
list($year, $month, $day) = explode("-", $ubirth);
echo checkdate($month, $day, $year);
echo checkdate(1, 1, 1);
exit;
?>
---------------------------------------
On IIS5/PHP4.3.3 everything is OK . Output is "Array ( [0] => ) 1"
On Apache2/PHP4.3.4(4.3.5RC4-dev) . Output is "Array ( [0] => ) here".
I don't know why it is different . but it makes me puzzle .
------------------------------------------------------------------------
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/27442
--
Edit this bug report at http://bugs.php.net/?id=27442&edit=1