Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-73

Support cloning for classes with custom create_object handlers

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.1.4
    • Affects Version/s: None
    • Component/s: None
    • None

      From: https://wiki.php.net/internals/engine/objects

      Most likely, the default clone_obj handler will have to be replaced because it assumes the create_object class entry handler is not replaced and directly allocates a standard zend_object data structure. Therefore, worse than the added custom fields to the object structure not being initialized (because the clone handler only knows how to so a shadow copy of the standard properties), these fields will not even exist because only a plain zend_object is allocated.

      You may also choose not to support the clone operation by setting the clone_obj handler to NULL.

      Whether we decide to support cloning or not, we should explicitly assign a value to the handler.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: