ID: 28001
Updated by: [EMAIL PROTECTED]
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