#38271 [Opn->Fbk]: Type Hint with Array nulls given argument

From: Date: Wed, 02 Aug 2006 09:55:35 +0000
Subject: #38271 [Opn->Fbk]: Type Hint with Array nulls given argument
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100216@lists.php.net to get a copy of this message
ID: 38271 Updated by: tony2001@php.net Reported By: martin dot nowack at xiranet dot com -Status: Open +Status: Feedback Bug Type: Class/Object related Operating System: Linux x86 64Bit PHP Version: 5.1.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip Can't reproduce. Previous Comments: ------------------------------------------------------------------------ [2006-07-31 15:59:57] martin dot nowack at xiranet dot com Description: ------------ I tried to add a type hint for a function with an array: function test(array $supi) ... if I var_dump the content of the variable it is null but should be array. This problem is x86 64bit specific. It doesn't happen on 32bit architecture. Thank you for your help and support. Reproduce code: --------------- <?php class A{ function test(array $supi){ echo("A:test\n"); var_dump($supi); } } class B{ function test2(B $supi){ var_dump($supi); } } $a = new A(); $testArray = array('test'); $a->test($testArray); $b = new B(); $b->test2($b); ?> Expected result: ---------------- A:test array(1) { [0]=> string(4) "test" } object(B)#2 (0) { } Actual result: -------------- A:test NULL object(B)#2 (0) { } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38271&edit=1

« previous php.bugs (#100216) next »