note 98009 added to function.key

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Problem with classes, when extrasing key:

<?
 class klasa {
  function __construct($id_polaczenia_get=Null) {
   $this->config['local'] = Array ('key1' => 'value1',
    'key2'  => 'value2',
    'key3'  => 'value3');
  }
  function demo ($par=Null) {
   if ($par==Null) {
    $par = key ($this->config);  // should get 'local' key
  }

In this situation $par = Null instead of 'local'. After simple change:

  function demo ($par=Null) {
   if ($par==Null) {
    $___something = $this->config;
    $par = key ($this->config);
  }
it return properly key: 'local'.
----
Server IP: 194.24.174.37
Probable Submitter: 83.11.33.234
----
Manual Page -- http://www.php.net/manual/en/function.key.php
Edit        -- https://master.php.net/note/edit/98009
Del: integrated  -- https://master.php.net/note/delete/98009/integrated
Del: useless     -- https://master.php.net/note/delete/98009/useless
Del: bad code    -- https://master.php.net/note/delete/98009/bad+code
Del: spam        -- https://master.php.net/note/delete/98009/spam
Del: non-english -- https://master.php.net/note/delete/98009/non-english
Del: in docs     -- https://master.php.net/note/delete/98009/in+docs
Del: other reasons-- https://master.php.net/note/delete/98009
Reject      -- https://master.php.net/note/reject/98009
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.