rfc:use_function

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:use_function [2013/07/23 20:21]
igorw 1.1.0 Added support for constants with `use const`
rfc:use_function [2017/09/22 13:28] (current)
Line 1: Line 1:
 ====== PHP RFC: Importing namespaced functions ====== ====== PHP RFC: Importing namespaced functions ======
  
-  * Version: 1.1.0+  * Version: 1.1.1
   * Date: 2013-05-02   * Date: 2013-05-02
   * Author: Igor Wiedler, igor@wiedler.ch   * Author: Igor Wiedler, igor@wiedler.ch
-  * Status: Under Discussion+  * Status: Implemented (PHP-5.6)
   * First Published at: http://wiki.php.net/rfc/use_function   * First Published at: http://wiki.php.net/rfc/use_function
  
Line 83: Line 83:
     use const foo\bar\baz;     use const foo\bar\baz;
     var_dump(baz);     var_dump(baz);
 +}
 +</code>
 +
 +Just like classes, it should be possible to alias imported functions and constants:
 +
 +<code php>
 +namespace {
 +    use function foo\bar as foo_bar;
 +    use const foo\BAZ as FOO_BAZ;
 +    var_dump(foo_bar());
 +    var_dump(FOO_BAZ);
 } }
 </code> </code>
Line 208: Line 219:
 ===== Patches and Tests ===== ===== Patches and Tests =====
  
-There is a patch against PHP-5.6 (currently master) [[https://github.com/php/php-src/pull/388|as a GitHub pull request]].+There is a patch against PHP-5.6 (currently master) [[https://github.com/php/php-src/pull/526|as a GitHub pull request]].
 ===== References ===== ===== References =====
  
Line 217: Line 228:
 - None. - None.
  
 +===== Vote =====
 +
 +The voting period is 15.08.2013 until 29.08.2013.
 +
 +<doodle title="RFC/use_function" auth="user" voteType="multi" closed="true">
 +   * Yes?
 +   * No?
 +</doodle>
 ===== Changelog ===== ===== Changelog =====
  
 +  * 2013-08-08 1.1.1 Added example of aliasing
   * 2013-07-23 1.1.0 Added support for constants with `use const`   * 2013-07-23 1.1.0 Added support for constants with `use const`
   * 2013-07-22 1.0.1 FAQ "why 'use function'?"   * 2013-07-22 1.0.1 FAQ "why 'use function'?"
   * 2013-07-19 1.0.0 First version published for discussion   * 2013-07-19 1.0.0 First version published for discussion
rfc/use_function.1374610911.txt.gz · Last modified: 2017/09/22 13:28 (external edit)