1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 12:13:02 +02:00
Commit Graph

669 Commits

Author SHA1 Message Date
George Peter Banyard
d5e9ef8f0f Promote warnings to error in array_flip()
Closes GH-4576.
2019-10-02 12:31:02 +02:00
George Peter Banyard
1ca4ab09a5 Promote warnings to errors in array_push()
This is in line with the engine change from
https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:38:23 +02:00
Nikita Popov
2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Nikita Popov
0ebf2bdba0 Convert "Illegal offset type" warnings to exceptions 2019-09-27 13:00:07 +02:00
Nikita Popov
34e7c2daf0 Merge branch 'PHP-7.4' 2019-09-27 10:49:25 +02:00
Nikita Popov
a6c9c7c2b8 Handle resources used as array keys consistently
Resources used as array keys are generally handled by throwing a
notice and converting the resource to the resource handle. The only
exception is the [$resource => null] syntax, where this was treated
as an illegal offset type instead. However, this also only happened
for VM evaluations, the AST evaluator did handle resources correctly.
2019-09-27 10:40:41 +02:00
George Peter Banyard
f816171240 Indicate entry is skipped in error message 2019-09-18 22:30:12 +02:00
George Peter Banyard
62751b0d45 Promote warnings to errors in array_walk(_recursive)() 2019-08-29 16:02:59 +02:00
George Peter Banyard
81277a104c Promote warnings to errors in compact() 2019-08-29 16:02:20 +02:00
George Peter Banyard
20edea5a85 Promote warnings to errors in array_merge(_recursive)() and array_replace() 2019-08-29 16:01:39 +02:00
George Peter Banyard
70e604ee46 Promote warnings to errors in extract() 2019-08-28 23:15:01 +02:00
George Peter Banyard
9fc3d5da11 Promote warnings to errors in max() 2019-08-27 23:41:22 +02:00
George Peter Banyard
b91a881b32 Promote warnings to errors in min() 2019-08-27 23:38:22 +02:00
George Peter Banyard
c1c8538f95 Promote warnings to errors in array_rand() 2019-08-26 13:31:02 +02:00
George Peter Banyard
675e975185 Promote warning to error in zend_forbid_dynamic_call() 2019-08-23 20:01:51 +02:00
George Peter Banyard
c1fcf2d616 Promote warnings to errors in array_pad() 2019-08-22 19:30:20 +02:00
George Peter Banyard
7dcbcd4ca5 Promote warnings to errors in array_column() 2019-08-22 19:27:47 +02:00
George Peter Banyard
7d4e3dc32d Promote warnings to errors in array_combine() 2019-08-21 18:12:56 +02:00
George Peter Banyard
eaf66df517 Promote warnings to errors in array_multisort() 2019-08-21 18:10:13 +02:00
George Peter Banyard
c70f92caf8 Promote warning to error in array_chunk() 2019-08-21 18:07:35 +02:00
George Peter Banyard
7c6acc2eef Promote warnings to errors in range() 2019-08-21 18:05:08 +02:00
Nikita Popov
36db71df47 Merge branch 'PHP-7.4' 2019-07-22 12:28:40 +02:00
Nikita Popov
0ba7c3eadf Deprecate array_key_exists() on objects 2019-07-22 11:39:52 +02:00
Nikita Popov
106f71cc94 Merge branch 'PHP-7.4' 2019-07-10 12:05:24 +02:00
Nikita Popov
c42b7dd6d3 Throw notice on array access on illegal type
No notice is thrown for list() accesses, because we did not come
to an agreement regarding patterns like

    while ([$key, $value] = yield $it->next()) { ... }

where silent null access may be desirable.

No effort is made to suppress multiple notices in access chains
likes $x[0][0][0], because the technical complexity this causes
does not seem worthwhile.

RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
2019-07-10 12:02:14 +02:00
Dmitry Stogov
d7aa152d3f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:50:30 +03:00
Dmitry Stogov
8fbfd8872a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:50:19 +03:00
Dmitry Stogov
972223c342 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:48:57 +03:00
Dmitry Stogov
83cdb89f8a Fixed bug #77135 (Extract with EXTR_SKIP should skip $this) 2019-06-07 11:36:39 +03:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
321fe88935 Add Z_PARAM_NUMBER and use it for some functions 2019-06-03 10:14:05 +02:00
Nikita Popov
4e391ee3a3 Convert some warnings to TypeErrors in array functions
This is manual type and argument number checking code that was not
covered by the zpp move to TypeErrors.
2019-05-31 10:52:06 +02:00
Nikita Popov
0b66563eee Merge branch 'PHP-7.4' 2019-05-28 11:15:37 +02:00
Dik Takken
77cf3d7b11 Allow array_merge() / array_merge_recursive() without arguments
This allows writing

    array_merge(...$arrays)

instead of

    array_merge([], ...$arrays)

and is in line with similar changes to array_push() and array_unshift()
in PHP 7.3.

Closes GH-4175.
2019-05-28 11:14:15 +02:00
Christoph M. Becker
2e91a90f0b Merge branch 'PHP-7.4'
* PHP-7.4:
  Make more tests run on Windows
2019-05-27 10:52:25 +02:00
Gabriel Caruso
4bb6f9ba99 Make more tests run on Windows 2019-05-27 10:51:53 +02:00
Gabriel Caruso
53d1a42c32 Fix test related to 714d9fc358
The string value in the test array was removed, as the `chr` function 
only accepts an integer
2019-05-19 08:47:53 -03:00
Gabriel Caruso
a437f065b8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Make chr ZPP failure message consistent with ext/standard
2019-05-18 16:17:06 -03:00
Gabriel Caruso
714d9fc358 Make chr ZPP failure message consistent with ext/standard 2019-05-18 15:59:07 -03:00
Nikita Popov
15c0135d5b Merge branch 'PHP-7.4' 2019-04-23 11:40:56 +02:00
Nikita Popov
a7a318d3c0 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-23 11:40:43 +02:00
Nikita Popov
cedee4408b Fixed bug #77931 2019-04-23 11:40:13 +02:00
Nikita Popov
6f82ca8742 Merge branch 'PHP-7.4' 2019-03-25 17:36:38 +01:00
Nikita Popov
0b835e3e24 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-25 17:36:15 +01:00
Nikita Popov
e97577edde Fixed bug #77793
By making sure that we always first increment the refcount of the
new value before we destroy the old one.
2019-03-25 17:33:17 +01:00
Nikita Popov
8971728383 Merge branch 'PHP-7.4' 2019-03-20 12:07:05 +01:00
Nikita Popov
abc457fe1d Fixed bug #74345
Export zend_release_fcall_info_cache(). It is only necessary to
call it if the fcc may not have been used -- if it is passed to
zend_call_function() and friends, then they will take care of
freeing trampolines.
2019-03-20 12:06:42 +01:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00