mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
37 lines
546 B
PHP
37 lines
546 B
PHP
--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
|