3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A1 { protected function a() { $i = 0; $s = ''; while (true) { $i++; if ($i > 10000) { break; } foreach ([['a' => 1], 2, ['a' => 2]] as $p) { if ($p == 2) { continue; } if ($i % 1000 == 999) { throw new \Exception('t'); } yield $p['a'] => 123; } } } public function b() { $sum = 0; try { foreach ($this->a() as $k => $v) { $sum += $k + $v; } echo 'Done: ', $sum; } catch (\Exception $e) { echo $e; } } } (new A1)->b();
Output for git.master, git.master_jit, rfc.property-hooks
Exception: t in /in/hSHVf:20 Stack trace: #0 /in/hSHVf(33): A1->a() #1 /in/hSHVf(43): A1->b() #2 {main}

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