I have a very simple php code that echos specific numbers based on the time, however it always point out that case 09
is the problem. Here is my code:
<?php
$hour = date('H');
switch ($hour) {
//Midnight
case 00:
echo '1';
// 3 AM
case 03:
echo '2';
// 6 AM
case 06:
echo '3';
// 9 AM
case 09:
echo '4';
// Mid-day
case 12:
echo '5';
// 3 PM
case 15:
echo '6';
// 6 PM
case 18:
echo '7';
// 9 PM
case 21:
echo '8';
}
Error: PHP Parse error: Invalid numeric literal in line 17
λ php -version
PHP 7.4.16 (cli) (built: Mar 2 2021 14:06:13) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Is this a bug?