Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121270 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80373 invoked from network); 10 Oct 2023 13:52:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Oct 2023 13:52:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 172DD1804B4 for ; Tue, 10 Oct 2023 06:52:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 10 Oct 2023 06:52:49 -0700 (PDT) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1c871a095ceso41636615ad.2 for ; Tue, 10 Oct 2023 06:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696945968; x=1697550768; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=wdVbbIcEANhrPydE04m1r/I9ze/c5mb+GwndTQbQuR4=; b=JViOKBAPysd1vxnGRThX0nxBbgm3BKhK1Dz9BCAwlNxvSh/Ak5EMhlXQYzwakK1hXL tXxasQ6fzJwoZdP/1jS1/xgMOzvaf+1oVnr6od5OHgcfeMF3rzi7j84i5c2o2fQn3XnH 7f0diJMR6ipl+VnkS3jiGWbiCpQe0EbzGkxSxMmfPEpLNYFw940JbwoMxr6RchQJrrnm dm1moBoxat61MNrclcND4fwtWsxWJu8SvTy3bKp/xSrflqmlvneejYAqJgsqTMsnlg9S sdo755UAVhoRkpiUrTlb7n4+/fi9/sMMYV9A/fa2yhH/wAO9BUR7AgA1TWE0UtT7MnO4 wnjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696945968; x=1697550768; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wdVbbIcEANhrPydE04m1r/I9ze/c5mb+GwndTQbQuR4=; b=R6Fho+Z/l73H2iCQLCezLmWavbcMwoBuVhRYmD3VpEER4PdN+ENbixRPPAYw0ynPT2 6WzZZaKchBlyqNIudPMPEVwBMD6I+kmkXJN53lBZ/nWIq4ZsfoJep0GTFe59A/Ru9AID iuz+2EFsQJ4ze1vpUoIRN6foFZQGugiM0vVLv62krdeARm/k8/gNGz17NRK1MgUqo21r 3Ek70+doaVXqIshgNykFENBylv9xJ60yZz0llkkPPhWghpVBbAPnUVaW7oUwQIpDMLta pRrf54eDKt82WNbTjp8j8ra9CbFLHUTEi3jk3dDH9H+apmMFU3EJ9mbLbVB27ngD+hKt nd1g== X-Gm-Message-State: AOJu0YwXwlrwjyh3e0505U8rRW5cuyrWMp5Xn29SHGTYLjA/AUcNhldw un0rbU7oUETUveM6FTIyrj1N9LZLLGUTnHIet2fEUyuLr9Y= X-Google-Smtp-Source: AGHT+IFXos4xIRYVhVZvFQAAlFMdvy33wu4h6YbmCTzxE919vSLKgoc+kYR2U9ds1BJrIu5ZSeRiNOflA2Nbg7+mUCM= X-Received: by 2002:a17:90b:3b88:b0:27c:d55a:de7a with SMTP id pc8-20020a17090b3b8800b0027cd55ade7amr3901668pjb.37.1696945968140; Tue, 10 Oct 2023 06:52:48 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 10 Oct 2023 14:52:37 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000a256da06075d0504" Subject: [PHP-DEV] Peculiar behaviour of ext/xml set_X_handler() functions From: george.banyard@gmail.com ("G. P. B.") --000000000000a256da06075d0504 Content-Type: text/plain; charset="UTF-8" Hello internals, While doing some refactoring of ext/xml to bring it up to modern engine standards, I discovered some peculiar behaviour of the functions which set callable handlers. The PR in question is: https://github.com/php/php-src/pull/12340 The issue is that this function doesn't just accept the usual callabes, but also passing a method name that should be called on an object provided by xml_set_object(). Moreover, contrary to the usual semantics of checking if the value is callable when passed to the function, it is checked when attempting to call it. The PR changes this to validate that the function or method name provided is actually callable. This requires a BC break in that xml_set_object() MUST be called prior to setting the method names, otherwise a ValueError is now thrown. The only project I could find that called xml_set_object() after already setting method names for handlers is semsol/arc2 to which I have sent a PR to update this. The existence of the already set methods is now also checked when calling xml_set_object() again with a different object to ensure that the handlers are always well-defined. The plan is to also deprecate this feature out right, but this can be done by adding it to the mass 8.4 deprecation RFC. [1] Point of this email is to know if anyone has any complaints about this BC break before merging the PR into master. Best regards, George P. Banyard [1] https://wiki.php.net/rfc/deprecations_php_8_4 --000000000000a256da06075d0504--