3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Derp\C::$stuff is deprecated in /in/GupOR on line 46

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
49.09 ms | 401 KiB | 8 Q