mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
22 lines
317 B
PHP
22 lines
317 B
PHP
--TEST--
|
|
Testing visibility of object returned by function
|
|
--FILE--
|
|
<?php
|
|
|
|
class foo {
|
|
private $test = 1;
|
|
}
|
|
|
|
function test() {
|
|
return new foo;
|
|
}
|
|
|
|
test()->test = 2;
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Cannot access private property foo::$test in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|