summaryrefslogtreecommitdiff
path: root/src/sp_execute.c
diff options
context:
space:
mode:
authorjvoisin2022-12-08 21:08:38 +0100
committerjvoisin2022-12-09 20:03:22 +0100
commit110daa81c3b11ec102daf4ee634e2f3d2e9c5f36 (patch)
treec88c95f7abfefc5d86a98d9294edade9e38f18f7 /src/sp_execute.c
parent93c2c5632e27549d95fb7d9493769f013e49a749 (diff)
Portability improvements for PHP8.2
Diffstat (limited to 'src/sp_execute.c')
-rw-r--r--src/sp_execute.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sp_execute.c b/src/sp_execute.c
index 5c0c939..84f6275 100644
--- a/src/sp_execute.c
+++ b/src/sp_execute.c
@@ -336,7 +336,11 @@ static zend_result sp_stream_open(zend_file_handle *handle) {
336 336
337ZEND_API zend_op_array* (*orig_zend_compile_file)(zend_file_handle* file_handle, 337ZEND_API zend_op_array* (*orig_zend_compile_file)(zend_file_handle* file_handle,
338 int type) = NULL; 338 int type) = NULL;
339#if PHP_VERSION_ID >= 80000 339#if PHP_VERSION_ID >= 82000
340ZEND_API zend_op_array* (*orig_zend_compile_string)(
341 zend_string* source_string, const char* filename,
342 enum _zend_compile_position position) = NULL;
343#elif PHP_VERSION_ID >= 80000
340ZEND_API zend_op_array* (*orig_zend_compile_string)( 344ZEND_API zend_op_array* (*orig_zend_compile_string)(
341 zend_string* source_string, const char* filename) = NULL; 345 zend_string* source_string, const char* filename) = NULL;
342#else 346#else
@@ -344,7 +348,11 @@ ZEND_API zend_op_array* (*orig_zend_compile_string)(zval* source_string,
344 char* filename) = NULL; 348 char* filename) = NULL;
345#endif 349#endif
346 350
347#if PHP_VERSION_ID >= 80000 351#if PHP_VERSION_ID >= 82000
352ZEND_API zend_op_array* sp_compile_string(zend_string* source_string,
353 const char* filename,
354 enum _zend_compile_position position) {
355#elif PHP_VERSION_ID >= 80000
348ZEND_API zend_op_array* sp_compile_string(zend_string* source_string, 356ZEND_API zend_op_array* sp_compile_string(zend_string* source_string,
349 const char* filename) { 357 const char* filename) {
350#else 358#else
@@ -352,7 +360,11 @@ ZEND_API zend_op_array* sp_compile_string(zval* source_string, char* filename) {
352#endif 360#endif
353 // TODO(jvoisin) handle recursive calls to `eval` 361 // TODO(jvoisin) handle recursive calls to `eval`
354 SPG(eval_source_string) = source_string; 362 SPG(eval_source_string) = source_string;
355 zend_op_array* opline = orig_zend_compile_string(source_string, filename); 363 zend_op_array* opline = orig_zend_compile_string(source_string, filename
364#if PHP_VERSION_ID >= 82000
365 , position
366#endif
367 );
356 if (SPCFG(sloppy).enable) { 368 if (SPCFG(sloppy).enable) {
357 sp_sloppy_modify_opcode(opline); 369 sp_sloppy_modify_opcode(opline);
358 } 370 }