#39148 [Opn->Fbk]: Type hinting for functions
| From: | tony2001@php.net | Date: | Fri, 13 Oct 2006 14:34:07 +0000 |
| Subject: | #39148 [Opn->Fbk]: Type hinting for functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103522@lists.php.net to get a copy of this message | ||
ID: 39148
Updated by: tony2001@php.net
Reported By: mihai at aviamotors dot ro
-Status: Open
+Status: Feedback
Bug Type: Class/Object related
Operating System: Windows XP
PHP Version: 5.1.6
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2006-10-13 14:29:55] mihai at aviamotors dot ro
Description:
------------
Type hinting does not work when forwarding a parameter from one
function to another.
Reproduce code:
---------------
function a(MyClass &$x)
{
return b($x);
}
function b(MyClass &$x)
{
return $x->Name;
}
Expected result:
----------------
To work.
Actual result:
--------------
Throws the following error:
Fatal error: Argument 1 passed to b() must be an object of class
MyClass
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39148&edit=1