Thanks, Rowan, for the clarification! And no, this is not my primary question. At the risk of irritating everyone, here are the questions I need answered:
1) Is there not any way to first iterate through the default properties and then iterate through *only the dynamic properties* ? zend_object->properties appears to contain ALL properties if the object has a single dynamically-assigned property. If so, please advise? If not, please confirm? 2) Will the code below ALWAYS return the properties in the same sequence? E.g., if I am iterating through N objects of type MyClass, will each instance iterate the properties in the same order? 3) Will the code below ALWAYS iterate over default properties (i.e., "sealed" properties, those explicitly defined by class definitinos) FIRST and then iterate any dynamically assigned properties? CODE: zobj = zend_objects_get_address(*val TSRMLS_CC); if (!zobj->properties) { php_printf("***No dynamic properties!\n"); } else { php_printf("***we got dynamic properties...sadly, this will also iterate through default properties too\n"); zend_hash_internal_pointer_reset_ex(zobj->properties, &pos); while (zend_hash_get_current_data_ex(zobj->properties, (void **) &value, &pos) == SUCCESS) { if (zend_hash_get_current_key_ex(zobj->properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_STRING) { if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) { zend_unmangle_property_name(key, key_len - 1, &class_name, &prop_name); php_printf("dynamic property is %s, key_len is %d\n", prop_name, key_len); } } zend_hash_move_forward_ex(zobj->properties, &pos); } } On Thu, Sep 24, 2015 at 1:34 PM, Rowan Collins <rowan.coll...@gmail.com> wrote: > On 23/09/2015 22:16, j adams wrote: > >> Not my intention to be combative, but what abouthttp://php.net/pcntl_fork >> ? I've used that before in a robust distributed application that runs >> without any intervention for months. It's my understanding that PHP is >> thread safe, but not itself multithreaded. I believe there are some >> extensions which aren't thread safe. Also correct me if I'm wrong but >> Apache 2 should be run in it's prefork mode when using PHP. >> > > Process forking is very different from multi-threading. Your original > question was whether a central object store could cause problems, but as I > understand it a forked process shares no memory with its parent, so that's > not a problem. > > The internal thread safety mode ("ZTS") does indeed have to duplicate the > object store for each thread, though. The general idea (in Zend Engine 2 / > PHP 5, at least) being that a structure is passed around via TSRM* macros > and ultimately used by the EG macro in place of a true global: > http://lxr.php.net/xref/PHP_5_6/Zend/zend_globals_macros.h#45 > > All of this is something of an aside from what you really wanted to know, > though. :) > > > Regards, > > -- > Rowan Collins > [IMSoP] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >