Bug #15135: improving eval() with context

From: Date: Mon, 21 Jan 2002 08:15:53 +0000
Subject: Bug #15135: improving eval() with context
Groups: php.dev 
Request: Send a blank email to php-dev+get-77645@lists.php.net to get a copy of this message
From: tom.polak@post.sk Operating system: Solaris PHP version: 4.1.0 PHP Bug Type: Feature/Change Request Bug description: improving eval() with context Hello, this request is related to #15101. Sample: function a($like){ $id, $name array; $val = "select ID, NAME from PEOPLE where NAME like\"{$like}\" into $id, $name"; $x = getContext(); sql_fetch_array($val, $x); show_result($id, $name); } function sql_fetch_array($query, $context){ ...there we separate into part of query, run i.e.mysql_fetch_array into $result, for each resulting row we run something like this: eval("$id[".$index."] = ".$result[ID], $context); } The thing logic is, that we can change variables ouside its regular scope. In this example we do it by previously saved "context". I propose this type of solution, because I have it already in my previous development tool. Maybe exist any more possibilities, how to do that. This is useful to write many of general functions for (in my case) high quality SQL support. If any other question about this, write me. Best regards, Tomas Polak -- Edit bug report at: http://bugs.php.net/?id=15135&edit=1

« previous php.dev (#77645) next »