Recent Changes - Search:
Thanks to OZU Thanks to OZU
Linked In

links

Reviews

Admin

edit SideBar

PHP

Main.PHP History

Hide minor edits - Show changes to markup

August 23, 2009, at 08:19 PM by 80.24.93.213 -
Changed lines 53-54 from:
to:
  • Loads of php5 resources [http://www.faqts.com/knowledge_base/view.phtml/aid/22154/fid/1150]
August 23, 2009, at 08:16 PM by 80.24.93.213 -
Changed lines 50-51 from:

New features: [http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html]

to:

Useful Links

  • New features: [http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html]
  • Migration to php5 faq [http://us3.php.net/manual/en/faq.migration5.php]
August 23, 2009, at 08:14 PM by 80.24.93.213 -
Changed lines 50-51 from:
to:

New features: [http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html]

August 23, 2009, at 08:12 PM by 80.24.93.213 -
Changed line 2 from:

POST VARS

to:

POST VARS

Changed line 31 from:

Object Model

to:

Object Model

August 23, 2009, at 08:12 PM by 80.24.93.213 -
Changed lines 26-30 from:

$something = $_POST['something'];

to:

$something = $_GET['something'];

But here I'm not sure if you would have to check $_GET and $_POST, e.g.

Object Model

Passed by Reference This is an important change. In PHP4?, everything was passed by value, including objects. This has changed in PHP5? -- all objects are now passed by reference.

PHP Code:
$joe = new Person();
$joe->sex = 'male';

$betty = $joe;
$betty->sex = 'female';

echo $joe->sex; // Will be 'female' 

The above code fragment was common in PHP4?. If you needed to duplicate an object, you simply copied it by assigning it to another variable. But in PHP5? you must use the new clone keyword.

Note that this also means you can stop using the reference operator (&). It was common practice to pass your objects around using the & operator to get around the annoying pass-by-value functionality in PHP4?.

August 23, 2009, at 08:08 PM by 80.24.93.213 -
Changed lines 26-30 from:

[@ $something = $_POST['something']';

to:

$something = $_POST['something'];

August 23, 2009, at 08:07 PM by 80.24.93.213 -
Added line 2:

POST VARS

Added line 5:

[@

Changed lines 7-11 from:
  • $HTTP_GET_VARS => $_GET
  • $HTTP_COOKIE_VARS => $_COOKIE
  • $HTTP_SERVER_VARS => $_SERVER
  • $HTTP_FILES_VARS => $_FILES
  • $HTTP_ENV_VARS => $_ENV
to:
  • $HTTP_GET_VARS => $_GET
  • $HTTP_COOKIE_VARS => $_COOKIE
  • $HTTP_SERVER_VARS => $_SERVER
  • $HTTP_FILES_VARS => $_FILES
  • $HTTP_ENV_VARS => $_ENV
Changed lines 14-15 from:
to:

@]

Changed lines 20-30 from:
to:

sometimes you see this in PHP4?:

global $something

I think to fix this, use:

[@ $something = $_POST['something']';

August 23, 2009, at 07:54 PM by 80.24.93.213 -
Deleted line 3:

{{{

Changed lines 12-13 from:

}}}

to:
August 23, 2009, at 07:53 PM by 80.24.93.213 -
Added lines 1-19:

Convert PHP4? to PHP 5.

There are very few articles on how to do this. The main changes are these:

{{{

  • $HTTP_POST_VARS should become $_POST
  • $HTTP_GET_VARS => $_GET
  • $HTTP_COOKIE_VARS => $_COOKIE
  • $HTTP_SERVER_VARS => $_SERVER
  • $HTTP_FILES_VARS => $_FILES
  • $HTTP_ENV_VARS => $_ENV
  • $HTTP_REQUEST_VARS => $_REQUEST
  • $HTTP_SESSION_VARS => $_SESSION

}}}

The deprecation of the old $HTTP_*_VARS arrays (which need to be indicated as global when used inside a function or method). The following autoglobal arrays were introduced in PHP 4.1.0. They are: $_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, $_REQUEST, and $_SESSION. The older $HTTP_*_VARS arrays, such as $HTTP_POST_VARS, still exist and have since PHP 3. As of PHP 5.0.0, the long PHP predefined variable arrays may be disabled with the register_long_arrays directive.

Also, external variables are no longer registered in the global scope by default. In other words, as of PHP 4.2.0 the PHP directive register_globals is off by default in php.ini

Changed lines 23-24 from:

mysql_query("SET NAMES 'utf8'");

to:

mysql_query("SET NAMES 'utf8'");

Edit - History - Print - Recent Changes - Search
Page last modified on August 23, 2009, at 08:19 PM