Professional Web Applications Themes

#26047 [WFx]: Access to supervariables via $$variable does not function as doented. - PHP Development

ID: 26047 User updated by: dw-bugs dot php dot net at botanicus dot net Reported By: dw-bugs dot php dot net at botanicus dot net Status: Wont fix Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.3.3 New Comment: Will this be fixed in Zend2? Previous Comments: ------------------------------------------------------------------------ [2003-10-31 04:44:04] [email]andiphp.net[/email] Hi, This is by-design and it's the price you have to pay for these special superglobals. A price which is worth paying... If this is not doented in the online docs then feel free to drop a line to [email]phpdoclists.php.net[/email] with the wording you think should be ...

  1. #1

    Default #26047 [WFx]: Access to supervariables via $$variable does not function as doented.

    ID: 26047
    User updated by: dw-bugs dot php dot net at botanicus dot net
    Reported By: dw-bugs dot php dot net at botanicus dot net
    Status: Wont fix
    Bug Type: Scripting Engine problem
    Operating System: Linux
    PHP Version: 4.3.3
    New Comment:

    Will this be fixed in Zend2?


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

    [2003-10-31 04:44:04] [email]andiphp.net[/email]

    Hi,

    This is by-design and it's the price you have to pay for these special
    superglobals. A price which is worth paying...
    If this is not doented in the online docs then feel free to drop a
    line to [email]phpdoclists.php.net[/email] with the wording you think should be added

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

    [2003-10-30 23:38:43] dw-bugs dot php dot net at botanicus dot net

    Description:
    ------------
    From the implementation I suppose this is pretty obvious, but the
    following does not work:

    $data_source = '_POST';
    $data =& $$data_source;

    '$data' does not point at $_POST as expected. I'd consider this a
    problem - your implementation is showing through. Either re-label
    $_POST, etc. as not actually being superglobals, or fix the underlying
    implementation (which does not at present match up with your
    doentation).

    """This is a 'superglobal', or automatic global, variable. This simply
    means that it is available in all scopes throughout a script."""

    This statement is not true, since the variable is only 'automatic
    global' when referred to by name directly (and thus gets caught by your
    special case code). It does not actually exist in every scope.

    I beg you not to mark this as a doentation problem and change the
    docs to mention this. Fix it! It's a horrible inconsistancy. This,
    along with a million other sour points, is the reason why I absolutely
    detest my day job at the minute. Come on guys! Do it for me!

    Reproduce code:
    ---------------
    $data_source = '_POST';
    $data =& $$data_source;

    echo gettype($data);

    Expected result:
    ----------------
    array

    Actual result:
    --------------
    NULL


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=26047&edit=1[/url]
    dw-bugs dot php dot net at botanicus dot net Guest

  2. #2

    Default #26047 [WFx]: Access to supervariables via $$variable does not function as doented.

    ID: 26047
    Updated by: [email]sniperphp.net[/email]
    Reported By: dw-bugs dot php dot net at botanicus dot net
    Status: Wont fix
    Bug Type: Scripting Engine problem
    Operating System: Linux
    PHP Version: 4.3.3
    New Comment:

    No.


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

    [2003-10-31 05:01:47] dw-bugs dot php dot net at botanicus dot net

    Will this be fixed in Zend2?

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

    [2003-10-31 04:44:04] [email]andiphp.net[/email]

    Hi,

    This is by-design and it's the price you have to pay for these special
    superglobals. A price which is worth paying...
    If this is not doented in the online docs then feel free to drop a
    line to [email]phpdoclists.php.net[/email] with the wording you think should be added

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

    [2003-10-30 23:38:43] dw-bugs dot php dot net at botanicus dot net

    Description:
    ------------
    From the implementation I suppose this is pretty obvious, but the
    following does not work:

    $data_source = '_POST';
    $data =& $$data_source;

    '$data' does not point at $_POST as expected. I'd consider this a
    problem - your implementation is showing through. Either re-label
    $_POST, etc. as not actually being superglobals, or fix the underlying
    implementation (which does not at present match up with your
    doentation).

    """This is a 'superglobal', or automatic global, variable. This simply
    means that it is available in all scopes throughout a script."""

    This statement is not true, since the variable is only 'automatic
    global' when referred to by name directly (and thus gets caught by your
    special case code). It does not actually exist in every scope.

    I beg you not to mark this as a doentation problem and change the
    docs to mention this. Fix it! It's a horrible inconsistancy. This,
    along with a million other sour points, is the reason why I absolutely
    detest my day job at the minute. Come on guys! Do it for me!

    Reproduce code:
    ---------------
    $data_source = '_POST';
    $data =& $$data_source;

    echo gettype($data);

    Expected result:
    ----------------
    array

    Actual result:
    --------------
    NULL


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


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

Similar Threads

  1. #26093 [Opn->Bgs]: access variable cause access violation
    By moriyoshi@php.net in forum PHP Development
    Replies: 0
    Last Post: November 3rd, 10:34 AM
  2. #26093 [NEW]: access variable cause access violation
    By bruno dot faust at ig dot com dot br in forum PHP Development
    Replies: 0
    Last Post: November 3rd, 10:28 AM
  3. Replies: 0
    Last Post: October 31st, 09:45 AM
  4. #26047 [NEW]: Access to supervariables via $$variable does not function as doented.
    By dw-bugs dot php dot net at botanicus dot net in forum PHP Development
    Replies: 0
    Last Post: October 31st, 04:39 AM
  5. Replies: 2
    Last Post: September 29th, 07:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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