Re: Cannot use string offset as an array
- From: "Álvaro G. Vicario" <alvaroNOSPAMTHANKS@xxxxxxxxxxxxxx>
- Date: Thu, 27 Nov 2008 14:09:30 +0100
Tree*Rat escribió:
if( $this->$switch_b[$i]['module_id'] == $id )
You are using variable variables inadvertently:
http://es2.php.net/language.variables.variable
An example:
<?php
class Foo{
private $bar = 'I am bar';
public function printBar(){
$name = 'bar';
echo $this->bar . "\n"; // Prints 'I am bar'
echo $this->$name . "\n"; // Also prints 'I am bar'
}
}
$f = new Foo;
echo $f->printBar();
?>
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
.
- References:
- Cannot use string offset as an array
- From: Tree*Rat
- Cannot use string offset as an array
- Prev by Date: Re: Cannot use string offset as an array
- Next by Date: Re: Get result from Google search
- Previous by thread: Re: Cannot use string offset as an array
- Index(es):
Relevant Pages
|