PHP4.0.3pl1 & serialize() function
| From: | Jarosław Lewandowski | Date: | Mon, 30 Oct 2000 13:34:31 +0000 |
| Subject: | PHP4.0.3pl1 & serialize() function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22675@lists.php.net to get a copy of this message | ||
Hi,
I think something is wrong in serialize(...) function in new version of
PHP4.0.3pl1.
In new source code (./ext/standard/var.c) there are a little change, it
excludes
serializing of references in array's. But in PHP code below there are no
references
as an array element, so it should work like in previous version of PHP...
Here is PHP code which output differs using php4.0.3pl1 and php4.0.2. :
| <pre>
| <?
| $MY_VARS = array();
|
| $foo = &$MY_VARS["foo"];
|
| $foo = "testing, 1, 2, 3";
|
| print_r($MY_VARS);
|
| echo serialize($MY_VARS);
| ?>
| </pre>
Output from php4.0.3pl1
> Array
> (
> [foo] => testing, 1, 2, 3
> )
> a:1:{}
Output from php4.0.2
> Array
> (
> [foo] => testing, 1, 2, 3
> )
> a:1:{s:3:"foo";s:16:"testing, 1, 2, 3";}