Traits:
As we all know PHP doesn’t support multiple inheritance. However, PHP implements the support to have classes with multiple interfaces since v5.
You can define a trait practically the same way you define a class or interface with functions you need.
Traits do not provide state in the form of properties, but only an interpreter-assisted copy & paste of methods.
Traits have a conflict resolution mechanism, multiple traits can be used in the same class even if some method names are overlapping.
<?php
class Base {
public function sayHello() {
echo 'Hello ';
}
}
trait SayWorld {
public function sayHello() {
parent::sayHello();
echo 'World!';
}
}
class MyHelloWorld extends Base {
use SayWorld;
}
$o = new MyHelloWorld();
$o->sayHello();
?>
Built-In Web Server:
PHP 5.4 is coming with a built in HTTP web server. Now you can test your applications on your local machine without having Apache or any other web server What you need is only PHP 5.4 installation.
Command to run PHP as Web Server:
$ php -S localhost:8000
Server is listening on localhost:8000... Press CTRL-C to quit.
Deprecations:
- Magic quotes options have been deprecated.
- PHP namespace is removed
- E_STRICT errors, are now covered by E_ALL.






