ID:               38782
 User updated by:  saeven at saeven dot net
 Reported By:      saeven at saeven dot net
-Status:           Open
+Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: CentOS/Windows/Slackware
 PHP Version:      5.1.6
 New Comment:

Issue corrected.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to