PHP 6 & The PHP Collaboration Project
Present & Future

Zeev Suraski
Co-founder & CTO, Zend Technologies
Co-architect of PHP

PHP 6 Key Improvements• Unicode support• Polish up OO including __toString() support everywhere• Improved SOAP support? (WS-Security, file attachments)• Remove legacy junk such as register_globals & safe_mode• The future will tell…

#2

Internationalization• A definition for i18n:§ The effort to make the Web usable to everyone regardless of

their preferred language or geographic location through theeffort of making all technologies operable across all languages
and writing systems.

• PHP will support Unicode standard§& Zend leading effort• Use the IBM ICU library:§ provides an open, flexible, portable foundation forapplications to use for their software globalization requirements.

• Bulk of core work already completed#3

Unicode String Literals••

With unicode_semantics=on, string literals are ofUnicode type1 character may be > 1 byte// unicode_semantics = on
$str = "hello world"; // Unicode
echo strlen($str); // result is 11$jp = "検索オプション"; // Unicode
echo strlen($str); // result is 7•

To obtain length in bytes one would use aseparate function#4

PHP Collaboration ProjectCommunity
Community

BestBest
Practices
Practices

PHP
PHP
Framework
Framework

PHP
Language

SOA,Web Services,etc.

OpenOpen
SourceSourceOpenOpen
IDE
IDE

#5

What do we need?
• SOA & Web Services:§ Finally software re-use truly seems to work. And not in its
previous copy-on-write incarnation.
§ Software re-use works across companies.
§ Increasingly important to support all (popular) forms ofWeb Services• Data is (still) King:§ Need to support all data (relational, XML, legacy)§ Data needs to be searchable#6

What do we need?
• Rich Interfaces:§ The world has acknowledged the deployment

advantages of the browser.
§ Ajax is a response to the need for a richer and easily
deployable interface in the browser.

• Continue the low barrier to entry:§ Continue building on PHP’s simplicity which has made ita success.
§ Open-source’s distribution advantages enables
companies to start playing and building on top oftechnology without a relationship with vendors.

#7

What do we need?
• Need for Best Practices:§ It is not trivial to architect, build and deploy stable,
secure and high-performing three tier Web apps
(Javascript à PHP à DB)• RAD:§ Time-to-market on the Web is becoming increasingly
critical.

#8The Importance of Simplicity"Things should be made as simple aspossible, but no simpler.“-- Albert Einstein• Simpler is easier to use.
• Simpler is more stable, and less prone to error.
• Simpler is more compatible.
• Simpler is easier to maintain.

Plagiarized from http://www.pantos.org/atw/35504.html#9Guiding Principles• Keep it “extremely simple” – stick to 20%/80% rule andcompensate by:§ Extensibility§ Use-at-will architecture§ Configuration-less• Cherry pick best-of-breed ideas• Showcase current trends in Web development (WebServices, Ajax, Search, Syndication, …)• Document development with use-cases• Only high quality and necessary components• Play nicely with others# 10How does the PHP Collaboration
Project fit in?
• SOA & Web Services:§ Zend Framework has a large focus on Web Services• Zend_Feed, Zend_Service_*§ Eclipse (Web Tools Project):• WSDL/XSD graphical editors• UDDI/WSDL Explorer• PHP code completion for WSDL

# 11

How does the PHP Collaboration
Project fit in?
• Data is (still) King:§

Zend Framework:§

Eclipse (DTP Project):• Zend_Db, Zend_Search_Lucene• Support for XML databases• SQL Editing• SQL Visual Query building• SQL Debugging# 12

How does the PHP Collaboration
Project fit in?
• Rich Interfaces§ Zend Framework:• Ajax and event model• Json, Widgets§ Eclipse (ATF – Ajax Toolkit Framework)• Javascript editor• Javascript debugger• DOM inspector• Toolkit specific functionality (Rico, Zimbra, Dojo)• Best Practices§ Zend Developer Zone (devzone.zend.com)§ Zend Framework# 13

Where are we heading?

RAD• Component architecture§ Both visual and non-visual components• Rich-design time experience ala Delphi andVisual Basic§ Drag&drop of components onto the Web page

• Component is self-contained incl. design andrun-time rendering & property editors§ IDEs don’t have to be hard coded per-component• WYSIAWYG• Programmatic model# 15

Key issues• Differentiating between run-time and design-time rendering• Isolation of HTML & component generated HTML• Client & server side event model• Property editing§ HTML?

• Themes§ Standard CSS as a recommendation to componentauthors# 16How does it all work?

Friendly Licenses• Zend Framework – PHP-like license• PHP IDE – Eclipse license
Using these licenses bares great advantages:• Allows commercial use free of charge, no strings
attached• Attracts developers• Licenses are well respected and widely proven# 18

Building the Community• Industry-wide collaborative effort led by Zend
including ISVs, integrators, experts both fromsmall and large companies including:§ 100days.de§ IBM§ Ning.com§ php|architect§ Omni TI§ Security experts (Chris Shiflett)§ JamboWorks§ and others…

# 19

Development Process(Framework)• Components designed by small teams• Proposals written and reviewed before coding• All code starts from scratch• Real Life Tests# 20

Quality Assurance• Strict adherence to Zend Coding Standards• All classes fully unit tested with PHPUnit2• Peer-review and approval of all code

# 21More Examples

ZActiveRecord

Declare a class that extends ZActiveRecord for each database table.
Create a new instance of the class to make a new row.

The fields in the table become
properties of the object automatically.

INSERT new records or UPDATE
existing ones by calling save().

# 23

ZActiveRecord
For simple queries, supply the search parameters to one of the find()methods without needing to write SELECT statements in SQL.

For more complicated queries, KISS. No large OO-based query builder isprovided. Just write the SQL and use findBySql(). Optionally, the ZDbAdapters
include a simple tool for building SELECT statements to pass to findBySql().

# 24

ZMailOnce the transport has been configured (defaults to SMTP), simply build theemail and send() it.

In the example above, ZMail automatically builds the multipart email andpasses it to the transport, which sends it over a persistent SMTP connection.
# 25

ZSearch
Both a simple query API and an advanced OO-style query builder are provided.
For searching simple words and phrases, use the find() method.

Each hit returns a document object. Documents are divided into fields thatare chosen at the time of indexing. The documents in the index do not all need
to be the same format – they may have any mix of fields.

# 26

ZSearch
Complex query strings may be passed to ZSearch::find(). ZSearch includes atokenizer and a parser to allows for Google-like query strings to be added
to any website.

The example above searches all documents of all fields for “zend” and “php”
but not “java”.
Individual fields may also be specified: “-fieldName:content”.
# 27

Resources• Zend Framework § http://framework.zend.com• PHP IDE project at Eclipse.org § http://www.eclipse.org/php/ (TBD)• Zend Developer Zone § http://devzone.zend.com# 28

Grazie!