Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looks odd

Status
Not open for further replies.

ingresman

IS-IT--Management
Feb 17, 2003
1,541
GB
Leading on from another post I've got 5.3.5 running on
XP. I recall reading somewhere about this version no longer using default timezones, which is cool as long as we know. This code.
Code:
<?php
//$i = 0;
echo " is " . $i . "\n";
?>
Tells me
C:\PHP5.3.5>php fred2.php

Warning: main(): It is not safe to rely on the system's timezone settings. You
re *required* to use the date.timezone setting or the date_default_timezone_se
) function. In case you used any of those methods and you are still getting th
warning, you most likely misspelled the timezone identifier. We selected 'Eur
e/London' for '0.0/no DST' instead in C:\PHP5.3.5\fred2.php on line 5

Notice: Undefined variable: i in C:\PHP5.3.5\fred2.php on line 5
is
Which seems to generaly freak because I haven't declared $i;
However if I correct the issue i.e.
Code:
<?php
$i = 0;
echo " is " . $i . "\n";
?>
I get
C:\PHP5.3.5>php fred2.php
is 0
Which is quite happy about the timezone now.
It's probably expected behaviour but it looks odd and I was interested in anyones thoughts.


 
Its definitely not expected. There's no reason It should be spitting out a timezone warning when a variable is not defined.

However, perhaps simply defining a timezone in the PHP.ini file would clear that out.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Check your display settings. Seems to me the warning is always there, but your settings prevent it form begin shown since its now simply a E-Warning rather than E-strict.

Again setting a timezone in your PHP.ini should clear that out.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top