summaryrefslogtreecommitdiff
path: root/Zend/tests/use_function
Commit message (Collapse)AuthorAgeFilesLines
* Reindent phpt filesNikita Popov2020-02-031-5/+5
|
* Rename *.php files in Zend/tests to *.incPeter Kokot2018-09-237-4/+4
| | | | | *.php files are ignored by Git and a better practice might be to rename PHP included files for tests.
* Fix "already in use" check inconsistencies/bugsNikita Popov2016-10-072-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following issues: * "use function" and "use const" inside namespaced code were checking for conflicts against class imports. Now they always check against the correct symbol type. * Symbol conflicts are now always checked within a single file only. Previously class uses inside namespaced code were checked globally. This behavior is illegal because symbols from other files are not visible if opcache is used, resulting in behavioral discrepancies. Additionally this made the presence/absence of symbol errors dependent on autoloading order, which is volatile. * The "single file" restriction is now enforced by collecting defined symbols inside a separate hash table. Previously it was enforced (for the non-namespaced case) by comparing the filename of the symbol declaration. However this is inaccurate if the same filename is used multiple times, such as may happen if eval() is used. * Additionally the previous approach relies on symbols being registered at compile-time, which is not the case for late-bound classes, which makes the behavior dependent on class declaration order, as well as opcache (which may cause delayed early-binding). * Lastly, conflicts are now consistently checked for conditionally defined symbols. Previously only declaration-after-use conflicts were checked in this case. Now use-after-declaration conflicts are detected as well.
* Update exception names in tests after formatting changes.Aaron Piotrowski2015-05-172-2/+2
|
* Tweak uncaught exception message displayNikita Popov2015-05-172-2/+2
| | | | | | | | | | | | | This implements a reduced variant of #1226 with just the following change: -Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d +Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d The '' wrapper around messages is very weird if the exception message itself contains ''. Futhermore having the message wrapped in '' doesn't work for the "and defined" suffix of TypeExceptions.
* Display EngineExceptions like ordinary exceptionsNikita Popov2015-05-152-2/+8
| | | | | | | | | TypeException stays as-is for now because it uses messages that are incompatible with the way exception messages are displayed. closure_038.phpt and a few others now show that we're generating too many exceptions for compound operations on undefined properties -- this needs to be fixed in a followup.
* Clarify type of use in error messagesIgor Wiedler2013-10-142-2/+2
|
* Add "Done" output to distinguish hard from soft failuresIgor Wiedler2013-10-141-0/+4
|
* Fix issue with global fallback when not in global spaceAnthony Ferrara2013-08-301-0/+18
|
* Add test for conditional function declarationIgor Wiedler2013-08-291-0/+17
|
* Handle case sensivity of constants (nikic)Igor Wiedler2013-08-251-0/+13
|
* self and parent are valid function and const names (nikic)Igor Wiedler2013-08-251-0/+12
|
* Adjust some test names, remove obsolete and duplicate tests (nikic)Igor Wiedler2013-08-251-1/+1
|
* Disallow using functions/consts defined in the same fileIgor Wiedler2013-08-257-31/+32
| | | | | | * Keep track of defined function and const filenames * Prohibit use function foo if function foo exists * Prohibit use const foo if const foo exists
* Add test cases for conflicting use and definition in same ns (stas)Igor Wiedler2013-08-233-25/+28
|
* More test cases for conflicting aliasesIgor Wiedler2013-08-221-0/+23
|
* Add test case for conflicting use and use function alias (stas)Igor Wiedler2013-08-221-0/+20
|
* Correctly distinguish between functions and constantsIgor Wiedler2013-08-221-0/+23
| | | | | So far 'use function' applied to both constants and functions. This patch correctly separates the two.
* Add new 'use function' sequence for importing namespaced functionsIgor Wiedler2013-08-227-0/+182
This is specified as the use_function RFC: * https://wiki.php.net/rfc/use_function