Stricter Type Checking
am 03.04.2008 21:40:56 von etienne.marais
Don't have time to look this up, could somebody please help me with
the following:
My development machine has php 5.2.0 installed (as per default SUSE
10.2 distro) and the live machine php 5.2.2
The live machine fails/gives notices on errors like:
1) Class variables. i.e. private $venue_id_ declared but $venue_ used
by accident (the local machine just makes use of this 'new' variable
without complaining). This stronger type checking on the live machine
is of course a good thing and I can trace my errors step by step but
would rather do this on the development machine. How do I turn this
on ?
2) (If not the same issue). The live machine failes on tests like: "if
($action) {...}" if $action is not set. The correct solution is if
(isset($action)) but once again my development computer gives no
problems while the live computer fails and tracing this hard on the
slow to access live machine.
Thanks in advance !
Etienne Marais
Re: Stricter Type Checking
am 03.04.2008 22:52:06 von Jerry Stuckle
Etienne Marais wrote:
> Don't have time to look this up, could somebody please help me with
> the following:
>
> My development machine has php 5.2.0 installed (as per default SUSE
> 10.2 distro) and the live machine php 5.2.2
>
> The live machine fails/gives notices on errors like:
>
> 1) Class variables. i.e. private $venue_id_ declared but $venue_ used
> by accident (the local machine just makes use of this 'new' variable
> without complaining). This stronger type checking on the live machine
> is of course a good thing and I can trace my errors step by step but
> would rather do this on the development machine. How do I turn this
> on ?
>
> 2) (If not the same issue). The live machine failes on tests like: "if
> ($action) {...}" if $action is not set. The correct solution is if
> (isset($action)) but once again my development computer gives no
> problems while the live computer fails and tracing this hard on the
> slow to access live machine.
>
> Thanks in advance !
> Etienne Marais
>
In your php.ini file on your development machine, you should have:
error_reporting=E_ALL
display_errors=on
In your production machine you should have
display_errors=off
And if you want to log errors:
error_log=filename
If you don't want notices on your production machine, set
error_reporting=E_ALL & ~E_NOTICE & ~E_STRICT
This is all pretty well documented in your php.ini file.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================