note 11805 modified in language.oop by tix
| From: | tix@php.net | Date: | Fri, 18 Jul 2003 07:50:17 +0000 |
| Subject: | note 11805 modified in language.oop by tix | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-52326@lists.php.net to get a copy of this message | ||
Something curious to note...
It seems you cannot call a parent object method via an eval() call.
Example:
class Math
{
function mul($x, $y)
{
return ($x * $y);
}
}
$result = Math::mul(5, 6); # works
$result = eval("Math::mul(5, 6);"); # doesn't work
[Editor's note: it's working, but not in this you do. Use eval('$result=Math::mul(5,
6);') instead. There's also an example in the manual for eval().]
--was--
Something curious to note...
It seems you cannot call a parent object method via an eval() call.
Example:
class Math
{
function mul($x, $y)
{
return ($x * $y);
}
}
$result = Math::mul(5, 6); # works
$result = eval("Math::mul(5, 6);"); # doesn't work
http://www.php.net/manual/en/language.oop.php