80 likes | 91 Views
Learn about the new features and improvements in PHP 5 and MySQL 4.1, including object-oriented programming, MySQLi extension, XML support, and more.
E N D
Wrapping up… PHP 5 and MySQL 4.1
PHP 5 • Main features: • PHP 5 improves on PHP 4 in three major areas: • Object-oriented programming • MySQL • XML • These items have all been completely rewritten, turning them from limitations into star attractions. • Full article
Support for Object-Oriented Programming • Constructors (create an instance of a class) • Destructors (dispense with an instance) • Public, protected, and private properties and methods • Interfaces (defined way of accessing a class) • Abstract classes • Class type hints • Static properties and methods • Final properties and methods • A whole suite of magical methods • Full articles: [Object Design] [Object Primer]
MySQL support PHP 5 comes with a completely new and improved MySQL extension. Dubbed MySQLi, for MySQL Improved. It offers: • Prepared statements • Bound input and output parameters • SSL connections • Multi-query functions • MySQLi takes advantage of PHP 5's new object-oriented support to provide an OO interface to MySQL. On top of that, the latest versions of MySQL now enable subselects, transactions, and replication. • PHP 5 bundles SQLite, providing developers with a database that's guaranteed to work on all PHP 5 installations.
XML Support The new XML extensions: • Work together as a unified whole. • Are standardized on a single XML library: libxml2. • Fully comply with W3 specifications. • Efficiently process data. • Provide the right XML tool for your job • SimpleXML extension allows you to interact with the information in an XML document as though these pieces of information are arrays and objects, iterating through them with for-each loops, and editing them in place merely by assigning new values to variables.
Other improvements • Exception handling • SOAP implementation • Iterators are an incredibly handy way to abstract away messy details from code: $dir = opendir($path); while (false !== ($file = readdir($dir))) { print "$file\n"; }closedir($dir); foreach (new DirectoryIterator($path) as $file) { print "$file\n";} The Old Way The New Way
MySQL 4.1 Improvements: • Subqueries:SELECT (SELECT column1 FROM table1) FROM table2; • Testing membershipSELECT column1FROM table 1WHERE NOT EXISTS (SELECT column1 FROM table2); • Full article
So, the future… Looks Good! Thank you.