ID: 34452 Updated by: [EMAIL PROTECTED] Reported By: stochnagara at hotmail dot com -Status: Assigned +Status: Wont fix Bug Type: Class/Object related PHP Version: 5CVS-2005-09-10 (snap) Assigned To: dmitry New Comment:
We should live with current behavior, because __set() is called implicity. There is no call and second parameter in "$demo->abc = null;". Previous Comments: ------------------------------------------------------------------------ [2005-09-10 23:27:12] [EMAIL PROTECTED] Dmitry, can you fix this? ------------------------------------------------------------------------ [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