Skip to content

Commit

Permalink
#2370 - Adjust zephir_eval_php() for PHP8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Sep 19, 2022
1 parent cc3a742 commit d80317b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions kernels/ZendEngine3/fcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,15 +693,19 @@ void zephir_eval_php(zval *str, zval *retval_ptr, char *context)

original_compiler_options = CG(compiler_options);
CG(compiler_options) = ZEND_COMPILE_DEFAULT_FOR_EVAL;
#if PHP_VERSION_ID < 80000
new_op_array = zend_compile_string(str, context);
#if PHP_VERSION_ID >= 80200
new_op_array = zend_compile_string(Z_STR_P(str), context, ZEND_COMPILE_POSITION_AFTER_OPEN_TAG);
#else
#if PHP_VERSION_ID >= 80000
new_op_array = zend_compile_string(Z_STR_P(str), context);
#else
new_op_array = zend_compile_string(str, context);
#endif
#endif

CG(compiler_options) = original_compiler_options;

if (new_op_array)
{
if (new_op_array) {
EG(no_extensions) = 1;
zend_try {
zend_execute(new_op_array, &local_retval);
Expand Down

0 comments on commit d80317b

Please sign in to comment.