php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30411 Unecessary quotes in serialized strings
Submitted: 2004-10-12 15:57 UTC Modified: 2004-10-12 16:28 UTC
From: kell_pt at users dot sf dot net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.0.2 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kell_pt at users dot sf dot net
New email:
PHP Version: OS:

 

 [2004-10-12 15:57 UTC] kell_pt at users dot sf dot net
Description:
------------
This is not so much a bug report, but more of a remark - I just didn't know where to put it.

When serializing strings PHP includes double quotes. Seeing as it also stores the size, aren't quotes just a waste of space? I can't see them serving any purpose - any parser will merely read in the size and then read that many characters.

Reproduce code:
---------------
$str = serialize( array(
"company" => "101_e",
"country => "101_3",
) );

echo( $str );


Expected result:
----------------
a:2:{s:7:company;s:5:101_e;s:7:country;s:5:101_3;}

Actual result:
--------------
a:2:{s:7:"company";s:5:"101_e";s:7:"country";s:5:"101_3";}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-12 16:28 UTC] derick@php.net
This is not a bug, but just how it works. Making this a "Wont fix" feature request as we have no incentive of changing this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 20:01:35 2024 UTC