3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Odometer { public function __construct(array $values, $places){ $this->values = array_values($values); $this->places = $places; // 0=>a, 1=>b, ... prints [a],[b],... $this->output = reset($values); // [0]=>0, [0]=>1, [0]=>2, ...[] $this->register[0] = key($values); end($values); $this->limit = key($values); } public function iterate(){ for($i = 0; $i < count($register); $i++){ if($this->register[$i] > $this->limit){ $this->register[$i] = 0; if(isset($this->register[$i+1])){ $this->register[$i+1]++; } else { $this->register[$i+1] = 0; } } } $this->register[0]++; } public function setMeter(){ for($i = 0; $i < count($this->register); $i++){ $this->meter[$i] = $this->values[$this->register[$i]]; } } public function readMeter(){ $this->setMeter(); return '[' . implode('][', $this->meter) . ']'; } }
Output for git.master, git.master_jit, rfc.property-hooks

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:
62.29 ms | 401 KiB | 8 Q