Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121334 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33851 invoked from network); 16 Oct 2023 12:49:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Oct 2023 12:49:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 206341804D0 for ; Mon, 16 Oct 2023 05:49:47 -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-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 ; Mon, 16 Oct 2023 05:49:46 -0700 (PDT) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-578b407045bso3329912a12.0 for ; Mon, 16 Oct 2023 05:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697460585; x=1698065385; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Rju1k/J+MTUdCH5bXdO1mxb5ADgP3/LqpQgVOmUp8xg=; b=YWPNP704HNvvsXiGtBDqgnXnT7IBXN7JOQqGbj7J8cdTo/Uz1Kos3XdYr8mmU/XFwf EPcIxMn1Yq9UVZ4xkbNWsc6RH+2ZtRigiRQfIVa0hHrdW2Kj8vXYeTXXa1l6Sqmb5TLb CbtK3IdxAwiD/yrRdAjrVfruseAHE2e3e7a3TktBZfKaxoHvoDLGzavLuUXgF7fPimc+ gjgYyUn5A3yo/bFKqAZcV3n7wu8D2uq1irr3o6E8vW4ArKe0T0XIU54QVPE3cDw9BOw+ X9zt0mFqoFGJE2uu5duE+ccumDtch8wvrEhhzFd6vrbqeob11reiwkODJXysAaviEnEK BJpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697460585; x=1698065385; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Rju1k/J+MTUdCH5bXdO1mxb5ADgP3/LqpQgVOmUp8xg=; b=vIxJO+YEMZqf1AJ+Wp6y6GHeBeOJxxEmGhY+0I/xOd033N4zZWpJqDVDxMmH0lMD5E KUI1DWHpUoDz54/f2K8Pb2yDG54yDOiThy87ieWW5Inj773TTPV1TY7XK8ihpKVo6V+g nBNzxnDSBckICw5D+iZUd9+FPxIzhoSBn+rpFeBhewDsBkWhepsj8RzDpDmkH9javodL 6POK05zaNpOjeNrdZDZeoP4rGd6kB04f/NW9TTsJLMrWZUFePkY8bZC/5MmS/vNGT7lJ eLO4IETpMVAugZxnuL7fUk0AXWQJQMJjZAhjkEyyqH4S0GjpOOklIvzTTSVRg6SFMgAY ckkA== X-Gm-Message-State: AOJu0YwQlO5e1V6zQT06O+Whp9nOQY/bHxrhfqfsoizFVayAjxUO+1mC t+EHAoQG5kYCy/wfGpq/BofCZKbtxObnHo+NH0kHKA4gFcA= X-Google-Smtp-Source: AGHT+IFWYGEnFYUpq4qt4F1xohF2e0ZCafk76ntjC6ng0uRWh8ebfj6AAdsu1FxQGRzYTTgtVCNu+wC77HYEOQ5LGKs= X-Received: by 2002:a05:6a21:6d87:b0:16c:b95c:6d35 with SMTP id wl7-20020a056a216d8700b0016cb95c6d35mr33855737pzb.50.1697460585324; Mon, 16 Oct 2023 05:49:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 16 Oct 2023 13:49:33 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000003565520607d4d77e" Subject: Re: [PHP-DEV] Peculiar behaviour of ext/xml set_X_handler() functions From: george.banyard@gmail.com ("G. P. B.") --0000000000003565520607d4d77e Content-Type: text/plain; charset="UTF-8" On Tue, 10 Oct 2023 at 14:52, G. P. B. wrote: > 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 > If no one complains I will merge the PR at the end of the week. Best regards, George P. Banyard --0000000000003565520607d4d77e--