summaryrefslogtreecommitdiff
path: root/Zend/tests/bug34064.phpt
blob: 3cdd7092382726c354e589f3f018424cd02c1398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--TEST--
Bug #34064 (arr[] as param to function in class gives invalid opcode)
--FILE--
<?php
class XmlTest {

    function test_ref(&$test)
    {
        $test = "ok";
    }

    function test($test)
    {
    }

    function run()
    {
        $ar = array();
        $this->test_ref($ar[]);
        var_dump($ar);
        $this->test($ar[]);
    }
}

$o = new XmlTest();
$o->run();
?>
--EXPECTF--
array(1) {
  [0]=>
  string(2) "ok"
}

Fatal error: Uncaught Error: Cannot use [] for reading in %sbug34064.php:18
Stack trace:
#0 %s(%d): XmlTest->run()
#1 {main}
  thrown in %sbug34064.php on line 18