[php-src] Issue #13524: Extension API: zend_eval_string() only executes first statement
| From: | tstock5886 | Date: | Mon, 26 Feb 2024 22:32:21 +0000 |
| Subject: | [php-src] Issue #13524: Extension API: zend_eval_string() only executes first statement | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246473@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13524
Author: tstock5886
### Description
Perhaps this is a RTFM situation, but I can't see anywhere that this is spelled out, and I feel
like I have reason to believe it should function otherwise. Across a few versions (8.x), I can only
get zend_eval_string() to execute the FIRST of a series of statements passed to a call:
result = zend_eval_string("$a = 4; $b = 2; echo 'anything\n';", &retval,
"my lame example");
After execution $a is in the symbol table correctly set, but $b is nowhere to be found, and my
echo() statement doesn't execute, either. Am I doing something wrong, or do I have a bad
assumption about this function. If so, anyone want to recommend an alternative solution?
### PHP Version
PHP 8.2.x
### Operating System
_No response_