Forum Moderators: coopster

Message Too Old, No Replies

Migrating from php4 to php5

         

andrewshim

3:10 am on Jan 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My web host will be migrating from php 4 to 5 and they have issued notice to upgrade my code. I think I'm fine but there is one issue I don't quite understand :

An object with no properties is no longer considered "empty".

What does this mean exactly? I have the following script that is important to my site :

if (empty($stringID)) {
header("Location: http://www.example.com/page.php");
exit();
}

This tests to see if the URL that the visitor entered has a required variable. If it doesn't it diverts to another page. How does php5 handle this?

[edited by: eelixduppy at 3:48 am (utc) on Jan. 16, 2008]

jatar_k

3:21 am on Jan 16, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



as long as the old setup had register_globals off, that seems to me one of the biggest issues.

in your example above, barring the register_globals setting, it would behave exactly the same