rfc:var_info

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:var_info [2016/06/26 17:24] – Added link to internals thread fleshgrinderrfc:var_info [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: var_info ====== ====== PHP RFC: var_info ======
-  * Version: 0.0+  * Version: 1.0
   * Date: 2016-06-26   * Date: 2016-06-26
   * Author: Richard Fussenegger <php@fleshgrinder.com>   * Author: Richard Fussenegger <php@fleshgrinder.com>
-  * Status: Under Discussion+  * Status: Declined
   * First Published at: http://wiki.php.net/rfc/var_info   * First Published at: http://wiki.php.net/rfc/var_info
  
Line 72: Line 72:
  
 Developers should however not rely on the returned values for anything other than outputting them. This is because the returned values might change in any major PHP release, the PHP team will of course take careful care not to alter the output during non-major releases, but it is still highly discouraged. Developers should however not rely on the returned values for anything other than outputting them. This is because the returned values might change in any major PHP release, the PHP team will of course take careful care not to alter the output during non-major releases, but it is still highly discouraged.
 +
 +==== Prefix Choice ====
 +The function prefix ''var_'' was chosen on purpose because another possibly more suitable prefix like ''val_'' or ''value_'' would introduce a new prefix to the PHP ecosystem. It is true that this function can be used with the return value of functions too as well as with literal values, however, exactly the same argument is true for ''var_dump()'' and ''var_export()''. Naming consistency is very important and this tiny blemish is on purpose in this case.
 +
 +==== Core Inclusion ====
 +Writing a function that does exactly the same as the proposed ''var_info()'' function in userland is trivial. However, the inclusion of tiny dependencies for every day tasks is not something library developers want since every dependency results in an maintainability increase. Another solution would be to copy the few lines of code that provide the functionality from project to project, it should be obvious that this is never an appropriate solution for any kind of problem. Hence, such a tiny but portable functionality is best provided by the platform itself. The inclusion in core should support developers while creating useful error messages, in tiny scripts as well as fully fledged applications and replace calls to ''gettype()'' for that purpose or even ''var_dump()''/''var_export()''.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 107: Line 113:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
 This RFC will have a single poll that requires a 50%+1 majority. This RFC will have a single poll that requires a 50%+1 majority.
 +
 +<doodle title="Accept var_info function?" auth="fleshgrinder" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
 The [[https://github.com/php/php-src/pull/1957|GitHub Pull Request #1957]] contains the implementation as well as tests for the new function. The changes in the PR are considered final, however, a thorough code review would be much appreciated and might result in minor changes. The [[https://github.com/php/php-src/pull/1957|GitHub Pull Request #1957]] contains the implementation as well as tests for the new function. The changes in the PR are considered final, however, a thorough code review would be much appreciated and might result in minor changes.
- 
-===== Implementation ===== 
-  - Merged to Version: //?// 
-  - Git Commits: //?// 
-  - PHP Manual: https://secure.php.net/var_info 
  
 ===== References ===== ===== References =====
rfc/var_info.1466961862.txt.gz · Last modified: 2017/09/22 13:28 (external edit)