Skip to Main Content
Upgrading to PHP 5
book

Upgrading to PHP 5

by Adam Trachtenberg
July 2004
Intermediate to advanced content levelIntermediate to advanced
350 pages
10h 9m
English
O'Reilly Media, Inc.
Content preview from Upgrading to PHP 5

Appendix B. Additional New Features and Minor Changes

This appendix covers the changes made in PHP 5 that aren’t documented elsewhere in the book. Some sections discuss new features, such as the command-line processing options. Other sections contain slight modifications of existing features, such as what happens when you incorrectly treat a string as an array, or how strrpos( ) handles its needle. These fixes will trip you up if you’re relying on PHP 4 behavior.

Passing Optional Parameters by Reference

You can now pass optional parameters by reference. For example:

function updateAddress(&$address = 'NULL') {

}

In PHP 4, you could declare a parameter as either optional or pass-by-reference, but not both. PHP 5 removes this limitation.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Expert PHP and MySQL®

Expert PHP and MySQL®

Andrew Curioso, Ronald Bradford, Patrick Galbraith
Pro PHP Programming

Pro PHP Programming

Peter MacIntyre, Brian Danchilla, Mladen Gogala
Mastering PHP 7

Mastering PHP 7

Branko Ajzele

Publisher Resources

ISBN: 0596006365Supplemental ContentCatalog PageErrata