3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $id = null, $stuId = null; public function __construct() { } } class bar extends foo { public function __construct() { parent::__construct(); } public function getId($eventInfo) { foreach($eventInfo as $name=>$value){ $this[$name] = $value; } } } $eventInfo = ["name"=>"Rajesh", "type"=>"Programmer", "action"=>"success"]; print_r((new bar)->getId($eventInfo));
Output for rfc.property-hooks, git.master, git.master_jit
Fatal error: Uncaught Error: Cannot use object of type bar as array in /in/C9sTB:25 Stack trace: #0 /in/C9sTB(30): bar->getId(Array) #1 {main} thrown in /in/C9sTB on line 25
Process exited with code 255.

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:
47.58 ms | 2704 KiB | 4 Q