Bug->Req #47664 [Asn->Csd]: get_class returns NULL instead of FALSE.

From: Date: Tue, 06 Aug 2013 09:48:24 +0000
Subject: Bug->Req #47664 [Asn->Csd]: get_class returns NULL instead of FALSE.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-180759@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47664&edit=1 ID: 47664 Updated by: yohgaki@php.net Reported by: wiebe at wiebelt dot nl Summary: get_class returns NULL instead of FALSE. -Status: Assigned +Status: Closed -Type: Bug +Type: Feature/Change Request Package: Class/Object related -Operating System: Ubuntu 8.10 +Operating System: any -PHP Version: 5.3.0beta1 +PHP Version: master Assigned To: dmitry Block user comment: N Private report: N New Comment: It is documented as get_class() raise E_WARNING now. I feel E_WARNING is unnecessary for get_class() as it requires is_object() call for error free programming. e.g. factory may fail and return false when something wrong, etc. Anyway, bug is fixed and E_WARNING error is documented. If anyone feel it should not raise E_WARNING, create new entry for it. Closing. Previous Comments: ------------------------------------------------------------------------ [2009-07-28 13:14:52] derick@php.net The documentation clearly states: "Returns the name of the class of which object is an instance. Returns FALSE if object is not an object." It doesn't say "shows a warning when object is not an object", so this should be fixed according to what PHP 5.2.x and the manual say. ------------------------------------------------------------------------ [2009-07-28 13:06:48] dmitry@php.net I would prefer to stay the warning, as it indicates a problem in user code that probably need to be fixed. ------------------------------------------------------------------------ [2009-06-30 12:33:05] derick@php.net I've a patch at: http://php.pastebin.com/m20d61023 ------------------------------------------------------------------------ [2009-06-23 11:19:37] derick@php.net This isn't fixed, the warning is still there which is a part of the problem here. ------------------------------------------------------------------------ [2009-03-16 09:53:50] dmitry@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=47664 -- Edit this bug report at https://bugs.php.net/bug.php?id=47664&edit=1

« previous php.bugs (#180759) next »