- var_dump: documentation ( source)
<?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 );