- define a string that has a function call in it (that returns a string)
that at the time of declaration is not in scope, eg

$str = "this is the name : \$node->getName()"; // $node is _not_ defined
currently, so we can't escape out

....

then, later on in the code, this string will be passed to a function that
has $node in scope, and that's when I want to eval the string to replace the
value.

$node = new Node($argwhatever);
eval("\$str=\"$str\";"); // $node is now in scope, so I'd really like
$node->getName to return something meaningful

Anyone able to solve this one? Yesterday I could achieve most other
requirements with eval, but this one has me stumped.

cheers,
neko



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to