summaryrefslogtreecommitdiff
path: root/Zend/tests/bug54367.phpt
blob: e926b8937ee6c52a7668f290131c17ac6b45e30a (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
--TEST--
Bug #54367 (Use of closure causes problem in ArrayAccess)
--FILE--
<?php
class MyObjet implements ArrayAccess
{
    public function offsetSet($offset, $value) { }
    public function offsetExists($offset) {  }
    public function offsetUnset($offset) { }

    public function offsetGet ($offset)
    {
    return function ($var) use ($offset) { // here is the problem
              var_dump($offset, $var);
        };
    }
}

$a = new MyObjet();
echo $a['p']('foo');
?>
--EXPECT--
string(1) "p"
string(3) "foo"