#28001 [Opn->WFx]: More informative class hinting errors

From: Date: Thu, 15 Apr 2004 07:28:59 +0000
Subject: #28001 [Opn->WFx]: More informative class hinting errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58166@lists.php.net to get a copy of this message
ID: 28001 Updated by: derick@php.net Reported By: jevon at jevon dot org -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: XP SP1 PHP Version: 5.0.0RC1 New Comment: If you want this, write your own error handler and use debug_get_backtrace(). Previous Comments: ------------------------------------------------------------------------ [2004-04-14 23:05:33] jevon at jevon dot org Description: ------------ It would be nice for the object type hinting mechanism in PHP5 to, instead of failing with the expected class and line number of the definition, but failing with the expected and actual classes, and the line numbers of the definition AND the call. Reproduce code: --------------- <?php class Foo { function zod(Bar $f) { ... } } class Bar { } class Baz { } $f = new Foo(); $f->zod(new Baz()); ?> Expected result: ---------------- Fatal error: Argument 1 must be an object of class Bar (not Baz) in file.php on line 4, called in Foo::zod() by file.php on line 11 Actual result: -------------- Fatal error: Argument 1 must be an object of class Bar in file.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28001&edit=1

« previous php.bugs (#58166) next »