3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AnotherClass{ public $world = "world"; public function doIt() { return $this->world; } } $anotherClass = new AnotherClass(); class TestClass{ function __construct(){ ob_start(array($this,"callback")); } function callback($input){ global $anotherClass; return $input . get_class($anssstherClass);// . var_export($anotherClass->world, true); } } $tClass = new TestClass(); echo "hello"; //ob_flush();

preferences:
48.98 ms | 402 KiB | 5 Q