#40794 [NEW]: ReflectionObject::getValue()

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40794 [NEW]: ReflectionObject::getValue()

    From: igor at webta dot net
    Operating system: FreeBSD 6.0-RELEASE
    PHP version: 5.2.1
    PHP Bug Type: Reproducible crash
    Bug description: ReflectionObject::getValue()

    Description:
    ------------
    The following example results in a segfault in PHP 5:

    Reproduce code:
    ---------------
    <?
    $obj = new stdClass();
    $obj->prop1 = '1';
    $obj->prop2 = '2';

    $reflect = new ReflectionObject($obj);

    $array = array();
    foreach($reflect->getProperties() as $prop)
    {
    $array[$prop->getName()] = $prop->getValue($obj);
    }

    print_r($array);
    ?>

    Expected result:
    ----------------
    Array
    (
    [prop1] => 1
    [prop2] => 2
    )

    Actual result:
    --------------
    Segmentation fault (core dumped)

    (gdb) backtrace
    #0 0x0808a5fa in zim_reflection_property_getValue ()
    #1 0x081501b6 in zend_do_fcall_common_helper_SPEC ()
    #2 0x0814f915 in execute ()
    #3 0x08137fcf in zend_execute_scripts ()
    #4 0x08101f41 in php_execute_script ()
    #5 0x081b0934 in main ()


    --
    Edit bug report at [url]http://bugs.php.net/?id=40794&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40794&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40794&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40794&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40794&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40794&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40794&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40794&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40794&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40794&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40794&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40794&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40794&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40794&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40794&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40794&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40794&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40794&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40794&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40794&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40794&r=mysqlcfg[/url]
    igor at webta dot net Guest

  2. Similar Questions and Discussions

    1. DataGrid WebControl does not use PropertyDescriptor.GetValue
      I have a custom collection object that implements ITypedList. The GetItemProperties method returns a collection of custom property descriptors. ...
    2. Why "getvalue" not difined in Flash MX 2004
      I used getvalue help, but there is nothing, why? and is there any script not avialble?
    3. Why is the PropertyDescriptor's GetValue method called multiple times when selecting the descriptor into the PropertyGrid?
      i have a scenario in which i am using a ICustomTypeDescriptor in combination with an inherited PropertyDescriptor class to display information about...
    4. $object->getObject()->getValue; Hmmm why not?
      I'm wondering why this won't work. $someObject->getSomeMemberObject()->getSomeValue(); Anyone have any ideas?? TIA
  3. #2

    Default #40794 [Opn->Fbk]: ReflectionObject::getValue()

    ID: 40794
    Updated by: [email]tony2001@php.net[/email]
    Reported By: igor at webta dot net
    -Status: Open
    +Status: Feedback
    Bug Type: Reproducible crash
    Operating System: FreeBSD 6.0-RELEASE
    PHP Version: 5.2.1
    New Comment:

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php5.2-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php5.2-win32-latest.zip[/url]




    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-13 16:59:48] igor at webta dot net

    Description:
    ------------
    The following example results in a segfault in PHP 5:

    Reproduce code:
    ---------------
    <?
    $obj = new stdClass();
    $obj->prop1 = '1';
    $obj->prop2 = '2';

    $reflect = new ReflectionObject($obj);

    $array = array();
    foreach($reflect->getProperties() as $prop)
    {
    $array[$prop->getName()] = $prop->getValue($obj);
    }

    print_r($array);
    ?>

    Expected result:
    ----------------
    Array
    (
    [prop1] => 1
    [prop2] => 2
    )

    Actual result:
    --------------
    Segmentation fault (core dumped)

    (gdb) backtrace
    #0 0x0808a5fa in zim_reflection_property_getValue ()
    #1 0x081501b6 in zend_do_fcall_common_helper_SPEC ()
    #2 0x0814f915 in execute ()
    #3 0x08137fcf in zend_execute_scripts ()
    #4 0x08101f41 in php_execute_script ()
    #5 0x081b0934 in main ()



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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40794&edit=1[/url]
    tony2001@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139