#26789 [Opn->WFx]: NullPointerException desired
| From: | derick@php.net | Date: | Mon, 05 Jan 2004 08:00:01 +0000 |
| Subject: | #26789 [Opn->WFx]: NullPointerException desired | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52795@lists.php.net to get a copy of this message | ||
ID: 26789
Updated by: derick@php.net
Reported By: davidc at blesys dot com
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: (doesn't apply)
PHP Version: 5.0.0b3 (beta3)
New Comment:
If you want to have "NULL" objects, test if an object is NULL before
you call methods on it. There is no chance this will be implemented.
Previous Comments:
------------------------------------------------------------------------
[2004-01-04 18:23:05] davidc at blesys dot com
Description:
------------
I desire a NullPointerException to be thrown, like in Java.
Currently, a fatal error triggers, stopping my entire application.
Many times an object may be null, but the application can continue. In
addition, if an exception were thrown, I could trace it to see why the
exception occured.
Reproduce code:
---------------
$j=null;
$j->someMethod();
Expected result:
----------------
Fatal error: Call to a member function someMethod() on a non-object in
file.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26789&edit=1