News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Slawek Lukasiewicz's Blog:
New Features in PHP 5.4 - JSON Extension & header_register_callback
March 05, 2012 @ 10:16:20

In the first two posts of his "features new to PHP 5.4" series Slawek Lukasiewicz has posted about two things that weren't mentioned very often in most of the 5.4 hit lists - improvements to the JSON extension and the header_register_callback method.

About the JSON extension improvements:

By default, when we pass object to json_encode function, it will return JSON representation of object public properties. [...] PHP 5.4 introduces JsonSerializable interface with JsonSerialize abstract method. After implementing this method we can independently set values used in JSON representation.

Related to the header_register_callback addition

After looking at new functions introduced in PHP 5.4 we can found one called header_register_callback. Using it, we can register callback which will be called before sending output.

The stable version of PHP 5.4 has officially been released, so get out there and grab it and start using these new features now!

0 comments voice your opinion now!
improvement release feature json extension headerregistercallback callback


blog comments powered by Disqus

Similar Posts

Ilia Alshanetsky's Blog: PHP 5.2.1RC4 Released!

Community News: Book Release: "Easy PHP Websites with the Zend Framework" (W. Jason Gilmore)

Ibuildings techPortal: DPCRadio: Web services for consumer devices

User Group: New York PHP Meeting - July 27th @ 6pm (Nate Abele & Hans Zaunere on PHP 5.3)

C7Y Community Site: Handling Images with PHP


Community Events

Don't see your event here?
Let us know!


voicesoftheelephpant interview performance api opinion introduction podcast version example library series extension release php7 laravel community framework symfony2 application composer

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework