The document discusses modern PHP features such as exceptions, namespaces, closures, statics, short array syntax, PDO, security improvements, and popular PHP tools. It provides examples of how to use exceptions, closures, namespaces, statics, short array syntax, PDO, and security features. It also introduces the built-in PHP web server, Composer package manager, and PHPUnit testing framework as useful modern PHP tools.
64. Built-in Server
$ php -S localhost:8000
!
PHP 5.4.0 Development Server started…
Listening on localhost:8000
Document root is /home/ben/htdocs
Press Ctrl-C to quit
76. Unit Testing
class ApiAuthTest extends PHPUnit_Framework_TestCase {
!
public function testVerify() {
!
$auth = new apiAuth();
$this->assertTrue($auth->verify());
77. Unit Testing
class ApiAuthTest extends PHPUnit_Framework_TestCase {
!
public function testVerify() {
!
$auth = new apiAuth();
$this->assertTrue($auth->verify());
78. Unit Testing
$ phpunit tests
!
PHPUnit 3.3.17 by Sebastian Bergmann.
Time: 0.01 seconds
OK (1 tests, 1 assertions)