note 98009 deleted from function.key by danbrown
| 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'.