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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 16:01:36 2025 UTC