- array_push: documentation ( source)
- var_dump: documentation ( source)
<?php
class Bar {
// protected $compat_fields = array();
public function __construct() {
}
}
class Foo extends Bar {
public function __construct() {
parent::__construct();
if ( $this->compat_fields && is_array( $this->compat_fields ) ) {
array_push( $this->compat_fields, 'all_items' );
}
$this->all_items = array();
}
}
$foo = new Foo();
var_dump( $foo->all_items );