3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $_secret = null; public function bar( $value ) { $this->_secret = $value; } } class Baz { private $_foo = null; public function __construct() { $this->_foo = new Foo(); } public function get() { return $this->_foo; } } $o = new Baz(); print_r( $o ); $o->get()->bar( 'name' ); print_r( $o );

preferences:
31.24 ms | 402 KiB | 5 Q