Pro PHP- Patterns, Frameworks, Testing and More
CHAPTER 4 ■ EXCEPTIONS^35 Listing 4-3. Throwing a Custom Exception function connectToDatabase() { if(!$conn = pg_connect(...)) { ...
(^36) CHAPTER 4 ■ EXCEPTIONS Listing 4-4. Creating a Logging Exception Base Class class LoggedException extends Exception { publ ...
CHAPTER 4 ■ EXCEPTIONS^37 set_exception_handler() function to substitute your own logging function that does not display informa ...
(^38) CHAPTER 4 ■ EXCEPTIONS Listing 4-6. Creating an Error Coding Custom Exception class DatabaseException extends Exception { ...
CHAPTER 4 ■ EXCEPTIONS^39 Type hinting is especially important when working with customized exceptions. By using type hinting an ...
(^40) CHAPTER 4 ■ EXCEPTIONS Just the Facts In this chapter, you were introduced to exceptions. You learned that the keywords tr ...
41 ■ ■ ■ CHAPTER 5 What's New in PHP 6 PHP 6 is a major upgrade to the PHP language. The core focus for PHP 6 is native Unicode ...
(^42) CHAPTER 5 ■ WHAT'S NEW IN PHP 6 apt-get install apache2.2-common apache2-mpm-prefork \ apache2-prefork-dev apache2-src ap ...
CHAPTER 5 ■ WHAT'S NEW IN PHP 6^43 PHP 6.0.0-dev (cli) (built: Dec 13 2007 16:59:43) Copyright (c) 1997-2007 The PHP Group Zend ...
(^44) CHAPTER 5 ■ WHAT'S NEW IN PHP 6 Unicode in PHP 6 The single biggest change in PHP 6 is the introduction of Unicode text-en ...
CHAPTER 5 ■ WHAT'S NEW IN PHP 6^45 Listing 5-4. Unicode String Length You will notice that the Unicode characters actually form ...
(^46) CHAPTER 5 ■ WHAT'S NEW IN PHP 6 Listing 5-6. Unicode Casting Note that not all characters can be converted to binary forma ...
CHAPTER 5 ■ WHAT'S NEW IN PHP 6^47 Array ( [0] => limonada [1] => llaves [2] => luna ) Array ( [0] => limonada [1] = ...
(^48) CHAPTER 5 ■ WHAT'S NEW IN PHP 6 Listing 5-9. Scope Resolution for Namespaces <?php require_once('Vector.php'); $line = ...
CHAPTER 5 ■ WHAT'S NEW IN PHP 6^49 Parent Value In this example, the render() method refers to self, which is ParentBase and not ...
(^50) CHAPTER 5 ■ WHAT'S NEW IN PHP 6 Dynamic Static Methods The __call() functionality allows you to create a wildcard type met ...
CHAPTER 5 ■ WHAT'S NEW IN PHP 6^51 from SimpleXML to full-fledged Document Object Model (DOM) creation. However, these options h ...
(^52) CHAPTER 5 ■ WHAT'S NEW IN PHP 6 $xml->endElement(); //body $xml->endElement(); //html $xml->endDocument(); $xml-& ...
■ ■ ■ PART 2 Testing and Documentation McArthur_819-9C06.fm Page 53 Friday, February 22, 2008 8:59 AM ...
McArthur_819-9C06.fm Page 54 Friday, February 22, 2008 8:59 AM ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf