#34452 [Opn->Asn]: __set type hinting does not provide enough information

From: Date: Sat, 10 Sep 2005 21:27:13 +0000
Subject: #34452 [Opn->Asn]: __set type hinting does not provide enough information
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84848@lists.php.net to get a copy of this message
ID: 34452 Updated by: sniper@php.net Reported By: stochnagara at hotmail dot com -Status: Open +Status: Assigned Bug Type: Class/Object related PHP Version: 5CVS-2005-09-10 (snap) -Assigned To: +Assigned To: dmitry New Comment: Dmitry, can you fix this? Previous Comments: ------------------------------------------------------------------------ [2005-09-10 09:11:37] stochnagara at hotmail dot com Description: ------------ This problem is about the error message shown when a type hinting parameter is incorrect and fatal error occurs. There was a recent changed which enhanced the error message to show the caller of the function/methos which caused a fatal error and debugging became much easier since then. But there is one case where the additional information is not provided - when __set method is called magically. See example below. As you may see, the 'defined in ...' statement is missing. Reproduce code: --------------- <? class foo {} class demo { function __set ($name, foo $abc) {} function set ($name, foo $abc) {} } $demo = new demo; /* CASE 1 */ $demo->set ('abc', null); /* CASE 2 */ $demo->__set ('abc', null); /* CASE 3 */ $demo->abc = null; Expected result: ---------------- in case 1: Fatal error: Argument 2 must not be null, called in ...\test.php on line 10 and defined in ...\test.php on line 6 in case 2: Fatal error: Argument 2 must not be null, called in ...\test.php on line 11 and defined in ...\test.php on line 5 in case 3: Fatal error: Argument 2 must not be null, called in ...\test.php on line 12 and defined in ...\test.php on line 5 Actual result: -------------- in case 1: Fatal error: Argument 2 must not be null, called in ...\test.php on line 10 and defined in ...\test.php on line 6 in case 2: Fatal error: Argument 2 must not be null, called in ...\test.php on line 11 and defined in ...\test.php on line 5 in case 3: Fatal error: Argument 2 must not be null in ...\test.php on line 5 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34452&edit=1

« previous php.bugs (#84848) next »