3v4l.org

run code in 300+ PHP versions simultaneously
<?php class My_Card{ protected $id; protected $credit; public function setID($id){ $this->id = $id; } public function getID(){ return $this->id; } public function setCredit($credit){ $this->credit = $credit; } public function getCredit(){ return $this->credit ; } } function update($aCard){ $otherCard = $aCard; unset($otherCard->credit); print $aCard->credit; } $aCard = new My_Card(); $aCard->setID('123'); $aCard->setCredit('10.00'); update($aCard);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot access protected property My_Card::$credit in /in/JGOn8:22 Stack trace: #0 /in/JGOn8(31): update(Object(My_Card)) #1 {main} thrown in /in/JGOn8 on line 22
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:
33.49 ms | 401 KiB | 8 Q