Description: Fix BC-incompatible PHP7.1 source changes Author: Nishanth Aravamudan Bug: https://forums.zeroc.com/discussion/46512/ubuntu-17-10-transitioning-to-php7-1-build-error-with-zeroc-ice-source-package/p1?new=1 Forwarded: Last-Update: 2017-05-01 --- zeroc-ice-3.6.3.orig/php/src/php7/Types.cpp +++ zeroc-ice-3.6.3/php/src/php7/Types.cpp @@ -1171,15 +1171,24 @@ IcePHP::DataMember::setMember(zval* targ // As a workaround, before calling the function we change the current scope to be that // of the object. // +#if PHP_VERSION_ID < 70100 zend_class_entry *oldScope = EG(scope); EG(scope) = Z_OBJCE_P(target); +#else + zend_class_entry *oldScope = zend_get_executed_scope(); + EG(fake_scope) = Z_OBJCE_P(target); +#endif // // add_property_zval increments the refcount of zv. // int status = add_property_zval(target, STRCAST(name.c_str()), zv); +#if PHP_VERSION_ID < 70100 EG(scope) = oldScope; // Restore the previous scope. +#else + EG(fake_scope) = oldScope; +#endif if(status == FAILURE) {