rfc:improve_callbacks_dom_and_xsl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:improve_callbacks_dom_and_xsl [2023/12/19 15:40] – Move subsection for clarity, no semantic changes nielsdosrfc:improve_callbacks_dom_and_xsl [2024/02/12 14:24] (current) derick
Line 3: Line 3:
   * Date: 2023-11-05   * Date: 2023-11-05
   * Author: Niels Dossche, nielsdos@php.net   * Author: Niels Dossche, nielsdos@php.net
-  * Status: Under Discussion+  * Status: Implemented 
 +  * Implementation: https://github.com/php/php-src/commit/90785dd865aa14005611107d566aa2a664572d8a
   * First Published at: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl   * First Published at: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
 +  * Target: PHP 8.4
  
 ===== Introduction ===== ===== Introduction =====
Line 115: Line 117:
  
 ==== Additional registerPhpFunctionNS API ==== ==== Additional registerPhpFunctionNS API ====
 +
 +This section is based on the feature request: https://bugs.php.net/bug.php?id=49567.
  
 We can go even further and //additionally// add an extra API: registerPhpFunctionNS. We can go even further and //additionally// add an extra API: registerPhpFunctionNS.
Line 278: Line 282:
  
 In this case, no functions are registered. In this case, no functions are registered.
- 
-==== Alternatives ==== 
- 
-I considered an alternative solution too: https://bugs.php.net/bug.php?id=49567. 
- 
-In that feature request, the idea is to add a new <php>registerObjectMethods</php> method instead of extending <php>registerPhpFunctions</php>. 
-Or more generally, the alternative is that we add <php>registerCallable(string $name, callable $callable)</php>. The downside is that this can break BC if there are user child classes of <php>DOMXPath</php> and <php>XSLTProcessor</php> that already contain a method named <php>registerCallable</php>. It might also be confusing for users to have two functions that have almost the same purpose, especially w.r.t. interactions between these two. 
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 317: Line 314:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
-Two primary votes requiring 2/3rd majority: +Two primary votes each requiring 2/3rd majority
-  Accept the proposed changes to registerPhpFunctions ext/dom and ext/xsl callbacks+ 
-  - Add registerPhpFunctionNS to ext/dom and ext/xsl?+Accept the proposed changes to registerPhpFunctions in ext/dom and ext/xsl? 
 + 
 +<doodle title="Accept the proposed changes to registerPhpFunctions in ext/dom and ext/xsl?" auth="nielsdos" voteType="single" closed="true" closeon="2024-01-11T18:00:00+02:00"> 
 +   * Yes 
 +   * No 
 +</doodle> 
 + 
 + 
 +---- 
 + 
 + 
 +Add registerPhpFunctionNS to ext/dom and ext/xsl? 
 + 
 +<doodle title="Add registerPhpFunctionNS to ext/dom and ext/xsl?" auth="nielsdos" voteType="single" closed="true" closeon="2024-01-11T18:00:00+02:00"> 
 +   * Yes 
 +   * No 
 +</doodle> 
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
Line 326: Line 340:
  
 ===== Implementation ===== ===== Implementation =====
-After the project is implemented, this section should contain  + 
-  - the version(s) it was merged into +Merged into PHP 8.4 in https://github.com/php/php-src/commit/90785dd865aa14005611107d566aa2a664572d8a. 
-  a link to the git commit(s) + 
-  - a link to the PHP manual entry for the feature +Manual entry TBD
-  - a link to the language specification section (if any)+
  
 ===== References ===== ===== References =====
rfc/improve_callbacks_dom_and_xsl.1703000412.txt.gz · Last modified: 2023/12/19 15:40 by nielsdos