Skip to main content
ArtistMedium1159 u/ArtistMedium1159 avatar

ArtistMedium1159

u/ArtistMedium1159

Feed options
Hot
New
Top
View
Card
Compact

problem with php zend api and definition of an enum with zend_register_internal_enum
r/zend
problem with php zend api and definition of an enum with zend_register_internal_enum

the following code fails if shared library is loaded with `dl()`

    PHP_MINIT_FUNCTION(phpmkkernel)
    {
    #if defined(ZTS) && defined(COMPILE_DL_PHPMKKERNEL)
      ZEND_TSRMLS_CACHE_UPDATE();
    #endif
    
    #if defined(ZTS)
    ...
    #endif
    
      /* If you have INI entries, uncomment these lines
      REGISTER_INI_ENTRIES();
      */
    
      return LibMkKernel_MInit     (INIT_FUNC_ARGS_PASSTHRU)  ;
    }
    
    
    static ZEND_RESULT_CODE LibMkKernel_MInit (INIT_FUNC_ARGS) {
    ...
      MK(MkErrorE) = zend_register_internal_enum("PhpMsgque\\MkKernel\\MkErrorE", IS_LONG, NULL);
      zend_enum_add_case_cstr(MK(MkErrorE), "OK", OT_TMP_INT_OBJ(0));
      zend_enum_add_case_cstr(MK(MkErrorE), "CONTINUE", OT_TMP_INT_OBJ(1));
      zend_enum_add_case_cstr(MK(MkErrorE), "ERROR", OT_TMP_INT_OBJ(2));
    ...
      return SUCCESS;
    }

the problem is an assert in `create_enum_case_ast`

    ZEND_ASSERT(ZSTR_IS_INTERNED(class_name));

if shared library is loaded with `extension` in php.ini than it is fine

extension="..."

question: what I have to do ?





where I can post an announcement ?