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

 ID:                 61774
 Comment 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
 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:

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


Previous Comments:
------------------------------------------------------------------------
[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