diff options
-rw-r--r-- | Zend/zend_execute.h | 2 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index aeb79b7f2c..449e4e39de 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -53,7 +53,7 @@ void shutdown_executor(ELS_D); void execute(zend_op_array *op_array ELS_DC); ZEND_API int zend_is_true(zval *op); ZEND_API inline void safe_free_zval_ptr(zval *p); -ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC); +ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC); ZEND_API inline int i_zend_is_true(zval *op); ZEND_API int zval_update_constant(zval **pp); ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 8b30319425..f5916a1023 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -438,13 +438,14 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio } -ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC) +ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC) { zval pv; zend_op_array *new_op_array; zend_op_array *original_active_op_array = EG(active_op_array); zend_function_state *original_function_state_ptr = EG(function_state_ptr); int original_handle_op_arrays; + int retval; if (retval_ptr) { pv.value.str.len = strlen(str)+sizeof("return ;")-1; @@ -495,10 +496,12 @@ ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC) destroy_op_array(new_op_array); efree(new_op_array); EG(return_value_ptr_ptr) = original_return_value_ptr_ptr; + retval = SUCCESS; } else { - printf("Failed executing:\n%s\n", str); + retval = FAILURE; } zval_dtor(&pv); + return retval; } |