3v4l.org

run code in 300+ PHP versions simultaneously
<?php function binToWeekdays($binvalue) { $binvalue = str_pad($binvalue, 7, "0", STR_PAD_LEFT); echo $binvalue.PHP_EOL; $array_week = array_reverse(str_split($binvalue)); $weekdays = ''; if ($array_week[1] == 1) { $weekdays .= 'Mon, '; } if ($array_week[2] == 1) { $weekdays .= 'Tue, '; } if ($array_week[3] == 1) { $weekdays .= 'Wed, '; } if ($array_week[4] == 1) { $weekdays .= 'Thu, '; } if ($array_week[5] == 1) { $weekdays .= 'Fri, '; } if ($array_week[6] == 1) { $weekdays .= 'Sat, '; } if ($array_week[0] == 1) { $weekdays .= 'Sun'; } return $weekdays; } echo binToWeekdays('11'); ?>
Output for git.master, git.master_jit, rfc.property-hooks
0000011 Mon, Sun

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