diff -urNp -x '*.orig' php-5.6.40.org/ext/pdo/pdo.c php-5.6.40/ext/pdo/pdo.c --- php-5.6.40.org/ext/pdo/pdo.c 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/pdo/pdo.c 2021-08-23 23:20:05.175752159 +0200 @@ -132,7 +132,7 @@ const zend_function_entry pdo_functions[ /* {{{ pdo_functions[] */ #if ZEND_MODULE_API_NO >= 20050922 static const zend_module_dep pdo_deps[] = { -#ifdef HAVE_SPL +#ifdef HAVE_SPL && !COMPILE_DL_SPL ZEND_MOD_REQUIRED("spl") #endif ZEND_MOD_END diff -urNp -x '*.orig' php-5.6.40.org/ext/phar/Makefile.frag php-5.6.40/ext/phar/Makefile.frag --- php-5.6.40.org/ext/phar/Makefile.frag 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/phar/Makefile.frag 2021-08-23 23:20:05.175752159 +0200 @@ -9,7 +9,7 @@ PHP_PHARCMD_EXECUTABLE = ` \ $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \ if test "x$(PHP_MODULES)" != "x"; then \ $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \ - for i in bz2 zlib phar; do \ + for i in pcre spl bz2 zlib phar; do \ if test -f "$(top_builddir)/modules/$$i.la"; then \ . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \ fi; \ diff -urNp -x '*.orig' php-5.6.40.org/ext/spl/config.m4 php-5.6.40/ext/spl/config.m4 --- php-5.6.40.org/ext/spl/config.m4 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/spl/config.m4 2021-08-23 23:20:05.175752159 +0200 @@ -22,6 +22,6 @@ int main(int argc, char **argv) { CPPFLAGS=$old_CPPFLAGS AC_DEFINE_UNQUOTED(HAVE_PACKED_OBJECT_VALUE, $ac_result, [Whether struct _zend_object_value is packed]) AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support]) - PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no) + PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, $ext_shared) PHP_INSTALL_HEADERS([ext/spl], [php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h]) PHP_ADD_EXTENSION_DEP(spl, pcre, true) diff -urNp -x '*.orig' php-5.6.40.org/ext/spl/spl_iterators.c php-5.6.40/ext/spl/spl_iterators.c --- php-5.6.40.org/ext/spl/spl_iterators.c 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/spl/spl_iterators.c 2021-08-23 23:20:05.175752159 +0200 @@ -60,7 +60,13 @@ PHPAPI zend_class_entry *spl_ce_EmptyIte PHPAPI zend_class_entry *spl_ce_AppendIterator; PHPAPI zend_class_entry *spl_ce_RegexIterator; PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator; +#if COMPILE_DL_SPL +#undef spl_ce_Countable +zend_class_entry *spl_ce_Countable; // real instance +extern PHPAPI zend_class_entry *spl_ce_Countable_p; // external one +#else PHPAPI zend_class_entry *spl_ce_Countable; +#endif PHPAPI zend_class_entry *spl_ce_RecursiveTreeIterator; ZEND_BEGIN_ARG_INFO(arginfo_recursive_it_void, 0) @@ -3839,6 +3845,10 @@ PHP_MINIT_FUNCTION(spl_iterators) REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator); REGISTER_SPL_ITERATOR(EmptyIterator); +#if COMPILE_DL_SPL + spl_ce_Countable_p = spl_ce_Countable; +#endif + REGISTER_SPL_SUB_CLASS_EX(RecursiveTreeIterator, RecursiveIteratorIterator, spl_RecursiveTreeIterator_new, spl_funcs_RecursiveTreeIterator); REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_CURRENT", RTIT_BYPASS_CURRENT); REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_KEY", RTIT_BYPASS_KEY); diff -urNp -x '*.orig' php-5.6.40.org/ext/spl/spl_iterators.h php-5.6.40/ext/spl/spl_iterators.h --- php-5.6.40.org/ext/spl/spl_iterators.h 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/spl/spl_iterators.h 2021-08-23 23:20:05.175752159 +0200 @@ -51,7 +51,12 @@ extern PHPAPI zend_class_entry *spl_ce_E extern PHPAPI zend_class_entry *spl_ce_AppendIterator; extern PHPAPI zend_class_entry *spl_ce_RegexIterator; extern PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator; +#if COMPILE_DL_SPL +#define spl_ce_Countable spl_ce_Countable_p +extern PHPAPI zend_class_entry *spl_ce_Countable_p; +#else extern PHPAPI zend_class_entry *spl_ce_Countable; +#endif extern PHPAPI zend_class_entry *spl_ce_CallbackFilterIterator; extern PHPAPI zend_class_entry *spl_ce_RecursiveCallbackFilterIterator; diff -urNp -x '*.orig' php-5.6.40.org/ext/standard/array.c php-5.6.40/ext/standard/array.c --- php-5.6.40.org/ext/standard/array.c 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/standard/array.c 2021-08-23 23:20:05.175752159 +0200 @@ -49,6 +49,9 @@ #ifdef HAVE_SPL #include "ext/spl/spl_array.h" #endif +#if COMPILE_DL_SPL +PHPAPI zend_class_entry *spl_ce_Countable_p = NULL; // external one +#endif /* {{{ defines */ #define EXTR_OVERWRITE 0