Jump to content

Unable to read Zend object property


witheredOldMale

Recommended Posts

Hello

 

I have registered a property headers with the class YahooRestMessage as follows:

 

  zend_class_entry zceMessage;

 

  INIT_CLASS_ENTRY(zceMessage, “YahooRestMessage”, WsslPhpRestMessageFunctions);

 

  Zend_class_entry* wssl_php_YahooRestMessage_entry = zend_register_internal_class(&zceMessage TSRMLS_CC);

 

  zend_declare_property_null(wssl_php_YahooRestMessage_entry,"headers",7,ZEND_ACC_PUBLIC);

 

 

 

In the userspace , on an object of type YahooRestMessage I set the headers object directly:

 

  $msg->headers = $hdrs;

 

 

 

I’ve implemented the YahooRestMessage::getHeaders() method to read the object property headers (from my understanding) as follows:

 

      zval *zMemName = NULL;

 

    MAKE_STD_ZVAL(zMemName);

 

    ZVAL_STRING(zMemName, "headers", 0);

 

    zval **zHdrs = zend_get_std_object_handlers()->get_property_ptr_ptr(zvalObject,zMemName);

 

 

 

But *zHdrs thus got is not an object.

 

Please help, as I’m stuck and I couldn’t find any usage examples and even the 2nd parameter to get_property_ptr_ptr's meaning is not clear.

 

 

 

 

Thanks

 

kannan

 

 

Link to comment
https://forums.phpfreaks.com/topic/155337-unable-to-read-zend-object-property/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.