3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sequence = new Sequence("foobar"); for ($i = 0; $i < 10; $i++) { echo $sequence->int64() . ' '; } class Sequence { protected $seed; public function __construct($seed) { $this->seed = $seed; $this->mix(); } public function int32() { $parts = unpack('l', $this->mix()); return $parts[1]; } public function int64() { $parts = unpack('i', $this->mix()); return $parts[1]; } public function float() { $parts = unpack('d', $this->mix()); return $parts[1]; } private function mix() { $hash = hash('sha512', $this->seed, true); $this->seed = substr($hash, 0, 32); return substr($hash, 32); } }
Output for rfc.property-hooks, git.master, git.master_jit
760044969 2031805701 -303246606 -1718387386 -1260105184 -954679634 -439239378 1538223728 -2110538150 -64856071

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:
46.92 ms | 2235 KiB | 4 Q