summaryrefslogtreecommitdiff
path: root/ext/spl
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add support for `@implementation-alias` in stubsMáté Kocsis2020-09-2112-46/+46
| | | | | | | | Closes GH-6170
* | Run tidyNikita Popov2020-09-181-8/+8
| | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | Generate arginfosMáté Kocsis2020-09-161-10/+6
| |
* | Display string default values in stubs more uniformlyMáté Kocsis2020-09-161-4/+4
| | | | | | | | Settling on using quoted string
* | Display types in stubs more uniformlyMáté Kocsis2020-09-162-2/+2
| | | | | | | | | | | | In preparation for generating method signatures for the manual. This change gets rid of bogus false|null return types, a few unnecessary trailing backslashes, and settles on using ? when possible for nullable types.
* | Use ValueError instead of exceptions in SPL extensionGeorge Peter Banyard2020-09-1514-101/+86
| |
* | Use normal error in SPL for uninitialized objectsGeorge Peter Banyard2020-09-157-49/+38
| |
* | Use normal error in SPL for 'An iterator cannot be used with foreach by ↵George Peter Banyard2020-09-1512-14/+14
| | | | | | | | reference'
* | Update array parameter names for named parametersLarry Garfield2020-09-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The array "subject" of a function gets called $array. * Further parameters should be self-descriptive if used as a named parameter, and a full word, not an abbreviation. * If there is a "bunch more arrays" variadic, it gets called $arrays (because that's what was already there). * A few functions have a variadic "a bunch more arrays, and then a callable", and were already called $rest. I left those as is and died a little inside. * Any callable provided to an array function that acts on the array is called $callback. (Nearly all were already, I just fixed the one or two outliers.) * array_multisort() is beyond help so I ran screaming.
* | Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-0913-21/+21
| | | | | | | | Closes GH-5999
* | Make null byte error a ValueErrorNikita Popov2020-09-083-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently we treat paths with null bytes as a TypeError, which is incorrect, and rather inconsistent, as we treat empty paths as ValueError. We do this because the error is generated by zpp and it's easier to always throw TypeError there. This changes the zpp implementation to throw a TypeError only if the type is actually wrong and throw ValueError for null bytes. The error message is also split accordingly, to be more precise. Closes GH-6094.
* | Fix UNKNOWN default values in various extensionsMáté Kocsis2020-09-074-11/+11
| | | | | | | | Closes GH-6075
* | Use ZPP instead of custom type checksMáté Kocsis2020-09-044-23/+29
| | | | | | | | We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
* | Extract common flock codeGeorge Peter Banyard2020-09-041-24/+2
| | | | | | | | | | | | As SPL is currently a copie of the code in file.c Closes GH-6069
* | Release call trampolines in zpp fccNikita Popov2020-09-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using zpp 'f' or Z_PARAM_FUNC, if the fcc points to a call trampoline release it immediately and force zend_call_function to refetch it. This may require additional callability checks if __call is used, but avoids the need to carefully free fcc values in all internal functions -- in some cases this is not simple, as a type error might be triggered by a later argument in the same zpp call. This fixes oss-fuzz #25390. Closes GH-6073.
* | Error promotions in SPLGeorge Peter Banyard2020-09-039-41/+47
| | | | | | | | | | | | | | Warning to Error promotion and a Notice to Warning promotion to align with the behaviour specified in the Reclassify Engine Warnings RFC. Closes GH-6072
* | Refactor parts of SPL Dir/SplFileObjectGeorge Peter Banyard2020-09-033-136/+154
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a way it was possible to trigger an Internel Error by disabling function (via the INI setting) when SPL was acting as a proxy to the function call. Fix flock_compat layer as it needs to used in SPL now. Use macro to check if object is initialized Closes GH-6014
* | Add more precise type info for stubsMáté Kocsis2020-09-0127-226/+143
| | | | | | | | Closes GH-6005
* | Promote ArrayObject modification during sorting to Error exceptionNikita Popov2020-08-283-11/+19
| |
* | Use zend_dval_to_lval() in spl_offset_convert_to_long()Nikita Popov2020-08-271-1/+1
| | | | | | | | Avoid fptoi UB and use the standard PHP conversion behavior.
* | Fixed bug #79987 (Memory leak in SplFileInfo because of missing ↵Dmitry Stogov2020-08-182-0/+23
| | | | | | | | zend_restore_error_handling())
* | Return empty string from SplFileInfo::getPathname()Nikita Popov2020-08-143-3/+3
| | | | | | | | | | | | | | Instead of false. This is consistent with how other methods like SplFileInfo::getPath() behave. It's also a requirement before SplFileInfo::__toString() calls SplFileInfo::getPathname() and needs to return a string.
* | Merge branch 'PHP-7.4'Nikita Popov2020-08-141-0/+2
|\ \ | |/ | | | | | | * PHP-7.4: Add missing initialization check to RegexIterator::getRegex()
| * Add missing initialization check to RegexIterator::getRegex()Nikita Popov2020-08-141-0/+2
| |
* | Use a dedicated method for MultipleIterator::countIterators()Nikita Popov2020-08-133-6/+15
| | | | | | | | | | This method has a different signature from SplObjectStorage::count(), so don't share implementations.
* | Replace fatal error in SplFileInfo with exceptionNikita Popov2020-08-131-25/+48
| | | | | | | | | | Using RuntimeException here, because the same error condition uses that in many other places in this file.
* | Add many missing closing PHP tags to testsMáté Kocsis2020-08-0929-0/+29
| | | | | | | | Closes GH-5958
* | Add another round of missing parameter types to stubsMáté Kocsis2020-08-072-10/+10
| | | | | | | | Closes GH-5950
* | Accept zend_object in zend_read_propertyNikita Popov2020-08-071-1/+1
| |
* | Promote "undefined array key" notice to warningNikita Popov2020-08-0320-58/+59
| | | | | | | | | | | | | | This implements the last remaining part of the https://wiki.php.net/rfc/engine_warnings RFC. Closes GH-5927.
* | Convert SPL illegal offset type into TypeErrorNikita Popov2020-08-033-15/+43
| | | | | | | | | | Make this consistent with the corresponding engine behavior. Also adjust the messages to match.
* | Improve a few parameter names in ext/splMáté Kocsis2020-08-035-62/+62
| | | | | | | | Use the same names which are used by zend functions.
* | Implement named parametersNikita Popov2020-07-312-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* | Fix bug #79108Nikita Popov2020-07-241-15/+7
| | | | | | | | | | | | | | | | | | | | Don't expose references in debug_backtrace() or exception traces. This is regardless of whether the argument is by-reference or not. As a side-effect of this change, exception traces may now acquire the interior value of a reference, which may be unexpected for some internal functions. This is what necessitated the change in the spl_array sort implementation.
* | Cleanup SPL instantiation codeNikita Popov2020-07-233-48/+13
| |
* | Improved number to string comparison semanticsNikita Popov2020-07-221-1/+1
| | | | | | | | | | | | RFC: https://wiki.php.net/rfc/string_to_number_comparison Closes GH-3886.
* | Check dual_it validity in CallbackFilterIterator::accept()Nikita Popov2020-07-221-8/+6
| | | | | | | | | | Avoid accessing intern->u.cbfilter null pointer, though it's harmless here.
* | Only set DIT type on successful initializationNikita Popov2020-07-172-3/+18
| |
* | Convert SPL fatal error to Error exceptionNikita Popov2020-07-172-4/+6
| |
* | Throw correct exception from ArrayObject sort methodsNikita Popov2020-07-175-24/+34
| | | | | | | | Let normal zpp throw ArgumentCountErrors.
* | Improve output of tokens in Parse ErrorsRowan Tommins2020-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, unexpected tokens in the parser are shown as the text found, plus the internal token name, including the notorious "unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)". This commit replaces that with a more user-friendly format, with two main types of token: * Tokens which always represent the same text are shown like 'unexpected token "::"' and 'expected "::"' * Tokens which have variable text are given a user-friendly name, and show like 'unexpected identifier "foo"', and 'expected identifer'. A few tokens have special cases: * unexpected token """ -> unexpected double-quote mark * unexpected quoted string "'foo'" -> unexpected single-quoted string "foo" * unexpected quoted string ""foo"" -> unexpected double-quoted string "foo" * unexpected illegal character "_" -> unexpected character 0xNN (where _ is almost certainly a control character, and NN is the hexadecimal value of the byte) The \ token has a special case in the implementation just to stop bison making a mess of escaping it and it coming out as \\
* | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-1034-86/+86
| | | | | | | | Closes GH-5590
* | Remove no_separation flagNikita Popov2020-07-073-3/+0
| |
* | Don't allow separation in CallbackFilterIteratorNikita Popov2020-07-072-7/+3
| | | | | | | | | | As the name might suggest, this is a *filter* iterator. If you want to have a *map* iterator, write one, or use a generator.
* | Remove proto comments from C filesMax Semenik2020-07-068-692/+335
| | | | | | | | Closes GH-5758
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-07-021-6/+2
|\ \ | |/ | | | | | | * PHP-7.4: Extract test helper function for SeCreateSymbolicLinkPrivilege check
| * Extract test helper function for SeCreateSymbolicLinkPrivilege checkChristoph M. Becker2020-07-021-6/+2
| |
* | Add get_gc handle for object iteratorsNikita Popov2020-07-016-8/+16
| | | | | | | | Optional handler with the same semantics as the object handler.
* | Fix typos in commentsFabien Villepinte2020-07-011-1/+1
| |
* | [ci skip] Various typo fixes in stub comments and CHANGES fileAyesh Karunaratne2020-06-251-1/+1
| |