From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.0.4pl1 PHP Bug Type: Class/Object related Bug description: eval adds function to global space rather than class method I am trying to generate class methods on the fly. I created a string which was php code for a function. I wished this funciton to be a class method. I call eval on the string, and it produces no errors. When I wish to call that method of the object, the script fails indicating a call to an undefined funciton. However, I can call that function in the page space, rather than as a class method. But, the function is useless unless it is a method. The following is part of the code that is executed in the constructor: $str = ""; foreach($this->getMappedAttributes() as $attribute) { $str .= "$"."this->_".$attribute['attribute']." = \"\";"; $str .= "function get".$attribute['attribute']."() {"; $str .= "return $"."this->_".$attribute['attribute'].";}"; } eval($str); -- Edit Bug report at: http://bugs.php.net/?id=9137&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]