Object-Oriented Programming with PHP5

Learn to leverage PHP5's OOP features to write manageable applications with ease

Object-Oriented Programming with PHP5

Hasin Hayder

2 customer reviews
Learn to leverage PHP5's OOP features to write manageable applications with ease
Packt Subscription
FREE
$9.99/m after trial
eBook
$16.80
RRP $23.99
Save 29%
Print + eBook
$39.99
RRP $39.99
What do I get with a Packt subscription?
  • Exclusive monthly discount - no contract
  • Unlimited access to entire Packt library of 6500+ eBooks and Videos
  • 120 new titles added every month, on new and emerging tech
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the subscription reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the subscription reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the subscription reader
$0.00
$16.80
$39.99
$0 p/m after trial
RRP $23.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 10 Day Trial

Frequently bought together


Object-Oriented Programming with PHP5 Book Cover
Object-Oriented Programming with PHP5
$ 23.99
$ 16.80
AJAX and PHP: Building Modern Web Applications 2nd Edition Book Cover
AJAX and PHP: Building Modern Web Applications 2nd Edition
$ 23.99
$ 16.80
Buy 2 for $33.60
Save $14.38
Add to Cart

Book Details

ISBN 139781847192561
Paperback272 pages

Book Description

Some basic objected-oriented features were added to PHP3; with PHP5 full support for object-oriented programming was added to PHP. Object-oriented programming was basically introduced to ease the development process as well as reduce the time of development by reducing the amount of code needed. OOP can greatly improve the performance of a properly planned and designed program.

This book covers all the general concepts of OOP then shows you how to make use of OOP in PHP5, with the aid of an ample number of examples.

Table of Contents

What You Will Learn

  • Understand the OOP features of PHP clearly
  • Write manageable code

Chapter 1 introduces object-oriented programming and how it fits for PHP. Some benefits of functional programming over procedural programming are highlighted.

In Chapter 2 you learn to create objects and define their properties and methods. Details of classes, properties, and methods follow, along with the scope of methods. This chapter shows you the benefits of using interfaces and a few other basic OOP features in PHP to kick start your journey through OOPing in PHP.

Now that you have got your basics done for OOP in PHP, Chapter 3 helps you to strengthen your base. It helps you to deal with more details and some advanced features. For example you learn about class information functions, using which you can investigate details of any class. This chapter takes you through some handy object-oriented information functions, exception handling, iterators, and storing objects using serialization.

In Chapter 4 you learn some of the Design Patterns and how to implement them in PHP. These are an essential part of OOP and make your code more effective, better performing, and easier to maintain. Sometimes we implement these design patterns in our code without knowing that these solutions are defined by design patterns. Proper usage of the correct pattern can make your code perform better; similarly using them improperly could make your code slower and less efficient.

Chapter 5 focuses on two very important features of object-oriented programming in PHP, reflection and unit testing. PHP5 replaces many old APIs with smarter new ones. One of these is the Reflection API, with which you can reverse or engineer any class or object to figure out its properties and methods. You can invoke those methods dynamically and more. Unit testing is an essential part of good, stable, and manageable application design. We focus on one very popular package, PHPUnit, which is a port of JUnit to PHP. If you follow the guidelines provided in this chapter you will be able to design your own unit tests successfully.

Some built-in objects and interfaces in PHP make life much easier for PHP developers. In Chapter 6 you will learn about the huge object repository named the Standard PHP Library or SPL.

Chapter 7: In this chapter we discuss the improved MySQL API known as MySQLi and take a basic look at PHP Data Objects (PDO), adoDB, and PEAR::MDB2. We take a look at the Active Record pattern in PHP using ADOdb's active record library and the Object-Relational Mapping (ORM) pattern using Propel. We focus on some specific topics that are interesting for PHP developers doing database access the OO way.

In Chapter 8, you learn to process XML with PHP. You get to know about different APIs like the SimpleXML API to read XML and the DOMDocument object to parse and create XML documents.

Chapter 9: In Chapter 4 you learned how design patterns can simplify your daily life in programming by providing you with a common approach for solving problems. One of the most used design patterns for application architecture is the Model-View-Controller (MVC) pattern. In this chapter we discuss the basic structure of MVC frameworks and then introduce you to some of these popular frameworks. Frameworks play a very important role in Rapid Development of PHP applications. You will learn how to build a framework in this chapter, which will also help you to understand object loading, data abstraction layers, and the importance of separation and finally you get a closer look at how applications are done.

Authors

Table of Contents

Book Details

ISBN 139781847192561
Paperback272 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

AJAX and PHP: Building Modern Web Applications 2nd Edition Book Cover
AJAX and PHP: Building Modern Web Applications 2nd Edition
$ 23.99
$ 16.80
Learning PHP Data Objects Book Cover
Learning PHP Data Objects
$ 23.99
$ 16.80
Instant Responsive Web Design Book Cover
Instant Responsive Web Design
$ 12.99
$ 9.10
Instant Passbook App Development for iOS How-to Book Cover
Instant Passbook App Development for iOS How-to
$ 9.99
$ 7.00
Instant Wireshark Starter Book Cover
Instant Wireshark Starter
$ 14.99
$ 10.50
Teaching with iPad How-To Book Cover
Teaching with iPad How-To
$ 12.99
$ 9.10