3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $titleInfo = []; /** @return array */ public function bar() { $key = ''; if ( !isset( $this->titleInfo[$key] ) ) { $this->titleInfo[$key] = [ 42 ]; } return $this->titleInfo[$key]; # The critical line } } $value = ( new Foo )->bar(); var_dump( $value );

preferences:
67.84 ms | 402 KiB | 5 Q