<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4272726899012395590</id><updated>2012-02-16T21:00:24.974-08:00</updated><title type='text'>Muthu</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-8821628320259861514</id><published>2010-08-16T23:23:00.001-07:00</published><updated>2010-08-17T00:53:12.031-07:00</updated><title type='text'></title><content type='html'>wwwwwwwww&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-8821628320259861514?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/8821628320259861514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=8821628320259861514' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8821628320259861514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8821628320259861514'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2010/08/your-browser-doesnt-support-or-has.html' title=''/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-5247557581463843449</id><published>2010-04-16T03:18:00.000-07:00</published><updated>2010-04-16T03:25:01.360-07:00</updated><title type='text'>????????????</title><content type='html'>&lt;span style="font-weight: bold;"&gt;1. what is team work&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;The ability of a team to work together as a single unit with a common aim&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. what ideas you have to motivate the employees&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-style:italic;"&gt;Motivation is of two types.&lt;br /&gt;Internal and External Motivation-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Internal Motivation-Analyse The Team members conflict and where they are lacking-and i encourage and help to develop from that point by providing guidance and sharing my experience.&lt;br /&gt;External Motivation-We Can Conduct some competition among the Team Members so that They get Motivated and arrange some Outing.&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. what is a Team Leader?&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;Team Leader is a role model for the team members. He will be taking care of the team and their work.  Team Lead should be having a mentality of not leading the team, instead driving the team in the best way. &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-5247557581463843449?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/5247557581463843449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=5247557581463843449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5247557581463843449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5247557581463843449'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2010/04/blog-post.html' title='????????????'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-7907101463290166817</id><published>2010-02-09T02:39:00.000-08:00</published><updated>2010-02-09T03:59:16.644-08:00</updated><title type='text'>Facebook Style Alert Confirm Box</title><content type='html'>&lt;span style="font-weight:bold;"&gt;HTML / Javascript Code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;link href="facebook.alert.css" rel="stylesheet" type="text/css"&lt;br /&gt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js&lt;br /&gt;script type="text/javascript" src="jquery.alert.js&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;script type="text/javascript"&lt;/span&gt;&lt;br /&gt;$(document).ready( function()&lt;br /&gt;{&lt;br /&gt;$("#delete_confirm").click( function()&lt;br /&gt;{&lt;br /&gt;jConfirm(Are you sure you want ot delete this thread?, ,&lt;br /&gt;function(r)&lt;br /&gt;{&lt;br /&gt;if(r==true)&lt;br /&gt;{&lt;br /&gt;//You havt to include Ajax funtion for deleting records tutorial link&lt;br /&gt;$("#box").fadeOut(300);&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;});&lt;br /&gt;});&lt;br /&gt;&lt;span style="font-style:italic;"&gt;script&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;div id="box" style=" background-color:#ffffcc;"&lt;br /&gt;&lt;br /&gt;a href="#" id="delete_confirm" Delete /a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Facebook.alert.css&lt;br /&gt;Contains CSS code.&lt;br /&gt;&lt;br /&gt; #popup_container&lt;br /&gt;{&lt;br /&gt;font-family:Lucida Grande,arial;&lt;br /&gt;font-weight:bold;&lt;br /&gt;text-align:left;&lt;br /&gt;font-size: 12px;&lt;br /&gt;width: 364px;&lt;br /&gt;height: 86px;&lt;br /&gt;background: #F3F3F3;&lt;br /&gt;border:solid 1px #dedede;&lt;br /&gt;border-bottom: solid 2px #456FA5;&lt;br /&gt;color: #000000;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#popup_title&lt;br /&gt;{&lt;br /&gt;display:none;&lt;br /&gt;}&lt;br /&gt;#popup_message&lt;br /&gt;{&lt;br /&gt;padding-top: 15px;&lt;br /&gt;padding-left: 15px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#popup_panel&lt;br /&gt;{&lt;br /&gt;text-align: left;&lt;br /&gt;padding-left:15px;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;input&lt;br /&gt;{&lt;br /&gt;background-color:#476EA7;&lt;br /&gt;padding:3px;&lt;br /&gt;color:#FFFFFF;&lt;br /&gt;margin-top:20px;&lt;br /&gt;margin-right:10px;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-7907101463290166817?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/7907101463290166817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=7907101463290166817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/7907101463290166817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/7907101463290166817'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2010/02/facebook-style-alert-confirm-box.html' title='Facebook Style Alert Confirm Box'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-9159080020757094542</id><published>2010-02-09T02:03:00.000-08:00</published><updated>2010-02-09T02:29:27.634-08:00</updated><title type='text'>Safe Updates with MySQL</title><content type='html'>How to achieve safe updates with MySQL and PHP&lt;br /&gt;&lt;br /&gt;In this post, we are going to discuss about safety updates with MySQL and using that with PHP.&lt;br /&gt;&lt;br /&gt;For beginners, a useful startup option is ’safe updates’ (or –i-am-a-dummy, which has the same effect).&lt;br /&gt;&lt;br /&gt;This option was introduced in MySQL 3.23.11. It is helpful during situations wherein you might have issued a “DELETE FROM tbl_name” statement but forgotten the WHERE clause. Normally, such a statement deletes all rows from the table. With ’safe updates’, you can delete rows only by specifying the key values that identify them. Hence, this helps prevent accidental deletions.&lt;br /&gt;&lt;br /&gt;When you use the ’safe updates’ option, MySQL issues the following statement when it connects to the MySQL server:&lt;br /&gt;&lt;br /&gt;SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000;&lt;br /&gt;&lt;br /&gt;The SET statement has the following effects:&lt;br /&gt;&lt;br /&gt;You are not allowed to execute an UPDATE or DELETE a statement unless you specify a key constraint in the WHERE clause or provide a LIMIT clause (or both). For example:&lt;br /&gt;&lt;br /&gt;UPDATE tbl_name SET not_key_column=val WHERE key_column=val;&lt;br /&gt;&lt;br /&gt;UPDATE tbl_name SET not_key_column=val LIMIT 1&lt;br /&gt;&lt;br /&gt;The server limits all large SELECT results to 1,000 rows unless the statement includes a LIMIT clause.&lt;br /&gt;&lt;br /&gt;These are the options available with MySQL.&lt;br /&gt;&lt;br /&gt;Now, we can use this in our coding by doing a small trick.&lt;br /&gt;&lt;br /&gt;When you use the ’safe updates’ option and connect MySQL at command prompt, MySQL issues the following statement when it connects to the MySQL server:&lt;br /&gt;&lt;br /&gt;SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000;’&lt;br /&gt;&lt;br /&gt;So, we can use this “SET sql_safe_updates=1″ query in our PHP coding. After connecting with the server and selecting the db, we need to execute this query so that safety update will affect all the other queries executed thereafter. This will ensure that no updates or delete operations perform without the WHERE clause.&lt;br /&gt;&lt;br /&gt;This is an useful and important safety measure which can be used in our projects to avoid accidental deletion of all records in a table.&lt;br /&gt;&lt;br /&gt;&lt;?&lt;br /&gt;// This is will be useful to avoid sql injection which may delete all rows of a table&lt;br /&gt;&lt;br /&gt;// http://dev.mysql.com/doc/refman/4.1/en/mysql-tips.html&lt;br /&gt;&lt;br /&gt;error_reporting(E_ALL);&lt;br /&gt;&lt;br /&gt;$con= mysql_connect(”localhost”,”sorna”,”password”);&lt;br /&gt;mysql_select_db(”test1″,$con);&lt;br /&gt;mysql_query(”SET sql_safe_updates=1″);&lt;br /&gt;&lt;br /&gt;mysql_query(”DELETE FROM register”); // This line won’t delete the table since we have turned on the safe updates mode. It won’t execute the delete query when it doesn’t have where clause&lt;br /&gt;mysql_query(”DELETE FROM register WHERE id=6″); // This line will delete the record in which id is 6&lt;br /&gt;mysql_close();&lt;br /&gt;&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-9159080020757094542?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/9159080020757094542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=9159080020757094542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/9159080020757094542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/9159080020757094542'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2010/02/safe-updates-with-mysql.html' title='Safe Updates with MySQL'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-4641065125898151879</id><published>2008-08-20T00:26:00.000-07:00</published><updated>2008-08-20T00:34:46.192-07:00</updated><title type='text'>Content Management by php</title><content type='html'>&lt;span style="font-weight:bold;"&gt;DotClear&lt;/span&gt;&lt;br /&gt;Code conforme aux normes du W3C, dont le XHTML 1.0, Usage de CSS, URL significatives, fils RSS et Atom, Support complet des trackbacks, Support complet de l'unicode, Multi-utilisateur avec niveaux, Interface multilingue, Système de commentaires flexible, Syntaxe Wiki et (X)HTML, Support des clients XML/RPC&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;WordPress&lt;/span&gt;&lt;br /&gt;WordPress is a state-of-the-art semantic personal publishing platform with a focus on aesthetics, web standards, and usability. What a mouthful. WordPress is both free and priceless at the same time.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;CMSimple&lt;/span&gt;&lt;br /&gt;CMSimple is a simple content management system for smart maintainance of small commercial or private sites. Simple installation and easy to modify. The entire site is stored in a single HTML-file - there is no need of databases. CMS is less than 50 KB. Integrated WYSIWYG online editor (both IE and Mozilla), link validation, image handeling, online editing of system files and automatic backup on logout. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Guppy&lt;/span&gt;&lt;br /&gt;En un tour de main, vous pourrez monter votre site, sans aucune connaissance en HTML et PHP. Le présent site vous offre un petit aperçu des fonctionnalités proposées par le portail, dans sa version de base. Mais de nombreux plugins, modules et hacks, ainsi que des skins variés, développés, créés et proposés par la communauté des utilisateurs de GuppY, vous permettent également de customiser votre portail sans difficultés, pour l'adapter à votre besoin spécifique.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Back End CMS&lt;/span&gt;&lt;br /&gt;Back-End is a multi-lingual CMS based on the phpSlash.org code base. Articles, links &amp; photo galleries integrated into a common hierarchy. Content administrators can edit their content through a choice of text, html, wiki or a WYSIWYG editor. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;OpenPHPNuke&lt;/span&gt;&lt;br /&gt;OpenPHPNuke (OPN) is an Open Source Web Content Management System (WCMS) which will assist you in the creation, administration, and maintenance of contents for the internet or intranet. With OPN you can build your homepage, a web portal, and various other ideas for the internet.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Logicreate&lt;/span&gt;&lt;br /&gt;For web site owners, the basic LogiCreate system gives you the tools to control and monitor your own website. The standard tools included allow you to create new HTML pages, send mass emails to users on your system, and view real-time usage reports of your site's activities. For web developers, LogiCreate allows you to develop new applications more efficiently, by building on our standard API. Writing against our system, issues of security/permissions, logging, database handling, sessions and more are all taken care of automatically, allowing you to concentrate on the core logic for your application.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Tiki&lt;/span&gt;&lt;br /&gt;Tiki is a leading open source full featured content management system (CMS) and Groupware (Intranet) suited for many types of online communities. Features include Articles, forums, blogs, directory, topics, wiki, polls, trackers, image galleries, webmail, and much more. Using PHP, MySQL and Smarty.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Typo3&lt;/span&gt;&lt;br /&gt;TYPO3 is a small to medium enterprise class Content Management Framework. It offers the best of both worlds: out-of-the-box operation with a complete set of standard modules and a clean and sturdy high-performance architecture to accomodate virtually every kind of custom solution or extension.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;AWF&lt;/span&gt;&lt;br /&gt;Das Liquid Bytes Adaptive Website Framework (AWF) richtet sich an Software-Entwickler und im Umgang mit Web-Technologien erfahrene Anwender. Es erlaubt auf einfache und schnelle Weise volldynamische Websites inkl. Community Funktionen aufzubauen. Auf der anderen Seite ist es auch möglich, statische HTML Seiten zu exportieren, um diese dann auf Servern ohne PHP/MySQL zu hosten. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Bolinos&lt;/span&gt;&lt;br /&gt;BolinOS is a reliable Open Source Content Management System. BolinOS is a modular publication and communication platform for Internet / Web developped in order to enable simple management of complex portals. Bolinos uses standard open-source software: PHP, Apache, mySQL, providing an environment for deploying powerful Internet based content management solutions. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;webXadmin&lt;/span&gt;&lt;br /&gt;webXadmin is a generic php/mysql application that performs data / web-content management through a webbased HTML interface. From an XML-based schema definition, webXadmin generates records lists, HTML forms and associated sql queries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Bitflux CMS&lt;/span&gt;&lt;br /&gt;Bitflux CMS is an XML and PHP based Content Management System. It allows you to reuse your content in different ways. Bitflux CMS uses as "template" engin XSLT and almost everything is configurable with XML. No need to learn PHP for just setting up a new site. Bitflux CMS uses Popoon as backend engine and is therefore very customizable to your needs. Bitflux CMS is published under the GPL License, so you can download and use it free of charge and can do with it, whatever you want. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Typo3&lt;/span&gt;&lt;br /&gt;Typo3 is a professional class Web Content Management System written in PHP/MySQL. It's designed to be extended with custom written backend modules and frontend libraries for special functionality. I has very powerful integration of image manipulation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Whump: More like this&lt;/span&gt;&lt;br /&gt;More Like This WebLog uses PHP and MySQL to manage and display the site. (PHP +SQL)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;dotWIDGETS&lt;/span&gt;&lt;br /&gt;dotWidgets are compact and easily-configurable scripts that facilitate website content management.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;SPIP&lt;/span&gt;&lt;br /&gt;french content management system, very simple and elegant.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;phpblog&lt;/span&gt;&lt;br /&gt;C'est un ensemble de pages écrites en langage PHP. Il suffit d'un hébergeur proposant PHP/MySQL pour pouvoir faire fonctionner phpBlog ! La plupart des hébergeurs gratuits en sont capables. Il suffit de deux clics pour préparer la base de données à recevoir toutes les infos nécessaires à phpBlog, et de mettre les pages PHP chez l'hébergeur après avoir répondu à quelques questions simples pour la configuration, et en avant !&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;pMachine&lt;/span&gt;&lt;br /&gt;pMachine was written in PHP and runs on any server that has PHP 4 and MySQL installed. If you don't know anything about PHP or MySQL, don't worry... you don't need to! pMachine lets you build feature-rich, dynamic web sites with all the power and speed of PHP/MySQL without the steep learning curve. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PostNuke&lt;/span&gt;&lt;br /&gt;A content Management system with PHP and MYSQL&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;PHPWebsite&lt;/span&gt;&lt;br /&gt;phpWebSite provides a complete web site content management system. Web-based administration allows for easy maintenance of interactive, community-driven web sites. phpWebSite's growing number of plug-ins allow for easy site customization without the need for unwanted or unused features. Client output from phpWebSite is valid XHTML 1.0 and meets the W3C's Web Accessibility Initiative requirements.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Midgard&lt;/span&gt;&lt;br /&gt;Midgard is a freely-available solution for managing content on Web, Extranet and Intranet services. It is also a toolkit for building dynamic applications to power eBusiness and Information Management processes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Drupal&lt;/span&gt;&lt;br /&gt;Drupal is a content management/discussion engine suitable to setup or build a content driven or community driven website. We aim towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design Drupal is flexible and easy to adapt or extend. Drupal is written using PHP. The source code is available under terms of the GNU General Public License (GPL).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;daCode&lt;/span&gt;&lt;br /&gt;daCode is a news engine (or CMS - Content Management System) written in PHP. It works under PHP 3 and 4, and uses a database to store informations. We currently support MySQL and PostgreSQL through a database abstraction layer. You can also use LDAP or NIS along with your database.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;php(Reactor)&lt;/span&gt;&lt;br /&gt;the content management system (cms) allows easy updating of your site. with a browser interface, you can create pages, upload images, and edit your existing pages. All the content in the cms system is stored in a database and integrated with a template when sent to the client - this enables you to worry about the content only, and ignore the graphic design.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Back-End&lt;/span&gt;&lt;br /&gt;Back-End offers an easy way for people with limited html experience to manage the content of their web sites through a Content Management System (CMS).&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;FireSite&lt;/span&gt;&lt;br /&gt;FireSite is a Web Content Management system. It has two parts, the administration interface and a set of api functions you as a web developer use to create your website. It is not an install-and-run-system - you will need to code to create your web pages! Currently FireSite supports English, Swedish, Dutch (included) as well as Spanish, French and German. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;eZ Publish&lt;/span&gt;&lt;br /&gt;eZ publish is a content management system (CMS) for web, released under GPL and the eZ publish professional licence developed by eZ systems. In other words it is a system which keeps track of information. The information is stored in a database and presented on a webpage. You can use any browser to edit the content of the webpage.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;monaural jerk&lt;/span&gt;&lt;br /&gt;a weblog, journal, news, diary system. It allows one or more authors to regularly publish content without touching HTML. It has a nifty web-based editing/publishing sytem. It has a built-in search engine. And it is free for personal or corporate use, under the GPL: this is open-source software.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-4641065125898151879?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/4641065125898151879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=4641065125898151879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/4641065125898151879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/4641065125898151879'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/08/content-management-by-php.html' title='Content Management by php'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-6587179920325984693</id><published>2008-05-29T10:26:00.000-07:00</published><updated>2008-05-29T10:36:17.448-07:00</updated><title type='text'>[[ Model View Controller ]]</title><content type='html'>Model View Controller MVC is a time tested method of separating the user interface of an application from its Domain Logic.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Domain Logic:&lt;/span&gt; Sometimes called business logic. Domain Logic represents the calculations and data storage that form the core of the application. These are the reason for the applications existence.&lt;br /&gt; &lt;br /&gt;The primary goal of MVC is to isolate UI changes and prevent them from requiring changes to the Domain Logic of the application.&lt;br /&gt; &lt;br /&gt;The primary reason for this division is that the user interface and Domain Logic have different drivers for change and different rates of change. By making this separation, you can change the UI without touching the Domain Logic and vice versa. &lt;br /&gt;MVC is sometimes confused with other patterns that have the same goal of separating user interface from Domain Logic, such as Presentation Abstraction Control.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Presentation Abstraction Control:&lt;/span&gt; A pattern for implementing user interfaces, based around the concept of a heirachy of cooperating agents. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;MVC divides an application into three concerns:&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;• Model - Encapsulates core application data and functionality Domain Logic.&lt;br /&gt;• View - obtains data from the model and presents it to the user.&lt;br /&gt;• Controller - receives and translates input to requests on the model or the view.&lt;br /&gt;&lt;br /&gt;The separation into three concerns is inspired by a information processing model where the controller represents system input, the model represents processing and the view represents the output of the system.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; &lt;br /&gt;Model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The model encapsulates the functional core of an application, its Domain Logic. The goal of MVC is to make the model independent of the view and controller which together form the user interface of the application. An object may act as the model for more than one MVC triad at a time.&lt;br /&gt; &lt;br /&gt;Since the model must be independent, it cannot refer to either the view or controller portions of the application. The model may not hold direct instance variables that refer to the view or the controller. It passively supplies its services and data to the other layers of the application. &lt;br /&gt;&lt;br /&gt;See Domain Model and Transaction Script to organize Domain Logic.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Passive Model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With a passive model, the objects used in the model are completely unaware of being used in the MVC triad. The controller notifies the view when it executes an operation on the model that will require the view to be updated. &lt;br /&gt;&lt;br /&gt;The passive model is commonly used in web MVC. The strict request/response cycle of HTTP does not require the immediacy of an active model. The view is always completely re-rendered on every cycle, regardless of changes. This may be especially true in PHP where no state is retained between requests.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Active Model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the active model, model classes define a change notification mechanism, typically using the Observer pattern. This allows unrelated view and controller components to be notified when the model has changed. Because these components register themselves with the model and the model has no knowledge of any specific view or controller, this does not break the independence of the model.&lt;br /&gt; &lt;br /&gt;This notification mechanism is what provides the immediate updating that is the hallmark of a MVC GUI application. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Presentation Model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The purpose of MVC is to separate UI from domain logic. In doing so, an MVC implementation typically develops a set of reusable classes for each of the concerns in the triad. Sometimes, data or behavior that firmly belongs on the user interface side of the division can conveniently be represented using the infrastructure of the model side of the division. Thus objects that would appear at first glance to be in the model are really part of the interface concern, that is the view and controller. &lt;br /&gt;Some examples include scrollbar positions and column sorting.&lt;br /&gt; &lt;br /&gt;This is sometimes called an Application Model and the pattern known as MMVC after the idea that there are two separate models.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;View&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The view obtains data from the model and presents it to the user. The view represents the output of the application.&lt;br /&gt; &lt;br /&gt;The view generally have free access to the model, but should not change the state of the model. Views are read only representations of the state of the model. The view reads data from the model using query methods provided by the model.&lt;br /&gt; &lt;br /&gt;With an Active model, the view can register itself to receive notifications when the model changes, and the view can then present a more up to date version of the model. &lt;br /&gt;Sometimes generic reusable view components can be arbitrarily connected to the model in a process known as binding. &lt;br /&gt;&lt;br /&gt;See Template View and Transform View for strategies of implementing views.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Template View:&lt;/span&gt; A template is a document typically HTML with embedded markers which are replaced, manipulated, or evaluated via a template engine API to produce an output document.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Transform View:&lt;/span&gt; A view that processes domain data element by element and transforms it into HTML.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Controller&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The controller receives and translates input to requests on the model or view. &lt;br /&gt;The controllers are typically responsible for calling methods on the model that change the state of the model. In an active model, this state change is then reflected in the view via the change propagation mechanism. In the passive model, the controller is responsible for telling the view when to update. &lt;br /&gt;&lt;br /&gt;In MVC, The controller is NOT a Mediator between the view and the model. The controller does not sit in between the model and the view. Both the controller and the view have equal opportunity to access the model. The controller does not copy data values from the model to the view, although it may place values in the model and tell the view that the model has changed. see Presentation Abstraction Control where the control layer acts as a mediator between Presentation and Abstraction.&lt;br /&gt; &lt;br /&gt;The word controller is overloaded with different meanings in various patterns. see what is a Controller Anyway There are several of these controller patterns: Front Controller A single point of dispatch for incoming http requests. Page Controller Controls the flow of logic of a single web page. Application Controller Controls the flow of logic of a single application. &lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Front Controller:&lt;/span&gt; A front controller presents a single point for a web server to interface with a web application.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Page Controller:&lt;/span&gt; A Page Controller is one object or file declaration designed to handle the request for one logical web page or action.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Application Controller:&lt;/span&gt; A centralized point for handling screen navigation and the flow of an application.&lt;br /&gt;&lt;br /&gt;Because the popular MVC framework Java Struts from a PHP Perspective implements a combined Front Controller and Application Controller, some people assume that this is what is meant by the MVC pattern in the context of a web application. For the same reason, many descriptions of the Front Controller pattern on the web do not draw the distinction between a Front Controller and a Application Controller.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; &lt;br /&gt;Relationships between components&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;View Controller Relationship&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In traditional smalltalk MVC, views and controllers are tightly coupled. Each view instance is associated with a single unique controller instance and vise versa. The controller is considered a Strategy that the view uses for input. The view is also responsible for creating new views and controllers.&lt;br /&gt; &lt;br /&gt;It is logical that views and controllers are strongly related, the input and output of an application is strongly related. In most GUI MVC frameworks, the view and controller are simply merged into one object. This is called Document View. The view and controller are combined as the view. The model becomes known as a document. &lt;br /&gt;A passive model shifts more responsibility into the controller, as it must notify the views when they should update.&lt;br /&gt; &lt;br /&gt;The modern web usage of MVC shifts even more of the traditional responsibilities of the view to the controller. The controller becomes responsible for creating and selecting views and the view tends to lose responsibility for its controller. &lt;br /&gt;Sometimes responsibility for creating and selecting views is delegated to a specific object, this is known as the Application Controller pattern for web MVC and View Handler for GUI MVC. &lt;br /&gt;&lt;br /&gt;The rigid request/response cycle of HTTP may make the Document View variant less popular in web applications than in GUI applications although the controller is still strongly related to the view. The HTTP request is handled by the controller, the processing to the model, and the response is handled by the view.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Model View Relationship&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The view depends on the model. Changes to the model interface require parallel changes in the view.&lt;br /&gt; &lt;br /&gt;It is very difficult to achieve a strict separation between the model and view. For example, consider the requirement “Show negative balances in red.” At first glance, this appears to be strictly an output requirement and a test might be placed into the view in roughly this form:&lt;br /&gt; &lt;br /&gt;if balance &lt; 0 then red&lt;br /&gt; &lt;br /&gt;This would violate the separation of concerns in MVC. Upon further analysis it turns out that the real requirement is “show overdrawn balances in red” and the definition of overdrawn =balance &lt; 0= should be placed in the model as that is domain specific. It is very easy for domain logic to migrate out of the model and into the view. Template View contains further discussion of this issue.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Model Controller Relationship&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Controller depends on the model. Changes to the model interface may require parallel changes to the controller.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; &lt;br /&gt;Benefits of MVC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Substitutable user interface&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Different views and controllers can be substituted to provide alternate user interfaces for the same model. For example, the same model data can be displayed as a bar graph, or a pie chart, or a spreadsheet. &lt;br /&gt;&lt;br /&gt;Some examples: Read only UI Expert and novice specific UI Different human languages Alternate input mechanisms User specific themes Alternate output formats XML, HTML, etc Alternate form mechanisms HTML forms, XForms, PDF forms&lt;br /&gt;&lt;span style="font-style:italic;"&gt; &lt;br /&gt;User interface components&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Because MVC demands that the user interface of an application be structured into a hierarchy of objects and defines a standard relationship between these objects, generic versions of these objects are possible. They are usually called user interface components and no modern GUI environment is without a full complement of them usually combining view and controller into a single object. WACT is an attempt to provide a similarly rich set of components for web development that maintain the separation between view and controller. components promote reuse and reduce the need for special subclasses. These are known as “pluggable views” in the smalltalk MVC literature.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Multiple simultaneous views of the same model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Multiple different views can be active at the same time. Each view simultaneously and independently presents the same information from the model. This applies more to GUI MVC than web MVC.&lt;br /&gt;&lt;span style="font-style:italic;"&gt; &lt;br /&gt;Syncronized views&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The change propagation mechanism insures that all views simultaneously reflect the current state of the model. &lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Easier user interface changes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Changes affecting just the user interface of the application logic become easier to make.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Easier testing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With MVC it can be easier to test the core of the application, as encapsulated by the model. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Drawbacks of MVC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Increased complexity&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If reading this page doesn’t convince of you the complexity of this pattern, consider all of the auxiliary patterns that co-occur with MVC.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Close coupling of views and controllers to model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Changes to the model interface require parallel changes in the view and may require additional changes to the controller. certain code changes become more difficult.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Potential for excessive updates&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The change propagation mechanism can be inefficient when frequent model changes require many change notifications. This is generally not as much of a problem if a passive model is used.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-style:italic;"&gt;Close coupling between view and controller&lt;/span&gt;&lt;br /&gt;strict separation is difficult if not impossible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-6587179920325984693?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/6587179920325984693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=6587179920325984693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/6587179920325984693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/6587179920325984693'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/model-view-controller.html' title='[[ Model View Controller ]]'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-8905462836893595546</id><published>2008-05-24T00:15:00.000-07:00</published><updated>2008-05-24T00:16:42.640-07:00</updated><title type='text'>Date format validation in PHP</title><content type='html'>Validate the date which is entered from textbox in “YYYY-MM-DD” format. Well, we can validate the format of the date using regular expression but how to validate weather that date is valid date or not, such as “2007-02-29″ is the correct format of the date but it’s not the valid date.&lt;br /&gt;To overcome that situation, I’ve used checkdate() function available in PHP for validation of date.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Function to validate date format in PHP&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;function checkDateFormat($date)&lt;br /&gt;{&lt;br /&gt;  //match the format of the date&lt;br /&gt;  if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/”, $date, $parts))&lt;br /&gt;  {&lt;br /&gt;    //check weather the date is valid of not&lt;br /&gt;        if(checkdate($parts[2],$parts[3],$parts[1]))&lt;br /&gt;          return true;&lt;br /&gt;        else&lt;br /&gt;         return false;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;    return false;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the above function, first of all format of date is validated using regular expression. As you can see the in the preg_match() function, there are three expression each separated by “-” and there can be only digits of length of 4,2 and 2 in these expressions. If the date format is incorrect then this function returns “false” value. And, if the supplied string contains the valid date format then the part matching each expression are stored in the “$parts” array. Such as, if we supply “2007-03-12″ then “2007″, “03″ and “12″ are stored in the “$parts” array. After that, checkdate() function of PHP is used check weather the supplied date is valid date or not.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;echo checkDateFormat("2008-02-29"); //return true&lt;br /&gt;echo checkDateFormat("2007-02-29"); //return false&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-8905462836893595546?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/8905462836893595546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=8905462836893595546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8905462836893595546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8905462836893595546'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/date-format-validation-in-php.html' title='Date format validation in PHP'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-7026989840075335376</id><published>2008-05-24T00:10:00.000-07:00</published><updated>2008-05-24T00:13:15.228-07:00</updated><title type='text'>Server variables available in PHP</title><content type='html'>You guys must have know about server variables in PHP. Server Variables are those variables which are inside the super global array named $_SERVER available in PHP. There are many server variables in PHP and some of them are very useful for fore developing PHP projects. I’m going to post here some of the very useful server variables available in PHP development.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;8 Useful server variables available in PHP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1) $_SERVER['REQUEST_URI']&lt;/span&gt; - It return the URL in to access the page which is executing the script. If you need to type http://www.example.com/product.php?id=5 to access the page then $_SERVER['REQUEST_URI'] returns “/product.php?id=5″.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;2)$_SERVER['DOCUMENT_ROOT']&lt;/span&gt; - Returns the root directory of the server which is specified in the configuration file of server. This variable usually returns the path like “/usr/yoursite/www” in Linux and “D:/xamps/xampp/htdocs” in windows.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3) $_SERVER['HTTP_HOST']&lt;/span&gt; - Returns the host’s name as found in the http header. This variable usually returns the path like “example.com” when the you find “http://example.com” in browser’s address-bar and return “www.example.com” when you see http://www.example.com in the address-bar. This is quite useful when you’ve to preserve session while making online payment using PHP since session stored for “http://example.com” is not same as for the “http://www.example.com”.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4) $_SERVER['HTTP_USER_AGENT']&lt;/span&gt; - Returns the user agent’s (browser) detail accessing the web page. We can use strpos($_SERVER["HTTP_USER_AGENT"],”MSIE”) to detect Microsoft Internet explorer or you can use strpos($_SERVER["HTTP_USER_AGENT"],”Firefox”) to detect firefox browser in PHP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5) $_SERVER['PHP_SELF']&lt;/span&gt; - Returns the file-name of the currently executing script. Let’s suppose that you’re accessing the URL http://www.example.com/product.php?id=5 then $_SERVER['PHP_SELF'] returns “/product.php” in your script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6) $_SERVER['QUERY_STRING']&lt;/span&gt; - Returns the query string if query string is used to access the script currently executing. Query strings are those string which is available after “?” sign.if you use $_SERVER['QUERY_STRING'] in the script executing the following URL “http://www.example.com/index.php?id=5&amp;page=product” then it returns “id=5&amp;page=product” in your script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;7) $_SERVER['REMOTE_ADDR']&lt;/span&gt; - Returns the IP address of remote machine accessing the current page. But you can’t relie on $_SERVER['REMOTE_ADDR'] to get the real IP address of client’s machine. See this article to know how to get real IP addrees in PHP.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;8 ) $_SERVER['SCRIPT_FILENAME']&lt;/span&gt; - Returns the absolute path of the file which is currently executing. It returns path like “var/example.com/www/product.php” in Linux and path like “D:/xampp/xampp/htdocs/test/example.php” in windows.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-7026989840075335376?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/7026989840075335376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=7026989840075335376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/7026989840075335376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/7026989840075335376'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/server-variables-available-in-php.html' title='Server variables available in PHP'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-8076259279552785730</id><published>2008-05-24T00:03:00.000-07:00</published><updated>2008-05-24T00:07:44.783-07:00</updated><title type='text'>Hide .php extension with url rewriting using .htaccess</title><content type='html'>&lt;span style="font-weight:bold;"&gt;hiding php file extension&lt;/span&gt;&lt;br /&gt;Do you want to hide your web site’s server script identity? if you don’t want to reveal the programming language (server side script) of your website to visitors of website so that any hacker or spammer will not be able to intrude or inject any code in your website.&lt;br /&gt;&lt;br /&gt;Here is a small technique for you, you can use .html or .asp file to work as a php file i.e. use .asp or .html extension instead of .php. You just need to create a .htaccess file and put the following code in the .htaccess file. Remember that the .htaccess file should be placed in the root folder of your website.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;# Make PHP code look like asp or perl code&lt;br /&gt;AddType application/x-httpd-php .asp .pl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;if you place the the above code in the .htaccess file then you can use contact.asp as the name of the file. Now a visitor thought that it is a ASP file but this file contains the codes of PHP.&lt;br /&gt;&lt;br /&gt;You can put the following code in .htaccess file to work .htm or .html file as PHP file.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;# Make all PHP code look like HTML&lt;br /&gt;AddType application/x-httpd-php .htm .html&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But there was one flaw in that technique you have had to change the file extension explicitly but in this post I’m going to show you how to rewrite the URL instead of renaming the file extension Using this technique you will see product.html in the address bar of the browser but the actual file name remains product.php and you don’t need to rename the file extension. Furthermore you can rewrite the URL like product.php?id=5 to product-5.html.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;what is the benefits of rewriting URL?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When a search engine visits the dynamic url like product.php?id=5 it does not give much importance to that URL as search engine sees “?” sign treat it as a url which keeps on changing. so we’re converting the dynamic URL like the product.php?id=5 to static url format like product-5.html. We’ll rewrite the url in such a way that in browser’s address bar it will display as a product-5.html but it actually calls the file product.php?id=5. So that why these kind of URL also named as SEO friendly URL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;what is required for URL rewriting ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To rewrite the URL you must have the mod_rewrite module must be loaded in apache server. And furthermore, FollowSymLinks options also need to be enabled otherwise you may encounter 500 Internal Sever Error. If you don’t know much about mod_rewrite module then please check this post to know how to check and enable mod_rewrite module in apache?&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Examples of url rewriting for seo friendly URL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For rewriting the URL, you should create a .htaccess file in the root folder of your web directory. And have to put the following codes as your requirement.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Options +FollowSymlinks&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteRule ^(.*)\.htm$ $1.php [nc]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following example will rewrite the test.php to test.html i.e when a URL like http://localhost/test.htm is called in address bar it calls the file test.php. As you can see the regular expression in first part of the RewriteRule command and $1 represents the first regular expression of the part of the RewriteRule and [nc] means not case sensitive.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Options +FollowSymlinks&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteRule ^product-([0-9]+)\.html$ products.php?id=$1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following example will rewrite the product.php?id=5 to porduct-5.html i.e when a URL like http://localhost/product-5.html calls product.php?id=5 automatically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-8076259279552785730?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/8076259279552785730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=8076259279552785730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8076259279552785730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8076259279552785730'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/hide-php-extension-with-url-rewriting.html' title='Hide .php extension with url rewriting using .htaccess'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-1193800470779020814</id><published>2008-05-20T22:49:00.000-07:00</published><updated>2008-05-20T22:51:28.740-07:00</updated><title type='text'>Open Source Shopping Cart</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Ecommerce Web Design: 20 Open Source Shopping Cart Solutions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Let’s face it: Owning a website for your business is pretty much a requirement in this day and age. What good is a website that only shows customers what your company sells? Why not actually sell to them while they are there?&lt;br /&gt;Use any of these 20 open source shopping carts to maximize your sales potential. Some of these aren’t open source, but they are all free. Create an online store and increase your revenue. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. WP e-Commerce at Instinct Entertainmen&lt;/span&gt;t&lt;br /&gt;WP e-Commerce is a very powerful e-commerce cart for WordPress. It uses your WordPress database to keep track of customers. You can do pretty much anything you can with other carts, while integrating with WordPress.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. CubeCart&lt;/span&gt;&lt;br /&gt;This shopping cart is very popular. It’s entirely free for version 3, with the exception that you leave their copyright notice in your footer. CubeCart has a large amount of payment gateways (Google Checkout, Paypal) and a very active community. Their support forums are lively and many people contribute plugins to the cart. Version 4 is pay-only, but has SEO out of the box.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. Magento&lt;/span&gt;&lt;br /&gt;Magento is currently in beta (it’s only up to version 0.6!) but is already shaping up to be one of the best e-commerce carts out there. Magento features clean urls and SEO from the start. Everything is designed in a clean and simple way. The code it outputs is semantic, which is very rare for e-commerce carts, even commercial ones.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4. osCommerce Online Merchant&lt;/span&gt;&lt;br /&gt;osCommerce is a very popular online shopping cart. osCommerce supports multiple currencies, allows customers to print invoices from the order screen, and has an easy database backup system. Transactions are also carried out in SSL, making them more secure.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5. osCMax&lt;/span&gt;&lt;br /&gt;osCMax is a branch of osCommerce. It gives you unlimited products and categories, multiple payment gateways, multiple shipping gateways and separate customer groups. Because osCMax is so similar to osCommerce, you can use many of the plugins that were made for osCommerce inside osCMax.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6. OpenCart&lt;/span&gt;&lt;br /&gt;OpenCart feels lightweight but is full of great features. The backend is very simple to use. On really great feature is that customers can write their own reviews of the products listed. The latest version has also moved towards xhtml/css for the &lt;span style="font-weight:bold;"&gt;frontend.&lt;br /&gt;7. Zen Cart&lt;/span&gt;&lt;br /&gt;Zen Cart has been around for a while and recently moved to xhtml for templates. Zen Cart also supports multiple payment and shipping options, quantity discounts and coupons. The support forums are very active and most people on them are friendly and helpful. The newest version has added support for PayPal Express Checkout.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;8. cpCommerce&lt;/span&gt;&lt;br /&gt;cpCommerce is an easy to customize shopping cart. It’s template based so you never have to edit more than 5 files to change its look. You can view your store’s history, specify manufacturers and hold sales.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;9. Digistore Free Ecommerce&lt;/span&gt;&lt;br /&gt;Do you like a lot of options with your ecommerce carts? Good, because Digistore allows you to run your store in SSL, have express checkout, let guests check out without registering and more. Digistore supports Authorize.net and PayPal for checkout.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;10. VirtueMart&lt;/span&gt;&lt;br /&gt;VirtueMart is a free ecommerce web design plugin for both Joomla and Mambo. It can be used to display a catalog, or can be used as a full fledged shopping cart. You can assign products to multiple categories, sell downloadable goods and notify customers when an out of stock item is back in stock.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;11. Boss Cart&lt;/span&gt;&lt;br /&gt;Boss Cart is a fairly new shopping cart. It has support for PayPal gateways, it’s template driven, it has search engine friendly pages and is easy to set up. You can even embed flash movies in product pages. Work on version 2.0 has recently started too.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;12. PHP Shop&lt;/span&gt;&lt;br /&gt;PHP Shop is an ecommerce cart built on PHP. It uses CSS-based themes so it is very easy to customize. The product descriptions are edited with a WYSIWYG editor. PHP Shop supports SSL and can process credit cards live, depending on the payment gateway.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;13. PayPal Shopping Cart&lt;/span&gt;&lt;br /&gt;Did you know that PayPal offers a shopping cart that can be integrated with your current site? There is no cost for setting this up and it allows you to process credit cards and bank account payments immediately.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;14. BakeSale - Simply Shopping Cart&lt;/span&gt;&lt;br /&gt;BakeSale is quite a unique shopping cart. It is a “no-frills-get-only-what-you-need-and-nothing-more” cart. There are no ratings for products and no customer reviews. This also means that there is not bloat. You use the cart for one purpose only, to sell your products to a person who wants to buy them.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;15. Mal’s e-commerce&lt;/span&gt;&lt;br /&gt;This is a full featured ecommerce shopping cart completely free of charge. The only thing not included is credit card processing. Credit cards must be processed manually or you can buy a third-party payment gateway. It does support PayPal however.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;16. Ubercart&lt;/span&gt;&lt;br /&gt;Ubercart is a full featured ecommerce cart add-on for Drupal. It features single page checkout, anonymous checkout and integrated payment systems for multiple payment gateways. Ubercart is PayPal certified.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;17. Fat Free Cart&lt;/span&gt;&lt;br /&gt;Fat Free Cart is the simplest shopping cart I have ever seen. All you do is copy and paste some code and viola! You have a store on your website. Checking out is handled by either Paypal or Google Checkout. You do not have to sign up for this code, you simply copy and paste it.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;18. AgoraCart&lt;/span&gt;&lt;br /&gt;AgoraCart is a very popular online shopping cart. It features a css manager so you can edit the look of your cart online, unlimited product options, up to 4 different tax zones at the same time, lots of shipping options and tons of payment gateways. AgoraCart gives you many options for your store.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;19. Cart97&lt;/span&gt;&lt;br /&gt;Cart97 has a lot of great features. It’s easy to set up and very, very easy to run. Customers can submit reviews, when viewing item details it suggests other items for sale, it supports wishlists and even has sale options. The item detail pages work similar to Amazon so customers feel comfortable shopping. The only downside is that it isn’t the easiest cart to customize.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;20. storesprite&lt;/span&gt;&lt;br /&gt;storesprite’s motto is “free certainly does not mean basic”. Their cart has many features including automatic tax calculation, automatic delivery cost calculations, customer ratings and reviews and featured products. That backend panel is designed to be easy to use, even for someone who has never worked with ecommerce before.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-1193800470779020814?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/1193800470779020814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=1193800470779020814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/1193800470779020814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/1193800470779020814'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/open-source-shopping-cart.html' title='Open Source Shopping Cart'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-7040920455140346330</id><published>2008-05-20T06:33:00.000-07:00</published><updated>2008-05-20T06:35:13.117-07:00</updated><title type='text'>What is Joomla</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Joomla&lt;/span&gt; is a free, award-winning content management system written in PHP which allows users to easily publish their content on the world wide web and intranets.  Joomla is created as an open-source project where individuals and teams contribute their skills to its development as well as its supporting systems. &lt;br /&gt;While Joomla is packed with features, its greatest quality is that it is extremely extensible.  Because of its extensible structure, there aren't many things you cannot do with Joomla.  A short list of some important features of Joomla are the following:&lt;br /&gt;• Page Caching &lt;br /&gt;• Web Indexing &lt;br /&gt;• RSS Feeds &lt;br /&gt;• Printable Page Versions &lt;br /&gt;• Newsflashes &lt;br /&gt;• Blogs &lt;br /&gt;• Forums &lt;br /&gt;• Polls &lt;br /&gt;• Calendars &lt;br /&gt;• Website Searching &lt;br /&gt;• Language Internationalization &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Making website management simple.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;The basic Joomla! package is designed to be easy to install, even for non-programmers. Most people have no trouble getting the software running, and there is plenty of support available for newbies. We have a growing, active community including 1,000s  of friendly users and developers eager to help and learn from each other. &lt;br /&gt;One of the best things about Joomla! is how easy it makes adding or editing content, updating images and multimedia, and managing critical data that makes your company or organization operate. Anybody with basic word processing skills can easily learn to manage a Joomla! site! Via a simple, browser-based interface you will be able to easily add new press releases or news items, manage staff pages, job listings, product images, and create an unlimited amount of sections or content pages on your site. &lt;br /&gt;For many people, the true power of Joomla! lies in the application framework that makes it possible for thousands of developers around the world to create powerful add-ons and extensions to this robust content management system. Here are just some examples of the hundreds of available extensions: &lt;br /&gt;• Dynamic form builders &lt;br /&gt;• Business/organizational directories &lt;br /&gt;• Document management &lt;br /&gt;• Image and multimedia galleries &lt;br /&gt;• E-commerce and shopping cart engines &lt;br /&gt;• Forums and chat software &lt;br /&gt;• Calendars &lt;br /&gt;• Blogging software &lt;br /&gt;• Directory services &lt;br /&gt;• Email newsletters &lt;br /&gt;• Data collection and reporting tools &lt;br /&gt;• Banner advertising systems &lt;br /&gt;• Subscription services &lt;br /&gt;• &amp; many, many more…&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-7040920455140346330?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/7040920455140346330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=7040920455140346330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/7040920455140346330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/7040920455140346330'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/what-is-joomla.html' title='What is Joomla'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-2837320161250806921</id><published>2008-05-19T00:08:00.000-07:00</published><updated>2008-05-19T00:11:31.491-07:00</updated><title type='text'>Internet Protocol</title><content type='html'>The Internet Protocol (IP) is the method or protocol by which data is sent from one computer to another on the Internet. Each computer (known as a host) on the Internet has at least one IP address that uniquely identifies it from all other computers on the Internet. When you send or receive data (for example, an e-mail note or a Web page), the message gets divided into little chunks called packets. Each of these packets contains both the sender's Internet address and the receiver's address. Any packet is sent first to a gateway computer that understands a small part of the Internet. The gateway computer reads the destination address and forwards the packet to an adjacent gateway that in turn reads the destination address and so forth across the Internet until one gateway recognizes the packet as belonging to a computer within its immediate neighborhood or domain. That gateway then forwards the packet directly to the computer whose address is specified. &lt;br /&gt;&lt;br /&gt;Because a message is divided into a number of packets, each packet can, if necessary, be sent by a different route across the Internet. Packets can arrive in a different order than the order they were sent in. The Internet Protocol just delivers them. It's up to another protocol, the Transmission Control Protocol (TCP) to put them back in the right order.&lt;br /&gt; &lt;br /&gt;IP is a connectionless protocol, which means that there is no continuing connection between the end points that are communicating. Each packet that travels through the Internet is treated as an independent unit of data without any relation to any other unit of data. (The reason the packets do get put in the right order is because of TCP, the connection-oriented protocol that keeps track of the packet sequence in a message.) In the Open Systems Interconnection (OSI) communication model, IP is in layer 3, the Networking Layer.&lt;br /&gt; &lt;br /&gt;The most widely used version of IP today is Internet Protocol Version 4 (IPv4). However, IP Version 6 (IPv6) is also beginning to be supported. IPv6 provides for much longer addresses and therefore for the possibility of many more Internet users. IPv6 includes the capabilities of IPv4 and any server that can support IPv6 packets can also support IPv4 packets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-2837320161250806921?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/2837320161250806921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=2837320161250806921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/2837320161250806921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/2837320161250806921'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/internet-protocol.html' title='Internet Protocol'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-1745565031411911672</id><published>2008-05-18T22:44:00.000-07:00</published><updated>2008-05-18T22:45:07.873-07:00</updated><title type='text'>SOAP</title><content type='html'>SOAP (Simple Object Access Protocol) is a way for a program running in one kind of operating system (such as Windows 2000) to communicate with a progam in the same or another kind of an operating system (such as Linux) by using the World Wide Web's Hypertext Transfer Protocol (HTTP)and its Extensible Markup Language (XML) as the mechanisms for information exchange. Since Web protocols are installed and available for use by all major operating system platforms, HTTP and XML provide an already at-hand solution to the problem of how programs running under different operating systems in a network can communicate with each other. SOAP specifies exactly how to encode an HTTP header and an XML file so that a program in one computer can call a program in another computer and pass it information. It also specifies how the called program can return a response.&lt;br /&gt;&lt;br /&gt;SOAP was developed by Microsoft, DevelopMentor, and Userland Software and has been proposed as a standard interface to the Internet Engineering Task Force (IETF). It is somewhat similar to the Internet Inter-ORB Protocol (IIOP), a protocol that is part of the Common Object Request Broker Architecture (CORBA). Sun Microsystems' Remote Method Invocation (RMI) is a similar client/server interprogram protocol between programs written in Java.&lt;br /&gt; &lt;br /&gt;An advantage of SOAP is that program calls are much more likely to get through firewall servers that screen out requests other than those for known applications (through the designated port mechanism). Since HTTP requests are usually allowed through firewalls, programs using SOAP to communicate can be sure that they can communicate with programs anywhere.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-1745565031411911672?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/1745565031411911672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=1745565031411911672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/1745565031411911672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/1745565031411911672'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/soap.html' title='SOAP'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-5033909849984736841</id><published>2008-05-17T06:47:00.000-07:00</published><updated>2008-05-17T07:04:15.193-07:00</updated><title type='text'>Web Redirection</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Method 1 - .htaccess 301 Redirect&lt;/span&gt;&lt;br /&gt;The smoothest way to redirect your visitors is to use an .htaccess redirect. This has no delay since before a page is served to the browser the server checks first for an .htaccess file... if it sees this the old page never loads, instead visitors are sent directly to the new page.&lt;br /&gt;&lt;br /&gt;These are a few .htaccess redirect codes that I've used that might come in handy for you. This is not a complete list by any means, but it took me ages to find how to do these so I'll save you the hassle and list them here. Oh, and please don't email me with questions about how these work, like I said, I found these with the help of others.. I have no idea in the slightest how to write this stuff and take no credit (or responsibility) for how they work.&lt;br /&gt;&lt;br /&gt;If you're more technically minded than I am and want the information straight from the source, check the Apache Tutorial: .htaccess files for more detailed info.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Important notes about htaccess redirection&lt;/span&gt;&lt;br /&gt;1. Always be sure to upload .htaccess files in ascii mode, sending it up as binary will break it (and usually make your server very, very unhappy.)&lt;br /&gt;2. .htaccess does not work if you're on a windows server.&lt;br /&gt;3. Make sure you triple check your changes. Clear your cache and look, test the server headers to make sure you see a 301 (that means its permanent) not a 302 (temporary) unless you are absolutely sure you really mean temporary.&lt;br /&gt;4. Since some operating systems don't allow you to make a file without something before the "." you may need to save it as something.htaccess, some may even have to save it as htaccess.txt and change it once you've uploaded it.&lt;br /&gt;5. Make sure your ftp program will show .htaccess files (FileZilla does and is free) It is a bit hard to edit something you can't see ;)&lt;br /&gt;6. Double check that you're not overwriting an old one (some servers already place one there for your custom 404 pages etc.)&lt;br /&gt;7. Make sure you replace example.com with your own sites URL ;-)&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;span style="font-weight:bold;"&gt;301 Redirect Examples&lt;/span&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;span style="font-weight:bold;"&gt;To Move a single page&lt;/span&gt;&lt;br /&gt;Quick, easy and seamless for your visitors.&lt;br /&gt;Redirect 301 /oldpage.html http://www.example.com/newpage.html&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To Move an entire site&lt;/span&gt;&lt;br /&gt;This will catch any traffic on your old site and redirect it to your index page on your new server. If you want to redirect each page to its new spot, this isn't the one for you.&lt;br /&gt;Redirect 301 / http://www.example.com/&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Changed file extension?&lt;/span&gt;&lt;br /&gt;This example is perfect if you've decided to switch to .php from .html pages. It will look for any .html page and redirect it to .php (ie http://www.example.com/yourpage.html and redirect it to http://www.example.com/yourpage.php). Now, be careful with this, it does mean any html page. I did this on one of my sites and had totally forgotten I had an iframe with .html content on some pages... I didn't notice for weeks that it was broken :S.&lt;br /&gt;So learn from my mistake ;-) check, double check, then check again.&lt;br /&gt;RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Redirect www to non www version of site&lt;/span&gt;&lt;br /&gt;It's best to stick with either always using www.example.com or just example.com. Allowing both can confuse the search engines. So here's how to force your site to always show the non-www version. (Search for "canonical url errors" in your favorite search engine for more info.)&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Note:&lt;/span&gt;&lt;br /&gt;If you do use either of the next 2 codes below, and use a secure server (ie. https:) be sure to check that it doesn't redirect the secure to the insecure version. I'm pretty sure this will do that and that isn't something you want!&lt;br /&gt;&lt;br /&gt;Options +FollowSymLinks &lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteCond %{HTTP_HOST} .&lt;br /&gt;RewriteCond %{HTTP_HOST} !^example\.com&lt;br /&gt;RewriteRule (.*) http://example.com/$1 [R=301,L]&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Redirect non-www to www&lt;/span&gt;&lt;br /&gt;Same as above except in the reverse, this one forces the www. into your url.&lt;br /&gt;&lt;br /&gt;Options +FollowSymLinks &lt;br /&gt;RewriteEngine on &lt;br /&gt;RewriteCond %{HTTP_HOST} ^yoursite.com [NC] &lt;br /&gt;RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Method 2 - Meta Redirect&lt;/span&gt;&lt;br /&gt;I'd really advise against redirecting this way! Most search engine are having difficulties with this one (and spammers have been using this in very bad ways) and it might get your page in a heap of trouble! Some browsers also don't read it properly so your would-be visitors may get stranded. Seriously, it really isn't advisable to use this anymore but if you insist on trying it, here it is. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;meta http-equiv="refresh" content="10; url=http://example.com/" &lt;/span&gt;&lt;br /&gt;Content="10; tells the browser to wait 10 seconds before transfer, choose however long you would like, you can even choose 0 to give a smoother transition.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-5033909849984736841?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/5033909849984736841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=5033909849984736841' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5033909849984736841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5033909849984736841'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/web-redirection.html' title='Web Redirection'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-5179543470062649666</id><published>2008-05-16T22:40:00.000-07:00</published><updated>2008-05-16T22:42:33.425-07:00</updated><title type='text'>Are You Planning to Switch Job</title><content type='html'>You spend a large percentage of your waking hours at your job. How happy are you there? Will you be happier in a new job? To switch or not to switch is the perennial question many of us face today.&lt;br /&gt;&lt;br /&gt;If your job isn't working for you, don't panic or take it personally. A large percentage of employees switch jobs in such conditions. But, before you reach that decision, it is important to evaluate certain aspects -&lt;br /&gt;&lt;br /&gt;Are you a chronic job-switcher?&lt;br /&gt;&lt;br /&gt;"Whether it's for a good reason or bad, switching jobs is extremely common nowadays, especially in some professions -- software for example. The days when people kept only one job throughout their lives are gone. Today, the average CV usually contains several moves, especially early on in a career. In fact, it's even considered unambitious to spend too many years in one job," says Manisha Dutt, 29, a manager with a software firm in Gurgaon.&lt;br /&gt;&lt;br /&gt;However, an extreme case of 'job hopping,' such as one every year or even several times a year, definitely won't reflect well on your resume, especially if you are under 30. "This is because a company also spends a considerable amount on training new employees and is always looking at reducing employee turnover. In such a case, one look at your resume, and they may run in the other direction," says Kesarwani.&lt;br /&gt;&lt;br /&gt;Circumstances that demand a job change and those that don't -&lt;br /&gt;&lt;br /&gt;Some circumstances may warrant a job change, but others can be remedied. "The reason to get you to switch needs to be big -- reasons like lack of opportunities for growth, a move necessitated for family/ health reasons, need for a better salary, etc. Alternatively, you may know for sure that the new company is a great place to work in," says Pankaj Sharma, 27, an independent recruitment consultant in Delhi.&lt;br /&gt;&lt;br /&gt;Questions to ask yourself -&lt;br /&gt;Ask yourself the following questions regarding where you are at present (and be honest with your answers) -&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Do I really like my current job?&lt;br /&gt;    *&lt;br /&gt;      Do I enjoy working with my colleagues?&lt;br /&gt;    *&lt;br /&gt;      If I stay here, where will I be in two years time?&lt;br /&gt;    *&lt;br /&gt;      Could I be earning more elsewhere?&lt;br /&gt;    *&lt;br /&gt;      What are the intangible benefits of working here?&lt;br /&gt;    *&lt;br /&gt;      Is the technology one that I would like to align myself with in the future?&lt;br /&gt;&lt;br /&gt;Answer the questions using these broad parameters -&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Job quality (Is this what I want to do?)&lt;br /&gt;    *&lt;br /&gt;      Growth prospects (Can I stay in this job? Can I move up?)&lt;br /&gt;    *&lt;br /&gt;      More money (How much is enough?)&lt;br /&gt;    *&lt;br /&gt;      Mental stimulation&lt;br /&gt;    *&lt;br /&gt;      The importance of money.&lt;br /&gt;&lt;br /&gt;Money is good stuff - it pays for nice vacations, cool cars, education for your children, etc. Don't discount the money factor, especially if others are depending on you.&lt;br /&gt;&lt;br /&gt;"No matter what any one says, money does buy happiness. When you accumulate a significant amount as a buffer between yourself and poverty, and stop living one pay cheque at a time, your life completely changes. You gain the freedom to pursue other avenues, like your own business, a career change, a personal project, or a mentally enriching educational experience. Such freedom is an incomparable source of happiness and tranquility, and only money can grant it," says Kesarwani.&lt;br /&gt;&lt;br /&gt;However, if the new place totally rocks, you might consider working there and even taking a salary cut to jump ship if your current job is indeed a living nightmare.&lt;br /&gt;&lt;br /&gt;Do a cost-benefit analysis -&lt;br /&gt;&lt;br /&gt;Let's say you take home Rs 30,000 per month. You are offered a 20 per cent salary hike in the new job and see yourself now taking home Rs 36,000 a month. What will that extra Rs 6,000 a month (= Rs 72,000 a year) do for you?&lt;br /&gt;&lt;br /&gt;Will you blow it all on a plasma TV, stash it all in savings for an early retirement, eat out two or three more times a week, or go partying with your friends?&lt;br /&gt;&lt;br /&gt;What is the bottomline impact on your lifestyle that this raise will give you? How will this raise impact your work environment? Keeping in mind that you work eight hours or more a day, are these extras worth the anxiety and the risk involved in switching jobs? What risks do you have if you stay in your current job? In short, what is the opportunity cost?&lt;br /&gt;&lt;br /&gt;To cut to the chase, don't move only for financial reasons unless you're going to earn significantly more. Happiness, in terms of liking what you are doing and feeling that you are accomplishing something, is much more important. Eventually, the money won't be motivation enough to continue with the new job.&lt;br /&gt;&lt;br /&gt;Weigh the risks -&lt;br /&gt;&lt;br /&gt;Consider this - you already know what your current job is like and you like it. You know the people and get along with your colleagues, who are interesting people. Your boss treats you well.&lt;br /&gt;&lt;br /&gt;The new place might be even better and the offer may be 20 per cent more than what you're getting now. The people might all be nice, or there may be a few nut cases and backstabbers there. Your boss may steal the credit for the work you do.&lt;br /&gt;&lt;br /&gt;"Switching is a big risk; you are going out into the unknown. Chances are, the new place can be worse," says Sharma, who has experienced this himself.&lt;br /&gt;&lt;br /&gt;"Verify everything the potential boss tells you. Bosses try to make the job sound attractive in the same way that job applicants try to make themselves sound good," says Dutt.&lt;br /&gt;&lt;br /&gt;If you don't really want to quit -&lt;br /&gt;&lt;br /&gt;"The first step is to analyse why, and whether or not you really want to leave. Is it just because of one thing, such as a low salary or an interpersonal conflict? If so, you must communicate that to your manager and HR department. It could be better to first consider options such as moving to another department, or negotiating a salary hike rather than leaving the organisation," feels Dutt.&lt;br /&gt;&lt;br /&gt;Most problems at the workplace can be solved if both parties are willing to solve them. "A three-month trial can be experimented with to see if the situation can be resolved. Just like problems take time to develop, their solutions also take time to work," says Kesarwani.&lt;br /&gt;&lt;br /&gt;Keep your relationship with your colleagues and your company intact -&lt;br /&gt;&lt;br /&gt;The way in which you carry yourself during your transition can have a great impact on your career. It says as much about you professionally as the impression you had made on your first day. The people who you work with will make it a point to note your behaviour. If it is anywhere inappropriate or negative, the word can spread quickly. Keep in mind that this group you leave includes potential references.&lt;br /&gt;&lt;br /&gt;"Your last impression is just about as important as your first. It's vital to break away without any ill feeling, and leave behind an impeccable record. It's a small world and it could just happen that you work with, or for, the very same people again," says Sharma.&lt;br /&gt;&lt;br /&gt;So, it's important to leave on positive terms. Display professionalism. The right attitude is critical to building bridges, and not burning them, when you are at the threshold of assuming a new position.&lt;br /&gt;&lt;br /&gt;The guilt factor -&lt;br /&gt;&lt;br /&gt;"Only three months into my first job, I landed a new opportunity offering me 30 to 40 per cent more than my current job. I felt really bad leaving my current job and disappointing the people that gave me a chance to work there," says Dutt.&lt;br /&gt;&lt;br /&gt;"As for feeling bad about leaving, don't get all flustered about it. Everyone needs to grow, and employers themselves are aware of that," says Sharma. "The key for you is to determine whether it's the wrong job, the wrong employer, or the wrong career. Once you have made that decision, the ideal scenario is to locate a new job while you are still employed. Then, if you think what you get is better than your current job, don't feel guilty -- take it. They'll understand&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-5179543470062649666?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/5179543470062649666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=5179543470062649666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5179543470062649666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5179543470062649666'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/are-you-planning-to-switch-job.html' title='Are You Planning to Switch Job'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-4173715117387494451</id><published>2008-05-16T02:41:00.000-07:00</published><updated>2008-05-16T03:02:37.498-07:00</updated><title type='text'>Advantages of MYSQL 5 over MYSQL 4</title><content type='html'>o Stored procedures&lt;br /&gt;o Triggers&lt;br /&gt;o Views&lt;br /&gt;Lets first take a look at stored procedures. Stored procedures have many benefits in terms of performance and security. A stored procedure is a procedure that is that is stored in a database. This is sort of like a function or sub-routine in a regular computer language. Like functions in other languages, stored procedures come in two flavors, those that you call to perform a task or those that you call to return a value that you use in another part of the query. The main reason why you should use stored procedures is because of speed. Stored procedures are stored on the server so if you need to do a certain task over and over again, stored procedures will give great boosts in speed and also put less of a burden on the server because it will not need to send messages back and forth to the client machine since its all on the server side. Another advantage is that stored procedures are common throughout all MYSQL deployments. You never have to install an extension class or add-on feature to any MYSQL setup to get stored procedures to work. Not only will they work in all deployments of MYSQL, but since MYSQL uses standard SQL syntax and stored procedures are largely the same throughout any SQL database, you should be able to port your stored procedure code easily into either MSSQL, Oracle 10g or any other SQL based system.&lt;br /&gt;The second advantage we are going to look at in MYSQL 5 are triggers. A trigger is a piece of procedural code that is automatically executed in response to certain events that happen on a table or in a database. Triggers give programmers more control over what happens when a specific alteration is made to a table. It also can restrict access to specific data, perform logging, or audit data modifications.&lt;br /&gt;The final advantage that we will examine here are views. Views are a handy programming tool that MYSQL 5 developers can use to show actual code directly from the screen of the client program. This is useful for debugging and troubleshooting. Views are also often used to help write queries. There have been some performance problems with using the view function, but those will soon be resolved.&lt;br /&gt;With these three advantages, MYSQL 5 is definitely a step beyond MYSQL 4 and worth an upgrade now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-4173715117387494451?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/4173715117387494451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=4173715117387494451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/4173715117387494451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/4173715117387494451'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/advantages-of-mysql-5-over-mysql-4.html' title='Advantages of MYSQL 5 over MYSQL 4'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-9081746573098575533</id><published>2008-05-15T22:20:00.000-07:00</published><updated>2008-05-15T22:22:10.650-07:00</updated><title type='text'>What's New in PHP 5</title><content type='html'>&lt;a name="Heading1"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Only time will tell if the PHP 5 release will be as successful as the releases of its two predecessors (PHP 3 and PHP 4). The new features and changes aim to rid PHP of any weaknesses it may have had and make sure that it stays in the lead as the best web scripting language on the globe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;This book covers PHP 5 and its new features in great detail. However, for those of you familiar with PHP 4, and are eager to know what is new in PHP 5, then this chapter is for you. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The chapter will cover: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The new language features&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;News concerning PHP extensions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;h3&gt;&lt;a name="Heading2"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Language Features&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a name="Heading3"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;New Object Oriented model&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;When Zeev Suraski added the object-oriented syntax back in the days of PHP 3, it was added as "syntactic sugar for accessing collections". The object-oriented model also had support for inheritance and allowed a class (and object) to aggregate both methods and properties, but not much more. When Zeev and Andi rewrote the scripting engine for PHP 4, it was a completely new engine, running much faster, much more stable and with many more features. However, the object-oriented model first introduced in PHP 3, was barely touched. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Although the object model had serious limitations it was used extensively around the world, often in very large PHP applications. This impressive use of the OOP paradigm with PHP 4 despite its weaknesses led to it being the main focus for the PHP 5 release. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;So what were some of the limitations in PHP 3 and 4? The biggest limitation (which led to further limitations) was the fact that the copy semantics of objects were the same as for native types. So how did this actually affect the PHP developer? When you'd assign a variable (that points to an object) to another variable, a copy of the object would be created. Not only did this impact performance but it usually also lead to obscure behavior and bugs in PHP 4 applications because many developers thought that both variables would be pointing at the same object which wasn't the case. They were pointing at separate copies of the same object, changing one would not change the other. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;For example: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    var&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;getName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        return&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;setName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;setName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;changeName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;,&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;setName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Andi"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;changeName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;,&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Stig"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;getName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 4, this piece of code would print out &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;"Andi"&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;. The reason is that we pass the object &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; to the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;changeName()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; function by-value, and thus, &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; is copied and &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;changeName()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; works on a copy of &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;$person&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;This behavior is not very intuitive, as many developers would expect the Java-like behavior. In Java variables actually hold a handle (or pointers) to the object, and therefore, when it is copied only the handle and not the entire object is duplicated.&lt;br /&gt;There were two kinds of users in PHP 4, the ones who were aware of this problem and the ones who weren't. The latter would usually not notice this problem and their code was written in a way where it didn't really matter if the problem existed or not. Surely some of these people had sleepless nights trying to track down weird bugs which they couldn't pinpoint. The former group dealt with this problem by always passing and assigning objects by reference. This would prevent the engine from copying their objects but would be quite a headache as the code included numerous &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&amp;amp;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; signs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The old object model not only led to the above-mentioned problems but also led to fundamental problems that prevented implementing some additional features on top of the existing object model. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 5, the infrastructure of the object model was rewritten to work with object handles. Unless you explicitly clone an object by using the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;clone&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; keyword you will never create behind the scene duplicates of your objects. In PHP 5, there is neither a need to pass objects by reference nor assigning them by reference. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Note: Passing by reference and assigning by reference is still supported, in case you want to actually change a variable's content (whether object or other type). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a name="Heading4"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;New Object Oriented Features&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The new object oriented features are too numerous to give a detailed description in this section. The object oriented language chapter goes over each feature in detail. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The following is a list of the main new features: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;1. public/private/protected access modifiers for methods and properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Allows the use of common OO access modifiers to control access to methods and properties. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    private&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$id&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;18&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    public   function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;getId&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        return&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;id&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;2. Unified constructor name __construct()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Instead of the constructor being the name of the class, it should now be declared as &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;__construct()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;, making it easier to shift classes inside class hierarchies. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__construct&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Inside   constructor"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;3. Object destructor support by defining a __destructor() method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Allows defining a destructor function that runs when an object is destroyed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;&lt;?php&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__destruct&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Destroying   object"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;?&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;4. Interfaces&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Gives the ability for a class to fulfill more than one is-a relationships. A class can inherit from one class only but may implement as many interfaces as it wants. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;interface&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Display&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;display&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Circle implements   Display&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;display&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Displaying   circle "&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;5. instanceof operator&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Language level support for is-a relationship checking. The PHP 4 &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;is_a()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; function is now deprecated. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj instance of Circle&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;'$obj is a Circle'&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;6. final methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;final&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; keyword allows you to mark methods so that an inheriting class can't overload them. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    final   function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;getBaseClassName&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        return&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__CLASS__&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;7. final classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;After declaring a class as &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;final&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;, it can't be inherited. The following example would error out: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;final class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;FinalClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;BogusClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;extends&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;FinalClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;8. Explicit object cloning&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In order to clone an object you have to use the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;clone&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; keyword. You may declare a &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;__clone()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; method which will be called during the clone process (after the properties have been copied from the original object). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__clone&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Object is   being cloned"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;clone&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;9. Class constants&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Classes definitions can now include constant values, and are referenced using the class. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    const&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SUCCESS&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Success"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    const&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;FAILURE&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Failure"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SUCCESS&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;10. Static members&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Classes definitions can now include static members (properties), accessible via the class. Common usage of static members is in the Singleton pattern. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Singleton&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    static   private&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$instance&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;NULL&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    private   function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__construct&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    static public   function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;getInstance&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        if   (&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;self&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$instance&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;==&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;NULL&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;            &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;self&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$instance&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Singleton&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        return&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;self&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$instance&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;11. Static methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;You can now define methods as static allowing them to be called from non-object context. Static methods don't define the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;$this&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; variable as they aren't bound to any specific object. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;&lt;?php&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    static   function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;helloWorld&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Hello,   world"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;helloWorld&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;12. abstract classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;A class may be declared as &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;abstract&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; so as to prevent it from being instantiated. However, you may inherit from an abstract class. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;abstract class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyBaseClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;display&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;() {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Default   display routine being called"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;13. abstract methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;A method may be declared as &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;abstract&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;, thereby deferring its definition to an inheriting class. A class that includes abstract methods must be declared as &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;abstract&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;abstract class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyBaseClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    abstract   function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;display&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;14. Class type hints&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Function declarations may include class type hints for their parameters. If the functions are called with an incorrect class type an error occurs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;function&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;expectsMyClass&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass $obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt; &lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;15. Support for dereferencing objects which are returned from methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 4, you could not directly dereference objects which are returned from methods. You would have to first assign the object to a dummy variable and then dereference it.&lt;br /&gt;PHP 4: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$dummy&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;method&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$dummy&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;method2&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;PHP 5: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;method&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;()-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;method2&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;16. Iterators&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;PHP 5 allows both PHP classes and PHP extension classes to implement an Iterator interface. Once you implement this interface you will be able to iterate instances of the class by using the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;foreach()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; language construct. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyIteratorImplementation&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;foreach (&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;as&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$value&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"$value"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;For a more complete example, please refer to the "Advanced OOP &amp;amp; Design Patterns" chapter. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;17. __autoload()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class). In PHP 5, this is no longer necessary. You may define an &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;__autoload()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; function which is automatically called in case you are trying to use a class which hasn't been defined yet. By calling this function the scripting engine is giving a last chance to load the class before PHP bails out with an error. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;function&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__autoload&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$class_name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    include_once(&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$class_name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;.&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"php"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj    &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass1&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$obj2&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;MyClass2&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3&gt;&lt;a name="Heading5"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Other New Language Features&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;1. Exception handling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;PHP 5 adds the ability for the well known try/throw/catch structured exception handling paradigm. You are only allowed to throw objects which inherit from the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Exception&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; class. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;class&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SQLException&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;extends&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Exception&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    public&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$problem&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    function&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;__construct&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$problem&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;problem&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$problem&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;try&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    ...&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;throw&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SQLException&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Couldn't   connect to database"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    ...&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;catch&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SQLException $e&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Caught an   SQLException with problem $obj&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;problem"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;catch&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Exception $e&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"Caught   unrecognized exception"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Currently for backwards compatibility purposes most internal functions do not throw exceptions. However, new extensions are making use of this capability and you can use it in your own source code. Also, similar to the already existing &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;set_error_handler()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; you may use &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;set_exception_handler()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; to catch an unhandled exception before the script terminates. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;2. foreach with references&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 4, you could not iterate through an array and modify its values. PHP 5 supports this by allowing you to mark the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;foreach()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; loop with the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&amp;amp;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; (reference) sign, thus making any values you change affect the array you're iterating over. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;foreach (&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$array&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;as &amp;amp;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$value&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    if (&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$value&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;===&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"NULL"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$value&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;NULL&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;3. default values for by-reference parameters&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 4, default values could only be given to parameters which are passed by-value. Giving default values to by-reference parameters is now supported. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;function&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;my_func&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&amp;amp;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$arg&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;null&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    if (&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$arg&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;===&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;NULL&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;        print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;'$arg is empty'&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;my_func&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;();&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3&gt;&lt;a name="Heading6"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;General PHP changes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a name="Heading7"&gt;&lt;/a&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;XML and Web Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Following the changes in the language, the XML updates in PHP 5 are most probably the most significant and exciting. The enhanced XML functionality in PHP 5 puts it on par with other web technologies in some areas and overtakes them in others. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The Foundation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;XML support in PHP 4 was implemented using a variety of underlying XML libraries. SAX support was implemented using the old Expat library, XSLT was implemented using the Sablotron library (or using libxml2 via the DOM extension) and DOM was implemented using the more powerful libxml2 library by the GNOME project. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Using a variety of libraries did not make PHP 4 excel when it came to XML support. Maintenance was poor, new XML standards weren't always supported, performance wasn't as good as it could have been, and interoperability between the varies XML extensions did not exist. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 5, all XML extensions have been rewritten to use the superb libxml2 XML toolkit (&lt;a href="http://www.xmlsoft.org/"&gt;http://www.xmlsoft.org/&lt;/a&gt;). It is a very feature rich, highly maintained and efficient implementation of the XML standards bringing the cutting edge of XML technology to PHP.&lt;br /&gt;All the above mentioned extensions (SAX, DOM and XSLT) now use libxml2 including the new additional extensions SimpleXML and SOAP. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;SAX&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;As mentioned, the new SAX implementation has switched from using Expat to libxml2. Although the new extension should be compatible there may be some small subtle differences. Developers who still want to work with the Expat library can do so by configuring and building PHP accordingly (not recommended). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;DOM&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Although DOM support in PHP 4 was also based on the libxml2 library, it was quite buggy, had memory leaks and the API in many cases was not W3C compliant. The DOM extension went through a thorough facelift for PHP 5. Not only was the extension mostly rewritten it is now also W3C complaint. For example, function names now use studlyCaps as described by the W3C standard making it easier for you to read general W3C documentation and implementing what you learnt, right away in PHP. In addition, the DOM extension now supports three kinds of schemas for XML validation, DTD, XML Schema and RelaxNG. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;As a result of these changes PHP 4 code using DOM will not always run in PHP 5. However, in most cases adjusting the function names to the new standard will probably do the trick. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;XSLT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;In PHP 4, there were two extensions that supported XSL Transformations. The first was using the Sablotron extension and the second was using the XSLT support in the DOM extension. In PHP 5, a new XSL extension was written and, as mentioned, is based on the libxml2 extension. As in PHP 5, the XSL Transformation does not take the XSLT stylesheet as a parameter but depends on the DOM extension to load it, the stylesheet can be cached in memory and may be applied to many documents saving execution time &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;SimpleXML&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Probably when looking back in a year or two it will be clear that SimpleXML has revolutionized the way PHP developers work with XML files. SimpleXML could really be called "XML for Dummies". Instead of having to deal with DOM or even worse SAX, SimpleXML represents your XML file as a native PHP object. You can read, write or iterate over your XML file with ease accessing elements and attributes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Consider the following XML file: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;clients&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;&lt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    &lt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;John Doe&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    &lt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;account_number&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;87234838&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;account_number&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;&lt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    &lt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;Janet Smith&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;name&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    &lt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;account_number&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;72384329&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;account_number&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;&lt;/&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;clients&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The following piece of code prints each client's name and account number: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$clients&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;=&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;simplexml_load_file&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;'clients.xml'&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;foreach (&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$clients&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;as&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;) {&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;    print&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"$client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;name has account   number $client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;account_number&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;code&gt;&lt;span style="font-family: Verdana;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;It's obvious how simple SimpleXML really is. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;And in case there is something advanced you need to do to your SimpleXML object which isn't supported in this lightweight extension, you can convert it to a DOM tree by calling &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;dom_import_simplexml()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;, manipulate it in DOM and covert it back to SimpleXML using &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;simplexml_import_dom()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;. Thanks to both extensions using the same underlying XML library switching between these two has been made a reality. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;SOAP&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Official native SOAP support in PHP 4 was lacking. The most commonly used SOAP implementation was PEAR's but as it was implemented entirely in PHP it could not perform as well as a built-in C extension. Other available C extensions never reached stability and wide adoption and, therefore, were not included in the main PHP 5 distribution. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;SOAP support in PHP 5 was completely rewritten as a C extension and, although it was only completed at a very late stage in the beta process, it was incooperated into the default distribution due to its thorough implementation of most of the SOAP standard. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;The following calls &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;SomeFunction()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; defined in a WSDL file: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="" border="0" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0.75pt;"&gt;   &lt;p class="MsoNormal"&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;= new&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SoapClient&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(221, 0, 0);"&gt;"some.wsdl"&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$client&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;SomeFunction&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$a&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;,&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$b&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;,&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: black;"&gt; &lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 0, 187);"&gt;$c&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: 10pt; font-family: Verdana; color: rgb(0, 119, 0);"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3&gt;&lt;a name="Heading8"&gt;&lt;/a&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/h3&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-9081746573098575533?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/9081746573098575533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=9081746573098575533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/9081746573098575533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/9081746573098575533'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/whats-new-in-php-5.html' title='What&apos;s New in PHP 5'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-8270701313816822823</id><published>2008-05-14T22:34:00.000-07:00</published><updated>2008-05-14T22:35:36.737-07:00</updated><title type='text'>40 Tips for optimizing your php code</title><content type='html'>&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;If a method can be static, declare it static. Speed      improvement is by a factor of 4.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;em&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;echo&lt;/span&gt;&lt;/em&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt; is faster than &lt;em&gt;&lt;span style="font-family: Verdana;"&gt;print&lt;/span&gt;&lt;/em&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Use echo's multiple parameters instead of string      concatenation. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Set the maxvalue for your for-loops before and not in      the loop&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Unset your variables to free memory, especially large      arrays.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Avoid magic like __get, __set, __autoload&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;require_once() is expensive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Use full paths in includes and requires, less time      spent on resolving the OS paths.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;If you need to find out the time when the script      started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;See if you can use strncasecmp, strpbrk and stripos      instead of regex&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;str_replace is faster than preg_replace, but strtr is      faster than str_replace by a factor of 4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;If the function, such as string replacement function,      accepts both arrays and single characters as arguments, and if your      argument list is not too long, consider writing a few redundant      replacement statements, passing one character at a time, instead of one      line of code that accepts arrays as search and replace arguments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;It's better to use select statements than multi if,      else if, statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Error suppression with @ is very slow.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Turn on apache's mod_deflate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Close your database connections when you're done with      them&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;$row[’id’] is 7 times faster than $row[id]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Error messages are expensive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Do not use functions inside of for loop, such as for      ($x=0; $x &lt;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Incrementing a local variable in a method is the      fastest. Nearly the same as calling a local variable in a function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Incrementing a global variable is 2 times slow than a      local var.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Incrementing an object property (eg.      $this-&gt;prop++) is 3 times slower than a local variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Incrementing an undefined local variable is 9-10      times slower than a pre-initialized one.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Just declaring a global variable without using it in      a function also slows things down (by about the same amount as      incrementing a local var). PHP probably does a check to see if the global      exists.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Method invocation appears to be independent of the      number of methods defined in the class because I added 10 more methods to      the test class (before and after the test method) with no change in performance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Methods in derived classes run faster than ones      defined in the base class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;A function call with one parameter and an empty      function body takes about the same time as doing 7-8 $localvar++      operations. A similar method call is of course about 15 $localvar++      operations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Surrounding your string by ' instead of " will      make things interpret a little faster since php looks for variables inside      "..." but not inside '...'. Of course you can only do this when      you don't need to have variables in the string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;When echoing strings it's faster to separate them by      comma instead of dot. Note: This only works with echo, which is a function      that can take several strings as arguments. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;A PHP script will be served at least 2-10 times      slower than a static HTML page by Apache. Try to use more static HTML      pages and fewer scripts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Your PHP scripts are recompiled every time unless the      scripts are cached. Install a PHP caching product to typically increase      performance by 25-100% by removing compile times.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Cache as much as possible. Use memcached - memcached      is a high-performance memory object caching system intended to speed up      dynamic web applications by alleviating database load. OP code caches are      useful so that your script does not have to be compiled on every request&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;When working with strings and you need to check that      the string is either of a certain length you'd understandably would want      to use the strlen() function. This function is pretty quick since it's      operation does not perform any calculation but merely return the already      known length of a string available in the zval structure (internal C      struct used to store variables in PHP). However because strlen() is a      function it is still somewhat slow because the function call requires      several operations such as lowercase &amp;amp; hashtable lookup followed by      the execution of said function. In some instance you can improve the speed      of your code by using an isset() trick.&lt;br /&gt;     Ex.&lt;br /&gt;     if (strlen($foo) &lt; 5) { echo "Foo is too short"; }&lt;br /&gt;     vs.&lt;br /&gt;     if (!isset($foo{5})) { echo "Foo is too short"; }&lt;br /&gt;    &lt;br /&gt;     Calling isset() happens to be faster then strlen() because unlike      strlen(), isset() is a language construct and not a function meaning that      it's execution does not require function lookups and lowercase. This means      you have virtually no overhead on top of the actual code that determines      the string's length.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;When incrementing or decrementing the value of the      variable $i++ happens to be a tad slower then ++$i. This is something PHP      specific and does not apply to other languages, so don't go modifying your      C or Java code thinking it'll suddenly become faster, it won't. ++$i      happens to be faster in PHP because instead of 4 opcodes used for $i++ you      only need 3. Post incrementation actually causes in the creation of a      temporary var that is then incremented. While pre-incrementation increases      the original value directly. This is one of the optimization that opcode      optimized like Zend's PHP optimizer. It is a still a good idea to keep in      mind since not all opcode optimizers perform this optimization and there      are plenty of ISPs and servers running without an opcode optimizer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Not everything has to be OOP, often it is too much      overhead, each method and object call consumes a lot of memory. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Do not implement every data structure as a class,      arrays are useful, too&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Don't split methods too much, think, which code you      will really re-use&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;You can always split the code of a method later, when      needed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Make use of the countless predefined functions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;If you have very time consuming functions in your      code, consider writing them as C extensions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-8270701313816822823?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/8270701313816822823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=8270701313816822823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8270701313816822823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/8270701313816822823'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/40-tips-for-optimizing-your-php-code.html' title='40 Tips for optimizing your php code'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4272726899012395590.post-5481092594580828773</id><published>2008-05-07T05:15:00.000-07:00</published><updated>2008-05-07T05:17:15.192-07:00</updated><title type='text'>hi.... My Team</title><content type='html'>hi...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4272726899012395590-5481092594580828773?l=hetme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetme.blogspot.com/feeds/5481092594580828773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4272726899012395590&amp;postID=5481092594580828773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5481092594580828773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4272726899012395590/posts/default/5481092594580828773'/><link rel='alternate' type='text/html' href='http://hetme.blogspot.com/2008/05/hi-my-team.html' title='hi.... My Team'/><author><name>MuthuK</name><uri>http://www.blogger.com/profile/04602984613658790266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://1.bp.blogspot.com/_g9aMlr6K-8M/S3Eyh7T6fmI/AAAAAAAAAEs/MFM9Tibaris/S220/DSC00274.JPG'/></author><thr:total>0</thr:total></entry></feed>
