- var_dump: documentation ( source)
<?php
namespace Derp;
abstract class A
{
public $stuff = array();
abstract public function __construct();
}
class B extends A
{
protected $kids;
protected $log;
public function __construct()
{
}
public function bee()
{
$this->kids = new C($this);
$this->kids->cee();
echo "Buzz bee\n";
}
public function updateLog($msg)
{
$this->log[] = $msg;
echo "Adddig log $msg\n";
}
}
class C
{
public $Cups = "cCup";
public function __construct($b)
{
//$this->bee();
$this->Cups = $b;
echo "Building c\n";
}
public function cee()
{
$this->stuff = array("MyStuff");
$this->Cups->updateLog("This");
$this->Cups->updateLog("That");
echo "In cee\n";
}
}
$b = new B();
$x = $b->bee();
var_dump($b);