[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
NetGamers.org • View topic - PHP upgrade; errors.

NetGamers.org

NetGamers.Org - The Premier Online Gaming Network
It is currently Fri Nov 22, 2019 11:12 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PHP upgrade; errors.
PostPosted: Mon Feb 09, 2004 3:41 pm 
Offline
Pro NetGamer

Joined: Sun Jul 21, 2002 4:12 pm
Posts: 291
Location: UK
I upgraded to the latest PHP (having not upgraded in about 10 months previously!).

Now I get lots of stuff like:

Notice: Undefined variable: existingerror in H:\Dev\sc\login.php on line 104

or

Notice: Undefined index: m in H:\Dev\sc\index.php on line 3

Now, I know this is caused because I use (respectively):

if ((!$existingerror) and (!$row['active']))
if ($_GET['m'] == "logout")

So (as far as I can see) I have two choices:

1 - Add "^E_NOTICE" to the PHP config
or
2 - Do if (isset ($_GET['m']) and ($_GET['m']=="logout"))

The problem with (1) is that I'll no longer know if I've mispelled a variable
elsewhere.

It would mean I no longer get an error for <i>if (!$foo)</i>, sure. But if for example I do:

$foo = 1
$bar = 2
$total = $foo+$bra

Then with this (above) I won't get informed that $bra doesn't exist.

But with (2) I'll have to rewrite a LOT of code. Not just for this project, but for lots of others.

Can anybody suggest a 3rd Way? I suppose I _could_ turn off display_errors and refer to the error log if something doesn't work. But that sucks. I want my errors on screenm there and then! Well, errors apart from ones moaning about undefined variables.

Basically, I need it to ignore errors caused by if (!$foo), how?

It's amusing, because one of the good things(?) about PHP, is that you never needed to define or cast variables prior to use.

Grrr...

M.

_________________
Former NG/PA busybody.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2004 4:16 pm 
Offline
Pro NetGamer

Joined: Sun Jul 21, 2002 4:12 pm
Posts: 291
Location: UK

_________________
Former NG/PA busybody.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group