--- php-5.2.11/ext/spl/config.m4~ 2006-12-04 20:01:53.000000000 +0200 +++ php-5.2.11/ext/spl/config.m4 2009-09-23 16:07:37.775732678 +0300 @@ -26,7 +26,7 @@ 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_sxe.c spl_exceptions.c spl_observer.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_sxe.c spl_exceptions.c spl_observer.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_sxe.h]) PHP_ADD_EXTENSION_DEP(spl, pcre, true) fi --- php-5.2.11/ext/standard/array.c 2009-09-23 16:37:08.248891644 +0300 +++ php-5.2.11/ext/standard/array.c 2009-09-23 16:58:07.478775818 +0300 @@ -48,6 +48,10 @@ #include "php_smart_str.h" #ifdef HAVE_SPL #include "ext/spl/spl_array.h" +#ifdef COMPILE_DL_SPL +#define spl_ce_Countable spl_ce_Countable_p +zend_class_entry *spl_ce_Countable_p = NULL; +#endif #endif /* {{{ defines */ @@ -132,6 +136,15 @@ REGISTER_LONG_CONSTANT("COUNT_NORMAL", COUNT_NORMAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("COUNT_RECURSIVE", COUNT_RECURSIVE, CONST_CS | CONST_PERSISTENT); + +#ifdef HAVE_SPL && COMPILE_DL_SPL + /* get spl_ce_Countable via weak ref */ + zend_class_entry **pce; + + if (zend_hash_find(CG(class_table), "countable", sizeof("Countable"), (void **) &pce) != FAILURE) { + spl_ce_Countable = *pce; + } +#endif return SUCCESS; }