3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { private $id; public function __construct($id) { $this->id = $id; } } class Derived extends Base { protected $id; public function __construct($id) { parent::__construct($id + 20); $this->id = $id; } } $a = new Derived(44); $s = serialize($a); $u = unserialize($s); print_r($u);
Output for git.master, git.master_jit, rfc.property-hooks
Derived Object ( [id:Base:private] => 64 [id:protected] => 44 )

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:
35.85 ms | 405 KiB | 5 Q