I counted bugs because that is more reflective of what I would do while working :)
I also added a message for if you are able to go to sleep immediately
<?phpfunctioncountBugs(int$bugs):string{if($bugs===0){return"sleep tight...".PHP_EOL;}$count=0;$text=++$count." bug...".PHP_EOL;while($count<$bugs){$text.=++$count." bugs..".PHP_EOL;}return$text;}echo"Counting three bugs...".PHP_EOL;echocountBugs(3);echo"Counting no bugs...".PHP_EOL;echocountBugs(0);
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
PHP
I counted bugs because that is more reflective of what I would do while working :)
I also added a message for if you are able to go to sleep immediately