3v4l.org

run code in 300+ PHP versions simultaneously
<?php $colLetter = ''; $colLetter = function($num) use(&$colLetter) { $letters=array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); //if the number is greater than 26, calculate to get the next letters if($num > 26) { //divide the number by 26 and get rid of the decimal $comp = floor($num / 26); //add the letter to the end of the result and return it if ($comp != 0) { // don't subtract 1 if the comparative variable is greater than 0 return $colLetter($comp) . $letters[($num - $comp * 26)]; } else { return $colLetter($comp) . $letters[($num - $comp * 26) - 1]; } } return $letters[($num-1)]; }; $colLetter(1); $colLetter(2);
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:
67.34 ms | 401 KiB | 8 Q