📄 Viewing: objects_017.phpt

--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

🌑 DarkStealth — WP Plugin Edition

Directory: /usr/src/php-7.4.23/Zend/tests