|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-10 23:27 UTC] sniper@php.net
[2005-09-12 11:35 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
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