rfc:internal_function_return_types
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:internal_function_return_types [2015/02/04 11:02] – created reeze | rfc: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 | + | * 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:// | * First Published at: http:// | ||
- | 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. | + | ===== Introduction ===== |
- | Read https:// | + | |
+ | 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:// | + | ===== Proposal ===== |
- | > PHP is and should remain: | + | Support declare internal function/ |
- | > 1) a pragmatic web-focused language | + | API testable, this could also makes extension-implemented frameworks/ |
- | > 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]] " | + | See: https://github.com/php/php-src/pull/1050/ |
- | 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:// | ||
- | for inclusion in one of the world' | ||
- | |||
- | 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 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/ | ||
+ | |||
+ | - 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 ===== | + | 1. Should we raise E_CORE_ERROR when error detected, should we just ignore it with a warning? |
- | List existing areas/ | + | |
- | This helps avoid any ambiguity, shows that you have thought deeply about the RFC's impact, and helps reduces mail list noise. | + | 2. Return Types RFC internally support Nullable Types, but user land not, this RFC also support that, should 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 | + | This is not a 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:// |
- | + | ||
- | 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, | After the project is implemented, | ||
- 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:// | ||
===== 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)