php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #73748
Patch fix_php7.1_compat.patch revision 2017-05-01 23:25 UTC by nish dot aravamudan at canonical dot com

Patch fix_php7.1_compat.patch for stomp Bug #73748

Patch version 2017-05-01 23:25 UTC

Return to Bug #73748 | Download this patch
Patch Revisions:

Developer: nish.aravamudan@canonical.com

Description: Fixes for PHP7.1 BC-breaking changes
Author: Nishanth Aravamudan <nish.aravamudan@canonical.com>
Forwarded:
Last-Update: 2017-05-01

--- a/stomp-2.0.0/php_stomp.c
+++ b/stomp-2.0.0/php_stomp.c
@@ -952,6 +952,11 @@
 			object_init_ex(return_value, ce);
 
 			if (ce->constructor) {
+#if PHP_VERSION_ID < 70100
+				zend_class_entry *scope = EG(scope);
+#else
+				zend_class_entry *scope = zend_get_executed_scope();
+#endif
 				zval cmd, body;
 
 				ZVAL_STRINGL(&cmd, res->command, res->command_length);
@@ -963,8 +968,10 @@
 				}
 
 				fci.size = sizeof(fci);
+#if PHP_VERSION_ID < 70100
 				fci.function_table = &ce->function_table;
 				fci.symbol_table = NULL;
+#endif
 
 				/* PARAMS */
 				fci.param_count = 3;
@@ -980,7 +987,7 @@
 
 				fcc.initialized = 1;
 				fcc.function_handler = ce->constructor;
-				fcc.calling_scope = EG(scope);
+				fcc.calling_scope = scope;
 				fcc.object = Z_OBJ_P(return_value);
 
 				if (zend_call_function(&fci, &fcc ) == FAILURE) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 16:01:28 2024 UTC