Edit report at https://bugs.php.net/bug.php?id=61774&edit=1

 ID:                 61774
 Updated by:         ni...@php.net
 Reported by:        pandenitz at mail dot ru
 Summary:            Public object variables with numbers as name are not
                     public after unserialize
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Class/Object related
 Operating System:   Win 7 64x
 PHP Version:        5.3.11RC2
 Block user comment: N
 Private report:     N

 New Comment:

Actually, I just tried again with a more updated 5.3 build and it works fine 
there.

The issue was fixed in http://svn.php.net/viewvc?view=revision&revision=317438 
which shipped with PHP 5.3.9.

Could you check a PHP 5.3 build >= 5.3.9 and see whether the issue persists?


Previous Comments:
------------------------------------------------------------------------
[2012-04-19 22:38:40] ni...@php.net

Can repro on PHP 5.3, but not on 5.4. Everything fine there.

------------------------------------------------------------------------
[2012-04-19 14:43:30] pandenitz at mail dot ru

Description:
------------
Object variables with numbers as name are not public after unserialize.
So i.e. get_object_vars() doesn't return this vars because they are not public

Test script:
---------------
<?php

$a = new stdClass;
$varname = '1';
$a->$varname = 1;
$a->test = 1;

var_dump($a);
print_r($a);
echo '<hr/>';

$s = serialize($a);
$a2 = unserialize($s);

var_dump($a2);
print_r($a2);
echo '<hr/>';

var_dump(get_object_vars($a2));
print_r(get_object_vars($a2)); 

Expected result:
----------------
Such vars should be public after unserialize.

Actual result:
--------------
Vars are not actually public.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61774&edit=1

Reply via email to