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:
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
Previous Comments:
------------------------------------------------------------------------
[2004-03-02 04:45:41] [EMAIL PROTECTED]
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 .
------------------------------------------------------------------------
[2004-03-01 02:27:30] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-03-01 00:39:41] kim at openphp dot cn
Small bugs?I don't know.
<?php
$value = @ (2 / 0);
?>
>From browser Ouput :
<br />
<b>Warning</b>: Division by zero in <b>Unknown</b> on line
<b>0</b><br
/>
But From Zend Studio's "GO" (X-Powered-By: PHP/4.3.2) , Output is
nothing...
The correct is nothing output .
------------------------------------------------------------------------
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