PHP 5.4 is the successor to PHP 5.3. It was released on March 1, 2012. Use this tag for version-specific issues relating to specifically to PHP 5.4.
PHP 5.4 Changes:
- Support for traits has been added.
- Short array syntax has been added, e.g.
$a = [1, 2, 3, 4];
or$a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];
. - Function array dereferencing has been added, e.g.
foo()[0]
. - Closures now support $this.
<?=
is now always available, regardless of the short_open_tag php.ini option.- Class member access on instantiation has been added, e.g.
(new Foo)->bar()
. Class::{expr}()
syntax is now supported.- Binary number format has been added, e.g.
0b001001101
. - Improved parse error messages and improved incompatible arguments warnings.
- The session extension can now track the upload progress of files.
- Built-in development web server in CLI mode.
See Migrating from PHP 5.3.x to PHP 5.4.x for more information.
Information
- If you want to talk about PHP or if you have a question, you can come to Chat Room 11: PHP.
- For global question on PHP, please use the generic tag: php