summaryrefslogtreecommitdiff
path: root/ext/readline
Commit message (Collapse)AuthorAgeFilesLines
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-161-0/+2
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Improve class entry generationMáté Kocsis2021-02-161-1/+0
| | | | Related to GH-6701
* Generate class entries from stubs for phar, posix, pspell, readline, ↵Máté Kocsis2021-02-152-2/+3
| | | | | | reflection, session, shmop Closes GH-6692
* Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-114-8/+3
| | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-141-1/+1
| | | | | | | | | | | | | Historically, the _ex variants separated the zval first, if a conversion was necessary. This distinction no longer makes sense since PHP 7. The only difference that was still left is that _ex checked whether the type is the same first, but the usage of these macros did not actually distinguish on whether such an inlined check is valuable or not in a given context. Also drop the unused convert_to_explicit_type macros.
* Merge branch 'PHP-8.0'Christoph M. Becker2021-01-071-0/+1
|\ | | | | | | | | * PHP-8.0: Avoid modifying the return value of readline_completion_function()
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-01-071-0/+1
| |\ | | | | | | | | | | | | * PHP-7.4: Avoid modifying the return value of readline_completion_function()
| | * Avoid modifying the return value of readline_completion_function()Christoph M. Becker2021-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The internal function `_readline_command_generator()` modifies the internal array pointer of `readline_completion_function()`'s return value. We therefore separate the array, what also avoids failing assertions regarding the array refcount. Closes GH-6582.
* | | Add --repeat testing modeNikita Popov2020-10-305-1/+8
|/ / | | | | | | | | | | | | | | | | This testing mode executes the test multiple times in the same process (but in different requests). It is primarily intended to catch tracing JIT bugs, but also catches state leaks across requests. Closes GH-6365.
* | Review parameter names in ext/readlineMáté Kocsis2020-09-303-9/+9
| | | | | | | | Closes GH-6240
* | Run tidyNikita Popov2020-09-184-4/+4
| | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | Improve handling of `#[` attributes in `php -a`Tyson Andre2020-09-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `php -a` treats lines starting with `#` as comments when deciding if the provided statement is valid. So it passed `#[MyAttr]` to the parser after the user hits enter, causing a syntax error for multi-line statements.. With this patch, the following snippet is parsed correctly ``` php > #[Attr] php > function x() { } php > var_export((new ReflectionFunction('x'))->getAttributes()[0]->getName()); 'Attr' ``` Followup to GH-6085 Closes GH-6086
* | Improve handling of `#[` in `php -a`Tyson Andre2020-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PHP treats `#ini_setting=value` as a call to `ini_set('ini_setting', 'value')`, and silently skips undeclared settings. This is a problem due to `#[` becoming supported attribute syntax: - `#[Attr] const X = 123;` (this is not a valid place to put an attribute) This does not create a constant. - `#[Attr] function test($x=false){}` also contains `=`. This does not create a function. Instead, only treat lines starting with `#` as a special case when the next character isn't `[` Closes GH-6085
* | Allow overriding completion in `auto_prepend_file`Tyson Andre2020-08-014-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, it's possible to override `php -a`s completion functionality to provide an alternative to the C implementation, with `readline_completion_function()`. However, that surprisingly gets overridden when called from `auto_prepend_file`, because those scripts get run before the interactive shell is started. I believe that not overriding it would be more consistent with what happens when you override the completion function **after** the interactive shell. CLI is the only built-in API that uses this (See discussion in GH-5872). I believe MINIT and RINIT will only run once when invoked with `php -a`. Add documentation about the architecture of how php uses readline/libedit Closes GH-5872
* | Fix readline test after callback changesNikita Popov2020-07-211-5/+7
| | | | | | | | This one requires libedit and was probably missed for that reason.
* | Use ZPP callable check in readline extensionGeorge Peter Banyard2020-07-215-42/+31
| |
* | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-102-2/+2
| | | | | | | | Closes GH-5590
* | Remove proto comments from C filesMax Semenik2020-07-061-26/+13
| | | | | | | | Closes GH-5758
* | Replace EXPECTF when possibleFabien Villepinte2020-06-293-3/+3
| | | | | | | | Closes GH-5779
* | Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | Fix UNKNOWN default values in ext/readlineMáté Kocsis2020-06-233-11/+14
| | | | | | | | Closes GH-5755
* | Avoid convert_to_long_ex usage in readlineNikita Popov2020-06-231-6/+3
| |
* | Merge branch 'PHP-7.4'Nikita Popov2020-06-172-0/+4
|\ \ | |/
| * Suppress zend signals check in two readline testsNikita Popov2020-06-172-0/+4
| | | | | | | | | | Installing a callback handler may cause libedit to register new signals during the request.
* | Code tweaks: Remove unneeded semicolonsAlex Dowad2020-04-291-1/+1
| |
* | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-1/+1
| | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | Generate function entries for another batch of extensionsMáté Kocsis2020-04-053-40/+60
| | | | | | | | Closes GH-5352
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-091-1/+1
|\ \ | |/ | | | | | | * PHP-7.4: Enclose INI values containing {TMP} in quotes
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-091-1/+1
| |\ | | | | | | | | | | | | * PHP-7.3: Enclose INI values containing {TMP} in quotes
| | * Enclose INI values containing {TMP} in quotesChristoph M. Becker2020-03-091-1/+1
| | | | | | | | | | | | | | | At least on Windows, the temporary directory may contain tilde signs, which would result in an INI parse error.
* | | Reindent phpt filesNikita Popov2020-02-033-7/+7
| | |
* | | Use RETURN_THROWS() after try_convert_to_string()Máté Kocsis2020-01-031-4/+4
| | |
* | | Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-13/+13
| | | | | | | | | | | | Except for some bigger ones: reflection, sodium, spl
* | | Add union return types for function stubsMáté Kocsis2019-11-112-3/+2
| | |
* | | Cleanup return values when parameter parsing is unsuccessfulMáté Kocsis2019-10-301-2/+2
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-09-301-1/+4
|\ \ \ | |/ /
| * | Fix borked SKIPIFsFabien Villepinte2019-09-301-1/+4
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-254-8/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-09-111-0/+1
|\ \ \ | |/ /
| * | Free history_get_history_state() resultNikita Popov2019-09-111-0/+1
| | | | | | | | | | | | | | | It's not documented, but per https://bugs.python.org/issue8065 the result is freshly malloc'd and needs to be freed.
* | | Make sure that params with null default are marked nullableNikita Popov2019-08-262-2/+2
| | |
* | | Fix bug77812-*.phptChristoph M. Becker2019-08-232-2/+8
| | | | | | | | | | | | Undefined constants error as of PHP 8.0.0.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-08-233-4/+95
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #77812: Interactive mode does not support PHP 7.3-style heredoc
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-08-233-4/+95
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #77812: Interactive mode does not support PHP 7.3-style heredoc
| | * Fix #77812: Interactive mode does not support PHP 7.3-style heredocChristoph M. Becker2019-08-233-4/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | As of PHP 7.3.0, the rules regarding the heredoc and nowdoc closing identifier have been relaxed. While formerly, the closing identifier was required to be placed at the beginning of a line and to be immediately followed by (a semicolon and) a line break, it may now be preceeded by whitespace, and may be followed by any non-word character. We adjust the recognition logic respectively.
* | | Add readline arginfo stubsStephen Reay2019-08-123-56/+101
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-08-121-0/+16
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Add missing argument checks
| * | Add missing argument checksChristoph M. Becker2019-08-121-0/+16
| | | | | | | | | | | | | | | These functions don't expect any arguments, so we should check that none are given.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-07-161-10/+2
|\ \ \ | |/ /
| * | Introduce zend_stream_init_filename()Nikita Popov2019-07-161-10/+2
| | | | | | | | | | | | Avoid more ad-hoc initialization of zend_file_handle structures.