#45105 [Bgs]: Type Hinting cause Fatal error instead on NullPointorException

From: Date: Tue, 27 May 2008 10:25:03 +0000
Subject: #45105 [Bgs]: Type Hinting cause Fatal error instead on NullPointorException
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125296@lists.php.net to get a copy of this message
ID: 45105 User updated by: kingoleg at mail dot ru Reported By: kingoleg at mail dot ru Status: Bogus Bug Type: Feature/Change Request Operating System: Irrelevant PHP Version: 5.2.6 New Comment: Yes, I know, but there is Exception. Is it really need any fatal error if there are exceptions in PHP? Previous Comments: ------------------------------------------------------------------------ [2008-05-27 09:54:05] derick@php.net There is no such thing as a NullPointer in PHP. ------------------------------------------------------------------------ [2008-05-27 08:56:25] kingoleg at mail dot ru Description: ------------ In same cases type hinting cause Fatal Error. I think that in one case NullPoinor will be better. Reproduce code: --------------- function foo(stdClass $a) { } foo(null); Expected result: ---------------- Exception is thrown Actual result: -------------- Fatal error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45105&edit=1

« previous php.bugs (#125296) next »