xref: /PHP-7.1/Zend/tests/objects_017.phpt (revision e97d5fab)
1--TEST--
2Testing visibility of object returned by function
3--FILE--
4<?php
5
6class foo {
7	private $test = 1;
8}
9
10function test() {
11	return new foo;
12}
13
14test()->test = 2;
15
16?>
17--EXPECTF--
18Fatal error: Uncaught Error: Cannot access private property foo::$test in %s:%d
19Stack trace:
20#0 {main}
21  thrown in %s on line %d
22