News Feed
Sections




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

DZone.com:
How to correctly work with PHP serialization
August 29, 2012 @ 08:19:37

In this new post to DZone.com today Giorgio Sironi takes a look at the serializing functionality in PHP and how it works with both regular variables and objects.

PHP is able to automatically serialize most of its variables to strings - letting you save them into storage like $_SESSION. However, there are some tweaks you have to know to avoid exploding .php scripts and performance problems.

He gives some code snippets showing the serialization of variables and objects and points out a few things that can't be effectively serialized (like resources and closures). The mentions the "__sleep" and "__wakeup" magic methods for automatic class serialization and mentions the Serializable interface that comes built in to PHP.

0 comments voice your opinion now!
serialize variable object tutorial sleep wakeup serializable interface


blog comments powered by Disqus

Similar Posts

Builder.com.au: Text-size switching with PHP and CSS

IBM developerWorks: What's new in PHP V5.2, Part 4: Using the new ZIP extension

PHPMaster.com: Role Based Access Control in PHP

SitePoint PHP Blog: The Joy of Regular Expressions [2]

ParanoidFerret.com: Flex & PHP Tutorial - Transmitting data using JSON


Community Events

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


example laravel voicesoftheelephpant api library framework introduction interview configure performance application conference podcast language opinion symfony2 release community series php7

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