Ticket #3622 (new defect)
Opened 19 months ago
Array hinting does not work properly in every situation in r780
| Reported by: | phil.kemmeter@… | Owned by: | anonymous |
|---|---|---|---|
| Priority: | immediate | Milestone: | |
| Component: | PHP Compatability | Version: | trunk |
| Severity: | block | Keywords: | |
| Cc: |
Description
This is the file called index.php:
<?
class ArrayHintTest {
public function __construct() { }
public function print_array(array $x) {
print_r($x);
}
public function wrapper1($x) {
$this->print_array($x);
}
public function wrapper2(array $x) {
$this->print_array($x);
}
}
$A = new ArrayHintTest();
$array = array ("x" => "MUH");
$A->print_array($array);
$A->wrapper1($array);
$A->wrapper2($array);
?>
I compiled it:
pcc --fastcgi array_hint_test find -name '*.php' -or -name '*.inc'
and ran:
./array_hint_test.fcgi
And here is the output:
Content-Length: 237
Content-Type: text/html
Array
(
[x] => MUH
)
Array
(
[x] => MUH
)
<br />
<b>Catchable fatal error</b>: Argument 1 passed to wrapper2() must be an array, array given, called in index.php on line 19 and defined in <b>index.php</b> on line <b>10</b><br />
This is not the expected result, but 3 times "Array ( [x] => MUH )" is.
I consider this as a bug.
HF,
Phil
Note: See
TracTickets for help on using
tickets.
