#28001 [NEW]: More informative class hinting errors

From: Date: Thu, 15 Apr 2004 03:05:33 +0000
Subject: #28001 [NEW]: More informative class hinting errors
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58160@lists.php.net to get a copy of this message
From: jevon at jevon dot org Operating system: XP SP1 PHP version: 5.0.0RC1 PHP Bug Type: Feature/Change Request Bug description: More informative class hinting errors 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 bug report at http://bugs.php.net/?id=28001&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28001&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28001&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28001&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28001&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28001&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28001&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28001&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28001&r=support Expected behavior: http://bugs.php.net/fix.php?id=28001&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28001&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28001&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28001&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28001&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28001&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28001&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28001&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28001&r=float

« previous php.bugs (#58160) next »