3v4l.org

run code in 300+ PHP versions simultaneously
<?php $checkerboard = [["r","n","b","q","k","b","n","r"],["p","p","p","p","p","p","p","p"],["1","1","1","1","1","1","1","1"],["1","1","1","1","1","1","1","1"],["1","1","1","1","P","1","1","1"],["1","1","1","1","1","1","1","1"],["P","P","P","P","1","P","P","P"],["R","N","B","Q","K","B","N","R"]]; $FEN = ""; for ($i = 0;$i < 8;$i++){ for ($j = 0;$j < 8;$j++){ if ($checkerboard[$i][$j] === "1"){ if (@$checkerboard[$i][$j + 1] === "1"){ /* How to iterate till the end */ $FEN .= (int)$checkerboard[$i][$j] + (int)$checkerboard[$i][$j+1]; } } else { $FEN .= $checkerboard[$i][$j]; } } $FEN .= "/"; } echo $FEN; // Output should be: // rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR
Output for git.master, git.master_jit, rfc.property-hooks
rnbqkbnr/pppppppp/2222222/2222222/222P22/2222222/PPPPPPP/RNBQKBNR/

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:
25.18 ms | 405 KiB | 5 Q