|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-11 18:57 UTC] saeven at saeven dot net
[2006-09-11 18:57 UTC] tony2001@php.net
[2006-09-11 19:05 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 15:00:01 2025 UTC |
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