BYTE.com
RSS feed

Newsletter
Free E-mail Newsletter from BYTE.com
Email Address
First Name
Last Name




 
    
             
BYTE.com > Features > 2005

PHP 5 at Work

By Zeev Suraski

March 14, 2005

(PHP 5 at Work :  Page 1 of 1 )



PHP is one of the most popular web platforms in the world, surpassing platforms such as ASP and JSP that are backed by giant corporations. The recently released version 5 marks a new era for PHP. Not only did the best tool for the job get better, but it includes quite a few features that computer science zealots will find cool.

PHP 5 is actually the third incarnation of the language—the initial version was released as version 3 in order to make it clear that it succeeds and replaces the old PHP/FI 2, from which some ideas were borrowed.

Zend Engine II: Object Model Reloaded

One of the popular legends in the PHP world is that the PHP object model was nothing but the result of a single sleepless night of one of its authors, who thought it would be nice to be able to access arrays using C's arrow notation (foo->bar). Unfortunately, there's truth to this rumor.

When objects were introduced to one of the early language betas, circa 1997, they were virtually indistinguishable from arrays. In fact, one could use arrays as objects and vice versa interchangeably. While this fact had its upsides (mainly allowing people to use a cool-looking operator), it mostly came bundled with a lot of downsides. For one, objects behaved like any other native type in PHP, and more specifically, objects were passed around, to and from functions, by value. Secondly, due to the shared implementation with arrays, no object-specific features (such as access restrictions, type checking, etc.) were available.

The situation remained largely unchanged for six years, until now.

PHP 5 is based on the Zend Engine II, which in turn contains a completely new object model. At first glance, the new model may remind you of that of Java. This impression may stick for the second and third glance, and is actually likely to stay forever. Like Java, the Zend Engine II's object model is handle based, which effectively means that passing around an object—whether sending it to a function, or returning it from one—is going to result in the object itself being passed, rather than a copy.

 Page 1 of 1 


BYTE.com > Features > 2005
Dr. Dobb's Media Center
BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE: Volume 2 - Heuristic Algorithms
The Best of BYTE: Volume 2 - Heuristic Algorithms
In this volume of Best of BYTE, we explore the emergence of some heuristic algorithms. Although we have only scratched the surface of this intriguing subject, we hope we've suggested the potential of the synthesis of heuristics and algorithms.

© 2008 Think Services, Privacy Policy, Terms of Service, United Business Media Limited
Site comments: webmaster@byte.com
Web Sites: BYTE.com, dotnetjunkies.com, Dr. Dobb's Journal, SD Expo, Sys Admin, sqljunkies.com, Unixreview



MarketPlace
IT Service Management that Delivers. Real Value. Real Flexibility. Real Results. Free Demo.
Fast online exception analysis. Capture customer crash data online.
One Stop to Buy All Your Business IT Solutions. Browse Through Dell's Best Deals Online Now!
Find Scalable and Secure Dell� Network Server Solutions at Dell� - Official Site.
Advance Your Business Technology Now with the Thin and Portable Business Solutions at Dell.com Now!
Wanna see your ad here?
 

web2