<?php
namespace Derp;
abstract class A
{
public $stuff = array();
abstract public function __construct();
}
class B extends A
{
protected $kids;
protected $log;
//public $stuff;
public function __construct()
{
//$this->bee();
}
public function bee()
{
$this->kids = new C($this);
$this->kids->cee();
}
public function updateLog($msg)
{
$this->log[] = $msg;
}
}
class C //extends A
{
public $Cups = "cCup";
//public $stuff;
public function __construct($b)
{
//$this->bee();
$this->Cups = $b;
}
public function cee()
{
$this->stuff = array("MyStuff");
$this->Cups->updateLog("This");
$this->Cups->updateLog("That");
}
}
$b = new B();
$x = $b->bee();
Deprecated: Creation of dynamic property Derp\C::$stuff is deprecated in /in/GupOR on line 46
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Deprecated: Creation of dynamic property Derp\C::$stuff is deprecated in /in/GupOR on line 46