• Home
  • Flailing Wildly
  • Résumé
  • Design
  • Code
  • Wishlist
  • About Me

Flailing Wildly
Too much straw, not enough camel.

Awesome new features coming in PHP 5.4

by Ryan Parman • November 11, 2011 • Code, Software • No comments

The next version of PHP, which saw its first release candidate today, has some really awesome new features. You can see a complete list of changes in the README, but here are the ones that caught my eye.

Classes

  • Support for Traits (i.e., mix-ins; addresses the multiple-inheritance problem).
  • Support for chaining from the constructor: (new Class)->method()
  • Support for Class::{expr}() syntax.
  • Closures inherit $this from the outer scope.
  • Added ReflectionClass::newInstanceWithoutConstructor() to create a new instance of a class without invoking its constructor.
  • Added a new typehint: callable

Improvements

  • Array dereferencing and short array syntax: echo [1, 2, 3][0]
  • json_encode() now supports these additional flags: JSON_UNESCAPED_UNICODE, JSON_BIGINT_AS_STRING, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT and JSON_UNESCAPED_SLASHES.
  • Multibyte support is enabled by default.
  • Faster unserialize() and ternary operator performance.
  • IPv6 support.

Fixing the cruft

  • ext/mysql, mysqli and pdo_mysql now use mysqlnd by default.
  • Removed magic quotes, safe mode, register globals, allow call-time pass-by-reference, and more!
  • Default character set is now UTF-8 instead of ISO-8859-1.
Ryan Parman

Ryan Parman is an entrepreneur, open source evangelist and passionate usability advocate currently living in Seattle. He is the founder and visionary behind SimplePie and CloudFusion, co-founder of WarpShare, member of the RSS Advisory Board, and creator of the AWS SDK for PHP. Ryan's aptly-named blog, Flailing Wildly, is where he writes about ideas longer than 140 characters.

« How to make technical professionals not hate your guts: A guide for technical recruiters
Clueless Recruiters, Issue #2 »

Have your say

Login with your favorite account to leave a comment!

Blog search

Archives
  • 2016 (1)
  • 2015 (3)
  • 2014 (6)
  • 2013 (15)
  • 2012 (16)
  • 2011 (27)
  • 2010 (9)
  • 2009 (6)
  • 2008 (12)
  • 2007 (8)
  • 2006 (18)
  • 2005 (57)
  • 2004 (104)
  • 2003 (103)
Categories
  • Apple (62)
  • Browsers (56)
  • Cloud Computing (5)
  • Clueless Recruiters (9)
  • Code (60)
  • Community (2)
  • Creating Websites (32)
  • Culture (8)
  • Design (7)
  • Digital Media (9)
  • Family Life (12)
  • Just for Fun (27)
  • Law (2)
  • Life Lessons (2)
  • Music (5)
  • Notable Quotes (1)
  • Passwords (4)
  • Personal (41)
  • Political (17)
  • Projects (49)
  • Security (6)
  • Software (69)
  • Syndication (28)
  • Technology (92)
  • The Hiring Process (1)
  • Tutorials (9)
  • TV and Movies (17)
  • Video Games (6)
  • Website (62)
  • Work and Business (8)
  • Writing (4)
Socially-aware

Twitter • Facebook • YouTube • Yelp! • Flickr • Instagram • Zerply • LinkedIn • Last.fm • Spotify • Rdio • Pinboard • gdgt

Claim to fame
  • Amazon Web Services
  • WarpShare
  • CloudFusion
  • SimplePie
Legal mumbo-jumbo

All ideas, opinions and comments I post are my own and are in no way affiliated with anybody I work with. If you quote and/or reprint something I've written or said, please direct folks back to this site as a form of attribution. I promise I'll do the same for you. Unless otherwise noted, all content on this site is copyright © 1979–2011 Ryan Parman.

Powered by Rocket Sauce. A Ryan Parman production.