summaryrefslogtreecommitdiff
path: root/Zend/tests/bug75079_2.phpt
blob: 92518555b459dd287baf5b58581aee4c90c88315 (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
--TEST--
Bug #75079 variation without traits
--FILE--
<?php

class Foo
{
    private static $bar = 123;

    static function test(){
        return function(){
            return function(){
                return Foo::$bar;
            };
        };
    }
}


$f = Foo::test();

var_dump($f()());

class A{}
$a = new A;
var_dump($f->bindTo($a, A::CLASS)()());

?>
--EXPECTF--
int(123)

Fatal error: Uncaught Error: Cannot access private property Foo::$bar in %s:%d
Stack trace:
#0 %s(%d): A->{closure}()
#1 {main}
  thrown in %s on line %d