3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $a; public function __construct(){ $this->a["index"] = new B(); } } class B { public function someFunction(){ return "NULL"; } } $o = new A(); echo $o->a["index"]->someFunction() ?? "Something";
based on 1TEJM
Output for 7.0.0 - 7.3.0beta1
NULL
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/inUFt on line 19
Process exited with code 255.