1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

504 Commits

Author SHA1 Message Date
Theodore Brown
c03215b623 Fix missing deprecation message for default case statement followed by semicolon (#20172)
Follow-up to GH-19215
2025-10-20 10:29:54 +02:00
Gina Peter Banyard
b4ed215299 core: Warn when non-representable floats are coerced to int (#19760)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
2025-09-21 23:53:16 +01:00
Gina Peter Banyard
8747e9ae18 Zend: Warn when destructuring non-array values (#19439)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#destructuring_non-array_values
2025-08-29 16:06:34 +01:00
Gina Peter Banyard
93716bece4 Enact follow-up phase of the "Path to Saner Increment/Decrement operators" RFC (#19374)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#enact_follow-up_phase_of_the_path_to_saner_incrementdecrement_operators_rfc
2025-08-23 14:36:39 +01:00
Theodore Brown
5f8d648af6 Deprecate terminating case statements with a semicolon (#19215)
Part of https://wiki.php.net/rfc/deprecations_php_8_5

Closes GH-15258
2025-08-11 14:18:06 +02:00
Shivam Mathur
9adc94985f Merge branch 'PHP-8.4' 2025-06-25 03:23:03 +05:30
Shivam Mathur
a8bd3ba1bb Merge branch 'PHP-8.3' into PHP-8.4 2025-06-25 03:22:43 +05:30
Shivam Mathur
ac15486ae0 Fix CI for windows-2022
This is a continuation of GH-18927 to fix CI for windows-2022
2025-06-25 03:20:49 +05:30
David Hein
77d5eb6a5a [skip ci] Fix tests with multiline titles (GH-17763)
See GH-17761
2025-02-14 12:03:53 +01:00
Dmitry Stogov
ccc6c0f78c Fix GH-15709: Crashing tests on Windows x64 (#17095)
This is a quick fix for the problem.
It'll work while all the JIT-ed functions have the same "fixed stack frame".
Unwinder uses hard-coded unwind data for this "fixed stack frame".

* Preallocate space for Win64 shadow args

* typo

* Setup unwinder for JIT functions

* Revert "Dynamically xfail test case which fails on CI"

This reverts commit 7cc327fd5a.

* Revert "Dynamically xfail test case which fails on CI"

This reverts commit bdde797159.

* Revert "Dynamically xfail test cases which fail on CI (GH-15710)"

This reverts commit 6d5962074f.

* Remove XFAIL sections

* Add hard-coded SEH unwind data for EXITCALL

* Fix unwind data

* Fix Windows multi-process support

* Typo
2024-12-13 02:05:45 +03:00
Christoph M. Becker
6d5962074f Dynamically xfail test cases which fail on CI (GH-15710)
This is a stop-gap measure for GH-15709 to keep CI green.
2024-09-02 18:23:52 +02:00
Gina Peter Banyard
1e3d918936 ext/core: Deprecate passing E_USER_ERROR to trigger_error() (#15308)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
2024-08-09 15:51:07 +01:00
Michael
6bb960092a [skip ci] Fix some typos (#14893) 2024-07-10 00:11:36 +01:00
Niels Dossche
f20707491e Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix Windows SKIPIF (#14219)
2024-05-13 22:10:53 +02:00
Niels Dossche
f16e712327 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix Windows SKIPIF (#14219)
2024-05-13 22:10:42 +02:00
Niels Dossche
719fa46150 Fix Windows SKIPIF (#14219)
PHP_OS_FAMILY never has the value WIN, for Windows platforms it is the
string "Windows". As such, this test was never executed. Fix this.
2024-05-13 22:09:47 +02:00
Máté Kocsis
2079da0158 Fix #13865 Improve parameter and return value related deprecation messages (#13913)
I added the function/method name to some compile-time deprecation messages which are related to parameters/return values. Consistently with the other similar error messages, I included the function/method name at the start of the message.
2024-04-08 22:20:32 +02:00
Máté Kocsis
330cc5cdb2 Deprecate implicit nullable parameter types (#12959)
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-03-13 21:40:26 +01:00
Ilija Tovilo
f39b5c4c25 Close PHP tags in tests
Closes GH-12422
2023-10-18 17:34:10 +02:00
Máté Kocsis
c322da0606 Fix misleading pass by reference error message (#10639) 2023-07-18 15:02:38 +02:00
George Peter Banyard
d8696f9216 [RFC] Path to Saner Increment/Decrement operators (#10358)
* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2023-07-17 15:51:24 +01:00
George Peter Banyard
3d4ff5ae22 RFC: Deprecate remains of string evaluated code assertions (#11671)
Link: https://wiki.php.net/rfc/assert-string-eval-cleanup
2023-07-13 15:45:32 +01:00
Ilija Tovilo
0b1d750d91 Allow arbitrary expressions in static variable initializer
Closes GH-9301
2023-05-24 20:17:31 +02:00
Máté Kocsis
7936c8085e Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
Christoph M. Becker
4b1feda574 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9905: constant() behaves inconsistent when class is undefined
2022-11-09 15:23:21 +01:00
Christoph M. Becker
b2186ca7c4 Fix GH-9905: constant() behaves inconsistent when class is undefined
Directly referring to a constant of an undefined throws an exception;
there is not much point in `constant()` raising a fatal error in this
case.

Closes GH-9907.
2022-11-09 15:21:50 +01:00
Michael Voříšek
60189aa96a Skip locale tests /w musl libc (#9141) 2022-07-25 23:56:14 +01:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Kamil Tekiela
c3dda473cc Fix 'can not' in test data and in code comments 2021-10-05 09:51:58 +01:00
Máté Kocsis
75a678a7e3 Declare tentative return types for Zend (#7251)
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 13:44:20 +02:00
Ayesh Karunaratne
b8e380ab09 Update deprecation message for incompatible float to int conversion
Updates the deprecation message for implicit incompatible float to int conversion from:

```
Implicit conversion from non-compatible float %.*H to int in %s on line %d
```

to

```
Implicit conversion from float %.*H to int loses precision in %s on line %d
```

Related: #6661
2021-06-07 14:36:11 +02:00
George Peter Banyard
b6958bb847 Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)
RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-31 15:48:45 +01:00
Nikita Popov
e9b005158f Fix output buffer discard on memory limit
Move this code directly into the error handler, and check the
heap->overflow flag. Discarding output here allows us to print
the normal memory limit message to standard output. Otherwise
nothing would be printed unless a different log medium was used,
which makes for a suboptimal debugging experience.
2021-05-31 16:30:36 +02:00
Peter van Dommelen
3a4ea6cb91 Don't automatically adjust memory_limit to 2M
As PHP has a minimum memory usage of 2M (size of allocator chunk),
setting a limit below that value is not meaningful and will be
automatically rounded up to the chunk size. Rather than doing this
silently, show the newly introduced error message.

The memory limit had to be increased to 2M for a number of tests.

tests/lang/bug45392 has been marked as XFAIL. This old bugfix is
not working as intended. The memory limit in main's `PG(memory_limit)`
differs from the one in zend_alloc. In zend_alloc the `AG(mm_heap)->limit`
is defined as `max(passed_value, ZEND_MM_CHUNK_SIZE)`. The check made in
an unclean shutdown will never be true unless the memory limit is lower
than ZEND_MM_CHUNK_SIZE, which happened to be the case in the test.
https://bugs.php.net/bug.php?id=45392
fcc0fdd125
2021-05-31 15:42:10 +02:00
Nikita Popov
de6e401e05 Use common formatting for backtraces (#6977)
This makes debug_print_backtrace() use the same formatting as exception
backtraces. The only difference is that the final #{main} is omitted,
because it wouldn't make sense for limited backtraces, and wasn't there
previously either.
2021-05-18 11:43:37 +02:00
Máté Kocsis
30a082cb16 Make some exception properties typed
Closes GH-6891
2021-04-22 10:22:50 +02:00
Josh Soref
462da6e09c Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.
2021-04-13 12:09:37 +02:00
Dmitry Stogov
72c3ededed Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.
2021-03-01 13:29:49 +03:00
George Peter Banyard
3a4b89661e Remove quicktester
This is barely used and more of a hinderence than anything else

Closes GH-6712
2021-02-25 17:39:31 +00:00
George Peter Banyard
589bdf30b2 Implement Explicit octal notation for integers RFC
RFC: https://wiki.php.net/rfc/explicit_octal_notation

Add an extensive test suits for other variants of integer literals

Closes GH-6360
2021-01-04 21:09:23 +01:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
George Peter Banyard
31ef94cd42 Convert Division by 0 warnings to Error per the Engine Warning RFC
Closes GH-6125
2020-09-14 13:40:07 +02:00
Máté Kocsis
9975986b7e Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Máté Kocsis
7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
Nikita Popov
c48b745f00 Promote "undefined array key" notice to warning
This implements the last remaining part of the
https://wiki.php.net/rfc/engine_warnings RFC.

Closes GH-5927.
2020-08-03 14:40:50 +02:00
George Peter Banyard
b2248789ed Implement 'Saner Numeric Strings' RFC:
RFC: https://wiki.php.net/rfc/saner-numeric-strings

This removes the -1 allow_error mode from is_numeric_string functions and replaces it by
a trailing boolean out argument to preserve BC in a couple of places.

Most of the changes can be resumed to "numeric" strings which emitted a E_NOTICE now emit
a E_WARNING and "numeric" strings which emitted a E_WARNING now throw a TypeError.

This mostly affects:
 - String offsets
 - Arithmetic operations
 - Bitwise operations

Closes GH-5762
2020-07-29 02:51:09 +01:00
Andrea Faulds
f759936591 Permit trailing whitespace in numeric strings
This is part 1 of the 'Saner Numeric Strings' RFC:
https://wiki.php.net/rfc/saner-numeric-strings
2020-07-29 02:22:38 +01:00
Nikita Popov
acbf7802af Improved number to string comparison semantics
RFC: https://wiki.php.net/rfc/string_to_number_comparison

Closes GH-3886.
2020-07-22 12:23:49 +02:00
Máté Kocsis
5770b66722 Cleanup argument handling of Zend functions and methods
Closes GH-5847
2020-07-21 14:47:03 +02:00
Rowan Tommins
55a15f32ce Improve output of tokens in Parse Errors
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 \\
2020-07-13 11:07:40 +02:00