Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113422 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16317 invoked from network); 9 Mar 2021 02:41:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Mar 2021 02:41:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 12CD21804B4 for ; Mon, 8 Mar 2021 18:33:02 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Mar 2021 18:32:58 -0800 (PST) Received: by mail-il1-f179.google.com with SMTP id z9so10834954iln.1 for ; Mon, 08 Mar 2021 18:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=lo6foRAVTKnWwUdv2Al5sYhb1nyYKSMl/gOPe0Upo9s=; b=AZbBO1Z/ld+5pbpWS5TtuVT2hdqvB8xKmiB+RCsaHyQNWXmrTVDR54jLGgLQryliGP TeYj6YMYsBepVKDpacD76AXSN0W5/3LlLS7csCF+cE8bXbkdhS1UbihXCP8YF1M/9kmi womdoSINhsxz39jEWZTFwZC3wI+ooUu+n/YnG/genLEQqhKqgd2XSdBcgnVzZCPg0iyn aBlkQ0O5hhamGcxCSiZ5Qaz0JObJbVdP+4gOTVqjHE8KfdbZjd0dE/wgUO0fXjOjooRV aDfvEtroC6fhOcPMSh/QQJMccmP5K0gDC76OJMzdwMAU7kDcFCsJLW9Gb2Ns4tK5jW/K z7Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=lo6foRAVTKnWwUdv2Al5sYhb1nyYKSMl/gOPe0Upo9s=; b=QoMsfbYUL8yxTzsQqtEhCq7DQXuPd/kCedSwGiya/i8eXBcR6JGmfoNZBFAIb9kiY4 3/ud9RTdzAvf+BTp9nO0uAPgbMw1HDWgMmwo53JEkLxRJb8ZCRfsBO/lBcZE5a/ABVM0 RYp7F+EmsOeHmIbRYHP2meFRIJrD9mq0oYiQYusoToJ2xbc5sXHYc/W4MfIAQ8sS01Dk eFN/uWBgXuD/M4nEg6gk6z4ExcQV/7DheDvfRDB+R7PPlz0DWn8CWZ/Kxj4I0mBC0cY3 CRaDwQy61ki/ldYapt5DBVj5UKv1CEPAUKwkKBHlyQp1Mh1AQhZBw63dIyorD/mAaPLa bf9g== X-Gm-Message-State: AOAM531g6Hmz2VhwCo1DfFQ4DAZcEGsgds2yoxoH7q9NzjuYDBXJCNBQ EhH4uQmejmZer+HaslST/5lGqQxC0+g54G37ueMcVsnqnSHv0w== X-Google-Smtp-Source: ABdhPJywou2Fxcw9fyO2PtdxfDJqS5F5ZUaANaLEi+Xzuzf6BbCu0LKgiWEoXWkCf+knSuY4Yx0aZfUjmGdE4M1Z7Fk= X-Received: by 2002:a92:dc01:: with SMTP id t1mr22541390iln.192.1615257177466; Mon, 08 Mar 2021 18:32:57 -0800 (PST) MIME-Version: 1.0 Date: Mon, 8 Mar 2021 18:32:46 -0800 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000048aa4105bd115e0c" Subject: Tracking Object Property Changes From: sutabi@gmail.com (Joseph Montanez) --00000000000048aa4105bd115e0c Content-Type: text/plain; charset="UTF-8" I am not sure what to title this but the gist is that I have two structs with a one way dependency: // Vector3 type typedef struct Vector3 { float x; float y; float z; } Vector3; // Ray type (useful for raycast) typedef struct Ray { Vector3 position; // Ray position (origin) Vector3 direction; // Ray direction } Ray; I've gone ahead and made a test extension here: https://github.com/joseph-montanez/php-ext-reference-issue . I've made each struct a PHP object. allowing me to do this: position->z, PHP_EOL; // Outputs: 3 $position->z = 9; echo 'Z: ', $ray->position->z, PHP_EOL; // Outputs: 9 The PHP Ray object is defined as so: typedef struct _skeleton_ray_object { Ray ray; HashTable *prop_handler; zend_object std; skeleton_vector3_object *position; skeleton_vector3_object *direction; } skeleton_ray_object; When I update either vector3 object, I don't have a way to propagate the changes back to the parent object(Ray). This means the raw Ray struct is never updated. Is there a built-in way to handle propagation (listeners) in a PHP extension or will I need to hand roll this? Thanks, Joseph Montanez --00000000000048aa4105bd115e0c--