ID: 38782
Updated by: [EMAIL PROTECTED]
Reported By: saeven at saeven dot net
-Status: Closed
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: CentOS/Windows/Slackware
PHP Version: 5.1.6
New Comment:
Can't reproduce with both 5.1.6 and 5.2.
Previous Comments:
------------------------------------------------------------------------
[2006-09-11 18:57:39] saeven at saeven dot net
Issue corrected.
------------------------------------------------------------------------
[2006-09-11 18:52:30] saeven at saeven dot net
Description:
------------
When specifying a parameter object type in a method signature, if the
object was stored in an array prior to being passed, the method
signature revokes the object type even though var_dump reports it to be
correct!
Reproduce code:
---------------
[file: obj.php]
class Obj1{
//.. object methods/params herein
}
---------------------------------------
[file: main.php]
function foo( Obj1 $x ){}
$a = array();
$o = new Obj1();
$a[0] = $o;
foo( $a[0] );
Expected result:
----------------
shouldn't see any errors
Actual result:
--------------
Fatal error: Argument 1 passed to foo() must be an object of class Obj1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38782&edit=1