3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HotelFee extends Hydratable { private $description; protected function hydrate(&$res) { if(isset($res) && $res!='') { $this->description = $res; unset($res); } } public function getDescription() { $this->checkHydation(); return $this->description; } } class HotelFees extends \ArrayIterator { function __construct(array &$res = array()) { if (count($res)) { foreach($res as $i => &$hotelFee) { $this->append(new HotelFee($hotelFee)); if(!count($hotelFee)) unset($res[$i]); } if(!count($res)) unset($res); } } /** * @return HotelFee */ public function getNext() { $o = $this->current(); $this->next(); return $o; } } $array = array("prova","ciao","hello"); $hotelFees = new HotelFees($array); //$hotelFees->rewind(); echo $hotelFees->count();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "Hydratable" not found in /in/N4MjA:3 Stack trace: #0 {main} thrown in /in/N4MjA on line 3
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:
59 ms | 401 KiB | 8 Q