PHP 5.4 Changes
From the PHP 5.4.0 RC1 "NEWS" file.
- Traits
- Class member access on instantiation:
(new Foo)->bar()
- Short array syntax:
['blue', 'red']
- ext/mysql, mysqli and pdo_mysql now use mysqlnd by default
- New typehint:
function( callable $callback )
Closure::bind()
andClosure::bindTo()
Class::{"foo$bar"}()
- Method call through array:
$cb = array($obj, 'method'); $cb( $args );
- Built-in web server:
php -S localhost:8080
<?=
is now always available regardless of the short_open_tag setting (pure PHP templates ftw)
In addition to safe mode being removed, there's also this:
Removed
magic_quotes_gpc
,magic_quotes_runtime
andmagic_quotes_sybase
ini options.get_magic_quotes_gpc
,get_magic_quotes_runtime
are kept but always return false,set_magic_quotes_runtime
raises anE_CORE_ERROR
. (Pierrick, Pierre)