search
Innovative Web Design and Application Development
PawPrint.net

PawPrint.net News

February 10th, 2010
February 10th, 2010

PHP 6 is coming

Some changes are already visible via depreciated functions in PHP 5.3

The long awaited PHP 6 version is starting to look more like a reality at the end of a very long tunnel, but in the immediate future the PHP team has depreciated several functions and language concepts in the PHP 5.3 release that are clearly aimed at helping developers start to migrate early...

For the most part anyone following good programming practices and not taking shortcuts will not have had much problem with changes from php 3 - 4 - 5 thus far But the new 5.3 release is not going to be as easy as it marks a few functions as depreciated that will likely hit some developers very hard. The full list is available on the PHP web site but we have highlighted a few of the key issues here:
  • call_user_method() (use call_user_func() instead)
  • call_user_method_array() (use call_user_func_array() instead)
  • define_syslog_variables()
  • dl()
  • ereg() (use preg_match() instead)
  • ereg_replace() (use preg_replace() instead)
  • eregi() (use preg_match() with the ŽiŽ modifier instead)
  • eregi_replace() (use preg_replace() with the ŽiŽ modifier instead)
  • set_magic_quotes_runtime() and its alias, magic_quotes_runtime()
  • session_register() (use the $_SESSION superglobal instead)
  • session_unregister() (use the $_SESSION superglobal instead)
  • session_is_registered() (use the $_SESSION superglobal instead)
  • set_socket_blocking() (use stream_set_blocking() instead)
  • split() (use preg_split() instead)
  • spliti() (use preg_split() with the ŽiŽ modifier instead)
  • sql_regcase()
  • mysql_db_query() (use mysql_select_db() and mysql_query() instead)
  • mysql_escape_string() (use mysql_real_escape_string() instead)
  • Passing locale category names as strings is now deprecated. Use the LC_* family of constants instead.
  • The is_dst parameter to mktime(). Use the new timezone handling functions instead.

Some of these may come as a real surprise to many especially ones like ereg/i and split/i which are used so frequently in so many PHP applications. The rational seems obvious in that the PHP 6 release will stick to a single regular expression engine rather then continuing to support several as PHP currently does - but the change will be a hard hitting one for many as all the regular expressions used will need to be switched into pearl-like format and then all related code re-tested.

Now, is a great time therefore to start the migration process and we here at PawPrint have already begin swapping out any cases where these functions are used for their counterparts.


Share this:
No Comments
i
You must login or register to post comments Login/Signup
RSS feed Feed Description
Subscribe to the complete PawPrint.net News RSS news feedAll News RSS feed Complete RSS feed
Subscribe to the PawPrint.net News RSS news feed for this category onlyTechnobloggle RSS feed for: Technobloggle
A Rich Site Summary (RSS) feed is an xml data file that provides a summary of the information contained here. It is not designed to be viewed in your browser, but instead by rss reader software. If you do not know what this means - you can safely ignore it, as it is provided for advanced users with rss reader software only.
Copyright © 1992-2024 PawPrint.net
web development: PawPrint.net