3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FizzBuzz { const THREE = __LINE__; const FOUR = __LINE__; const FIVE = __LINE__; const FIFTEEN = __LINE__; public function main() { for($i = (int) true;$i <= self::FIFTEEN;$i++) { ob_start(); $this->f($i); $this->b($i); if (ob_get_contents() == false) { echo $i; } echo PHP_EOL; } } private function f($i) { if ($i % self::THREE == false) { echo substr(__CLASS__, false, self::FOUR); } } private function b($i) { if ($i % self::FIVE == false) { echo substr(__CLASS__, self::FOUR, self::FOUR); } } } (new FizzBuzz())->main();
Output for git.master, git.master_jit, rfc.property-hooks
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz

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