1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

2365 Commits

Author SHA1 Message Date
Nikita Popov c10f30fdf9 Mark spl_autoload_register function arg as UNKNOWN
Not passing any parameters to this function has magic behavior.
2020-04-09 16:54:40 +02:00
Máté Kocsis 3709e74b5e Store default parameter values of internal functions in arg info
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>
2020-04-08 18:37:51 +02:00
Christoph M. Becker 9809713844 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #69264: __debugInfo() ignored while extending SPL classes
2020-04-06 12:04:12 +02:00
Christoph M. Becker 22a077b642 Fix #69264: __debugInfo() ignored while extending SPL classes
We actually implement `::__debugInfo()` and drop the `get_debug_info()`
handlers of all relevant SPL classes.  This is cleaner and gives more
flexibility regarding overriding the functionality in descendant
classes.
2020-04-06 12:01:29 +02:00
Nikita Popov 2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02:00
Máté Kocsis b6229fbca2 Display nullability in type error messages for internal functions
Closes GH-5327
2020-03-31 16:55:36 +02:00
Máté Kocsis 36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00
Nikita Popov fb5bfcb75b Add a ZEND_UNCOMPARABLE value
To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.
2020-03-31 12:36:48 +02:00
Nikita Popov 97cb81ead5 Remove HAVE_REALPATH checks
We do not actually use realpath(), but a custom implementation.
Make sure the realpath() function is always available.

Closes GH-5290.
2020-03-26 11:46:00 +01:00
Máté Kocsis 782f7e2ad8 Fix #75958 Return void instead of true 2020-03-25 15:04:33 +01:00
Máté Kocsis 2e8ccce5dc Add stubs for SplDoublyLinkedList
Closes GH-5293
2020-03-25 15:01:24 +01:00
Máté Kocsis a42e8e8ec4 Add stubs for SPL iterators
Closes GH-5286
2020-03-24 08:02:27 +01:00
Máté Kocsis 01b266aac4 Improve error messages of various extensions
Closes GH-5278
2020-03-23 18:59:04 +01:00
Nikita Popov 816a1fd4af Don't use quiet zpp in RecursiveIteratorIterator ctor
Don't be a special snowflake, generate a standard TypeError here.
2020-03-23 14:22:51 +01:00
Christoph M. Becker bdb63a3068 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79393: Null coalescing operator failing with SplFixedArray
2020-03-23 13:59:22 +01:00
Máté Kocsis fe88d23914 Fix ZPP of SplFileInfo::openFile() 2020-03-23 13:37:51 +01:00
Máté Kocsis 66fc55642c Add stubs for SplFileInfo et al.
Closes GH-5287
2020-03-23 13:36:17 +01:00
Christoph M. Becker 4576da0aa7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79393: Null coalescing operator failing with SplFixedArray
2020-03-23 13:31:25 +01:00
Christoph M. Becker 47c745555c Fix #79393: Null coalescing operator failing with SplFixedArray
We favor the KISS principle over optimization[1] – SPL is already
special enough.

[1] <https://github.com/php/php-src/pull/2489/commits/352f3d4476a79bb86136b431719df7394e5a8d4e#r112498098>ff
2020-03-23 13:29:25 +01:00
Nikita Popov adb7297b0f Minor cleanup in spl_direcotry
* Rename variable for clarity
* Reduce section with replaced error handling
* Drop comment code line
2020-03-23 10:02:29 +01:00
Máté Kocsis c3554eb2c4 Fix ZPP of MultipleIterator::detachIterator() and MultipleIterator::containsIterator() 2020-03-16 12:05:40 +01:00
Máté Kocsis 04a44e1f08 Add stubs for SplObjectStorage and MultipleIterator
Closes GH-5267
2020-03-16 12:05:23 +01:00
Máté Kocsis 0ae8a3f3d6 Add stubs for SplHeap and SplPriorityQueue
Closes GH-5266
2020-03-16 12:04:56 +01:00
Máté Kocsis d2b902f174 Add some stubs for SPL
Closes GH-5245
2020-03-10 11:41:48 +01:00
Christoph M. Becker ef32de34da Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip test on Windows if privileges are insufficient
2020-03-06 16:41:34 +01:00
Christoph M. Becker a595b82665 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Skip test on Windows if privileges are insufficient
2020-03-06 16:40:14 +01:00
Christoph M. Becker dc4f42508d Skip test on Windows if privileges are insufficient 2020-03-06 16:38:49 +01:00
Christoph M. Becker f3c24ec265 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #75673: SplStack::unserialize() behavior
2020-03-06 09:12:03 +01:00
Christoph M. Becker b761997de3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #75673: SplStack::unserialize() behavior
2020-03-06 09:11:10 +01:00
Christoph M. Becker b84277297a Fix #75673: SplStack::unserialize() behavior
Even though `SplStack::unserialize()` is not supposed to be called on
an already constructed instance, it is probably better if the method
clears the stack before actually unserializing.
2020-03-06 09:09:49 +01:00
Nikita Popov 336eb48c36 Automatically implement Stringable interface 2020-03-02 15:25:33 +01:00
Nicolas Grekas 9e775db025 Define Stringable with __toString():string method 2020-03-02 15:25:32 +01:00
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00
Nikita Popov 98ad4d3b5b Give arginfo to SplFileInfo::_bad_state_ex()
We should really get rid of this hack though... Wow!
2020-02-25 11:18:25 +01:00
Nikita Popov ac51a5f02a Make SPL doubly linked list smaller
Store rc in data u2. This drops element size from 40 to 32 bytes.
2020-02-21 09:54:18 +01:00
Máté Kocsis ac0853eb26 Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Nikita Popov f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Nikita Popov 58b17906f5 Apply tidy formatting
Mostly reindent PHP scripts to spaces.
2020-02-03 13:41:31 +01:00
Nikita Popov ca8657a2b5 Initialize SplFixedArray elements to NULL instead of UNDEF
The SplFixedArray API treats all elements as NULL, even if they
have not been explicitly initialized. Rather than initializing
to UNDEF an treating that specially in various circumstances,
directly initialize elements to NULL.

This also fixes an assertion failure in the attached test case.
2020-01-30 15:31:39 +01:00
Nikita Popov 60f62359a0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79151
2020-01-23 14:21:21 +01:00
Nikita Popov 3f020aef85 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79151
2020-01-23 14:21:14 +01:00
Nikita Popov db9776c53c Fixed bug #79151
Make sure we also NULL out next/prev of the removed element on
pop/shift. This only matter is that element is still being referenced
by an iterator.
2020-01-23 14:20:26 +01:00
Nikita Popov 6811222422 Eliminate uses of ZVAL_ZVAL and friends
Instead add RETURN_COPY(_VALUE) macros will the expected behavior.

RETURN_ZVAL doesn't make any sense since PHP 7, but has stuck
around, probably because the alternative was to write directly to
the return_value variable.
2020-01-20 10:34:17 +01:00
Máté Kocsis d1764ca330 Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis afdaa91170 Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Máté Kocsis 0b4778c377 Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Máté Kocsis aadd3aaed9 Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis b7d2882fee Use zend_parse_parameters_none() instead of zend_parse_parameters_none_throw() 2020-01-03 13:22:39 +01:00
Máté Kocsis 01a50778d1 Use RETURN_THROWS() after zend_throw_exception() in most of the extensions 2020-01-02 10:56:18 +01:00
Máté Kocsis 9099dbd961 Use RETURN_THROWS() after zend_type_error() 2020-01-01 14:23:21 +01:00