note 92284 added to function.serialize
| From: | AlessandroSegala at osu1 dot php dot net | Date: | Fri, 17 Jul 2009 15:18:58 +0000 |
| Subject: | note 92284 added to function.serialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158419@lists.php.net to get a copy of this message | ||
I needed to serialize an array to store it inside a database.
I was looking for a fast, simple way to do serialization, and I came out with 2 options: serialize()
or json_encode().
I ran some benchmarks to see which is the faster, and, surprisingly, I found that serialize() is
always between 46% and 96% SLOWER than json_encode().
So, if you don't need to serialize objects and have the json extension available, consider
using it instead of serialize().
----
Server IP: 213.92.11.19
Probable Submitter: 79.44.250.49
----
Manual Page -- http://www.php.net/manual/en/function.serialize.php
Edit -- https://master.php.net/note/edit/92284
Del: integrated -- https://master.php.net/note/delete/92284/integrated
Del: useless -- https://master.php.net/note/delete/92284/useless
Del: bad code -- https://master.php.net/note/delete/92284/bad+code
Del: spam -- https://master.php.net/note/delete/92284/spam
Del: non-english -- https://master.php.net/note/delete/92284/non-english
Del: in docs -- https://master.php.net/note/delete/92284/in+docs
Del: other reasons-- https://master.php.net/note/delete/92284
Reject -- https://master.php.net/note/reject/92284
Search -- https://master.php.net/manage/user-notes.php