[PHP-BUG] Bug #69476 [NEW]: is_null() must not throw warnings
[email protected] ("spam2 at rhsoft dot net")
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
From: spam2 at rhsoft dot net
Operating system: Linux
PHP version: Irrelevant
Package: PHP Language Specification
Bug Type: Bug
Bug description:is_null() must not throw warnings
Description:
------------
since isset() returns false in case a variable contains NULL (which is a
major design error) is_null() MUST not throw a warning in case of a
undefined variable
Test script:
---------------
<?php
if(isset($nicht_definiert) || is_null($nicht_definiert))
{
echo "defined\n";
}
?>
Expected result:
----------------
no warning or a sane isset() behavior with sanity in mind
how the hell do you test if a variable is defined with the isset()
behavior saying no if the value is NULL
Actual result:
--------------
Notice: Undefined variable: nicht_definiert in
/mnt/data/downloads/test.php on line 2
defined
--
Edit bug report at https://bugs.php.net/bug.php?id=69476&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69476&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69476&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69476&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69476&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69476&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69476&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69476&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69476&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69476&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69476&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69476&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69476&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69476&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69476&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69476&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69476&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69476&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69476&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69476&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69476&r=mysqlcfg