-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new 'use function' sequence for importing namespaced functions #388
Conversation
❤️ |
The functionality looks good so far and the tests on windows and linux pass. Prosit! |
@@ -0,0 +1,18 @@ | |||
--TEST-- | |||
use and use function with the same alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit s/use function/use const
Patch looks pretty good. Some comments:
<?php
if (0) {
function foo() {
}
}
use function bar\foo;
// Fatal error: Cannot use function bar\foo as foo because the name is already in use in /home/nikic/dev/php-src/t59.php on line 9 Edit: Don't know whether the last point is actually important, just noticed that it behaves differently from class uses ;) |
TODOs:
Help on either of those would be appreciated. |
Fixes bug #65745 (Typo in commit 4a3936e).
* 'master' of https://git.php.net/repository/php-src: Fix typo: HTTP_ROW_POST_DATA → HTTP_RAW_POST_DATA.
* PHP-5.5: Fixed issue php#135 (segfault in interned strings if initial memory is too low) Conflicts: NEWS
* PHP-5.5: Added function opcache_compile_file() to load PHP scripts into cache without execution. Conflicts: NEWS
* 'master' of https://git.php.net/repository/php-src: Added function opcache_compile_file() to load PHP scripts into cache without execution. Fixed issue php#135 (segfault in interned strings if initial memory is too low)
While running these on HHVM I've run into a lot of parallelism issues. I'm backporting all the fixes I had to do in https://github.com/facebook/hiphop-php/blob/master/hphp/tools/import_zend_test.py#L650 to php core. Most of these changes were just filenames that were shared between tests, but I did more surgery on the fixed ports. I can apreciate port 31337 as much as the next nerd, but random ports are better for tests.
# By Adam Harvey (2) and others # Via Adam Harvey (2) and others * 'master' of https://git.php.net/repository/php-src: Implement variadic function syntax Added function opcache_compile_file() to load PHP scripts into cache without execution. Fixed issue php#135 (segfault in interned strings if initial memory is too low) Fix typo: HTTP_ROW_POST_DATA → HTTP_RAW_POST_DATA. Make message and format arguments const char * to avoid build warning about invalid cast. Copy dba_*() keys before converting to string.
* 'master' of https://git.php.net/repository/php-src: Implement variadic function syntax
We already track it in the op array already.
* 'master' of https://git.php.net/repository/php-src: Don't track parameter number in separate znode fix missing change from 'tcp_socket' to the more common 'server' fix many parallel test issues
Change php.ini-* doc to match an earlier change to config.w32
* PHP-5.5: Added support for GNU Hurd. (Svante Signell) Conflicts: NEWS
* PHP-5.5: Removed references to "Zend Support"
* PHP-5.5: Fix bug #66008
- update libzip to version 1.11.1. We don't use any private symbol anymore - new method ZipArchive::setPassword($password) - add --with-libzip option to build with system libzip
# By Remi Collet (2) and Xinchen Hui (2) # Via Xinchen Hui (5) and Remi Collet (1) * 'master' of git.php.net:php-src: NEWS + UPGRADING Sync ext/zip with pecl/zip version 1.3.2 - update libzip to version 1.11.1. We don't use any private symbol anymore - new method ZipArchive::setPassword($password) - add --with-libzip option to build with system libzip Fixed coredump due to abnormal implemention of phar remove "PHP 6" staff
Conflicts: ext/phar/phar_internal.h ext/phar/stream.c ext/phar/util.c
* pull-request/500: limit virtual_cwd_activate() duplicated call to ZTS only reverted the previous commit, both calls are needed in TS mode virtual_cwd_activate() should be called only in one place back to do_alloca() removed unnecessary call simplify the state free macros compact the code to preserve the error info after state freeing back to do_alloca(), reverted the wrong replacement enabled windows to use stack in both ts/nts mode, some more fixes moved to do_alloca() usage where appropriate fixed invalid free fixed virtual cwd header in phar updated NEWS fixed all the places where last error could be lost preserve the error code applied and fixed the original patch initial move on renaming files and fixing includes Conflicts: ext/opcache/ZendAccelerator.c
Conflicts: ext/opcache/ZendAccelerator.c
* PHP-5.5: Fix bug #65946 - pdo_sql_parser.c permanently converts values bound to strings
* PHP-5.5: Added tests for PHAR/OPCahce incompatibilities Update NEWS Fixed bug #65947 (basename is no more working after fgetcsv in certain situation) Update NEWS Fixed Bug #66043 (Segfault calling bind_param() on mysqli) NEWS entry NEWS entry Conflicts: NEWS
* upstream/PHP-5.6: (399 commits) Fixed issue php#115 (path issue when using phar). Fixed issue php#149 (Phar mount points not working with OPcache enabled). Added tests for PHAR/OPCahce incompatibilities Update NEWS Fixed bug #65947 (basename is no more working after fgetcsv in certain situation) Update NEWS Fixed Bug #66043 (Segfault calling bind_param() on mysqli) NEWS entry NEWS entry Fix bug #65946 - pdo_sql_parser.c permanently converts values bound to strings bump API versions Add a couple more test cases to parse_url() tests fix missing change from 'tcp_socket' to the more common 'server' fix many parallel test issues Cleanup temp test file Revert "Fixed issue php#115 (path issue when using phar)." Update LiteSpeed SAPI code to V6.4 Fixed typo in Makefile.frag updated NEWS Remove outdate codes, make it clearer, although just a bit.. Update NEWS ... Conflicts: Zend/zend_compile.h
Re-opening against PHP-5.6. |
This is specified as the use_function RFC: