|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-31 15:59 UTC] 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) {
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
./php-debug/sapi/cli/php th.php A:test array(1) { [0]=> string(4) "test" } object(B)#2 (0) { } PHP 5.2.0RC2-dev (cli) (built: Aug 3 2006 16:35:13) (DEBUG) in 64 bit linux, works pretty fine.