note 98009 deleted from function.key by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: bulimaxiu at op dot pl
Reason: 2

----

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'.
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.