php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38271 Type Hint with Array nulls given argument
Submitted: 2006-07-31 15:59 UTC Modified: 2006-08-10 01:00 UTC
From: martin dot nowack at xiranet dot com Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 5.1.4 OS: Linux x86 64Bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: martin dot nowack at xiranet dot com
New email:
PHP Version: OS:

 

 [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) {
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-02 09:55 UTC] tony2001@php.net
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.
 [2006-08-03 22:28 UTC] judas dot iscariote at gmail dot com
./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.
 [2006-08-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC