rfc:internal_function_return_types

Differences

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

Link to this comparison view

Next revision
Previous revision
rfc:internal_function_return_types [2015/02/04 11:02] – created reezerfc:internal_function_return_types [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: Support Internal function Return Types====== ====== PHP RFC: Support Internal function Return Types======
   * Version: 0.1   * Version: 0.1
-  * Date: 2015-02-04 (use today's date here)+  * Date: 2015-02-04
   * Author: Reeze Xia, reeze@php.net   * Author: Reeze Xia, reeze@php.net
   * Status: Under Discussion   * Status: Under Discussion
   * First Published at: http://wiki.php.net/rfc/internal_function_return_types   * First Published at: http://wiki.php.net/rfc/internal_function_return_types
  
-This is a suggested template for PHP Request for Comments (RFCs). Change this template to suit your RFC.  Not all RFCs need to be tightly specified.  Not all RFCs need all the sections below. +===== Introduction =====
-Read https://wiki.php.net/rfc/howto carefully!+
  
 +Since PHP 7 now have return types in user-land, but internal functions didn't support it.
 +This RFC propose support internal function return types to make it consist.
  
-Quoting [[http://news.php.net/php.internals/71525|Rasmus]]:+===== Proposal =====
  
-> PHP is and should remain: +Support declare internal function/method return types, this could help make internal functions 
-> 1) a pragmatic web-focused language +API testable, this could also makes extension-implemented frameworks/libraries control their 
-> 2) a loosely typed language +return types.
-> 3) a language which caters to the skill-levels and platforms of a wide range of users+
  
-Your RFC should move PHP forward following his vision. As [[http://news.php.net/php.internals/66065|said by Zeev Suraski]] "Consider only features which have significant traction to a +See: https://github.com/php/php-src/pull/1050/files#diff-3ea93da7d1026a9f53948a5d14b1f7bdR247 
-large chunk of our userbase, and not something that could be useful in some +
-extremely specialized edge cases [...] Make sure you think about the full context, the huge audience out there, the consequences of  making the learning curve steeper with +
-every new feature, and the scope of the goodness that those new features bring."+
  
-===== Introduction ===== 
-The elevator pitch for the RFC. The first paragraph in this section will be slightly larger to give it emphasis; please write a good introduction. 
  
-===== Proposal ===== 
-All the features and examples of the proposal. 
- 
-To [[http://news.php.net/php.internals/66051|paraphrase Zeev Suraski]], explain hows the proposal brings substantial value to be considered 
-for inclusion in one of the world's most popular programming languages. 
- 
-Remember that the RFC contents should be easily reusable in the PHP Documentation. 
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
-What breaks, and what is the justification for it?+No BC break;
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-List the proposed PHP versions that the feature will be included in.  Use relative versions such as "next PHP 5.x" or "next PHP 5.x.y".+PHP 7
  
 ===== RFC Impact ===== ===== RFC Impact =====
 ==== To SAPIs ==== ==== To SAPIs ====
-Describe the impact to CLI, Development web server, embedded PHP etc.+No
  
 ==== To Existing Extensions ==== ==== To Existing Extensions ====
-Will existing extensions be affected?+No
  
 ==== To Opcache ==== ==== To Opcache ====
-It is necessary to develop RFC's with opcache in mind, since opcache is a core extension distributed with PHP. +No
- +
-Please explain how you have verified your RFC's compatibility with opcache.+
  
 ==== New Constants ==== ==== New Constants ====
-Describe any new constants so they can be accurately and comprehensively explained in the PHP documentation.+ 
 +New Macro to support declare return types of functions/methods: 
 + 
 +- ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO() 
 + 
 +- ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX() 
  
 ==== php.ini Defaults ==== ==== php.ini Defaults ====
-If there are any php.ini settings then list: +None
-  * hardcoded default values +
-  * php.ini-development values +
-  * php.ini-production values+
  
 ===== Open Issues ===== ===== Open Issues =====
-Make sure there are no open issues when the vote starts! 
  
-===== Unaffected PHP Functionality ===== +1Should we raise E_CORE_ERROR when error detected, should we just ignore it with a warning?
-List existing areas/features of PHP that will not be changed by the RFC.+
  
-This helps avoid any ambiguityshows that you have thought deeply about the RFC's impactand helps reduces mail list noise.+2. Return Types RFC internally support Nullable Typesbut user land not, this RFC also support thatshould support it? 
 + 
 +===== Unaffected PHP Functionality ===== 
 +User-land return types not affected
  
 ===== Future Scope ===== ===== Future Scope =====
-This sections details areas where the feature might be improved in future, but that are not currently proposed in this RFC.+None
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-Include these so readers know where you are heading and can discuss the proposed voting options. 
  
-State whether this project requires 2/3 or 50%+1 majority (see [[voting]])+This is not BC break RFC, 50%+1 majority (see [[voting]])
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-Links to any external patches and tests go here. 
  
-If there is no patch, make it clear who will create a patch, or whether a volunteer to help with implementation is needed. +https://github.com/php/php-src/pull/1050
- +
-Make it clear if the patch is intended to be the final patch, or is just a prototype.+
  
 ===== Implementation ===== ===== Implementation =====
 +
 After the project is implemented, this section should contain  After the project is implemented, this section should contain 
   - the version(s) it was merged to   - the version(s) it was merged to
Line 90: Line 76:
  
 ===== References ===== ===== References =====
-Links to external references, discussions or RFCs+ 
 +https://wiki.php.net/rfc/return_types
  
 ===== Rejected Features ===== ===== Rejected Features =====
-Keep this updated with features that were discussed on the mail lists.+None 
rfc/internal_function_return_types.1423047779.txt.gz · Last modified: 2017/09/22 13:28 (external edit)