Nikita Popov
be9c5daf28
Remove null from highlight_* return types
...
Also fix show_source() discrepancy in func_info.
2020-07-21 10:40:08 +02:00
Máté Kocsis
d30cd7d7e7
Review the usage of apostrophes in error messages
...
Closes GH-5590
2020-07-10 21:05:28 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
...
Closes GH-5758
2020-07-06 21:13:34 +02:00
Christoph M. Becker
2a28589c7d
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix potential environment variable deadlock
2020-06-24 11:44:47 +02:00
Christoph M. Becker
32257ac17f
Fix potential environment variable deadlock
...
We have to unlock the environment before bailing out.
2020-06-24 11:44:07 +02:00
Christoph M. Becker
408961987f
Fix typos
2020-06-17 16:45:12 +02:00
Nikita Popov
2c207ebe6b
Remove debug code from usleep()
...
This was added to debug CI failures, but ultimately didn't help
understand the macos timing issues. Drop it now so it's not
forgotten...
2020-06-16 14:51:58 +02:00
twosee
83a77015ad
Add helper APIs for maybe-interned string creation
...
Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.
Add zend_string_init_fast() as a helper for the empty string /
one char interned string / zend_string_init() pattern.
Also add corresponding ZVAL_STRINGL_FAST etc macros.
Closes GH-5684.
2020-06-08 15:31:52 +02:00
twosee
88355dd338
Constify char * arguments of APIs
...
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Máté Kocsis
aa9b0ccda8
Add tests to check mismatching function signatures
...
Closes GH-5666
2020-06-06 09:23:34 +02:00
Nikita Popov
975acfe71e
Pass zend_string message to zend_error_cb
...
This makes the zend_error_cb API simpler, and avoid formatting
the same message in multiple places.
It should be noted that the passed zend_string is always
non-persistent, so if you want to store it persistently somewhere,
you may still need to duplicate it.
The last_error_message is cleared a bit more aggressive, to make
sure it doesn't hang around across allocator life-cycles.
Closes GH-5639.
2020-06-05 09:54:02 +02:00
Nikita Popov
3f76947303
Rename locale_string to ctype_string
...
To make it more obvious that this only refers to the LC_CTYPE
locale.
2020-05-07 18:45:03 +02:00
Nikita Popov
c4ad8beaa8
Do not inherit LC_CTYPE locale from environment
...
Treatment of locales in PHP is currently inconsistent: The LC_ALL
locale is set to "C", as is standard behavior on program startup.
The LC_CTYPE locale is set to "", which will inherit it from the
environment. However, the inherited LC_CTYPE locale will only be
used in some cases, while in other cases it is necessary to perform
an explicit setlocale() call in PHP first. This is the case for
the locale-sensitive handling in the PCRE extension.
Make things consistent by *never* inheriting any locales from the
environment. LC_ALL, including LC_CTYPE will be "C" on startup.
A locale can be set or inherited through an explicit setlocale()
call, at which point the behavior will be fully consistent and
predictable.
Closes GH-5488.
2020-04-30 10:22:51 +02:00
Máté Kocsis
6111d64cda
Improve a last couple of argument error messages
...
Closes GH-5404
2020-04-20 13:09:00 +02:00
Máté Kocsis
50765075db
Improve some ValueError messages
...
Closes GH-5340
2020-04-06 10:41:01 +02:00
Nikita Popov
51bc6233b2
Generate function entries from stubs
...
If @generate-function-entries is specified in the stub file,
also generate function entries for the extension.
Currently limited to free functions only.
2020-04-03 15:41:41 +02:00
George Peter Banyard
457380cae7
Drop wchar header check as always defined since C95
2020-03-31 00:14:56 +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
bb6f374048
Improve argument error messages in ext/standard
...
Closes GH-5198
2020-03-18 19:56:10 +01:00
Philipp Tanlak
1668ad7cb1
Add str_contains() function
...
RFC: https://wiki.php.net/rfc/str_contains
Closes GH-5179.
2020-03-16 11:05:26 +01:00
Nikita Popov
bb6e2a1615
Avoid used of "named fn" in ext/standard
2020-02-25 10:21:31 +01:00
Nikita Popov
1892def3a8
Add rand() to ext/standard stub
2020-02-21 16:27:59 +01:00
Máté Kocsis
c231bbb852
Remove restore_include_path()
...
Closes GH-5189
2020-02-20 09:11:36 +01:00
Máté Kocsis
736b22dc0b
Add stubs for aliases
...
Closes GH-5187
2020-02-18 21:10:36 +01:00
Nikita Popov
16f194c75e
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix bug #78323 : Code 0 is returned on invalid options
2020-01-27 13:32:51 +01:00
Nikita Popov
1cccbb8ff1
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix bug #78323 : Code 0 is returned on invalid options
2020-01-27 13:32:38 +01:00
Ivan Mikheykin
fd08f062ae
Fix bug #78323 : Code 0 is returned on invalid options
...
Set CLI exit code to 1 when invalid parameters are passed,
and print error to stderr.
2020-01-27 13:32:19 +01:00
Nikita Popov
7ce531f2c2
Make constant() error handling consistent with plain const lookup
...
This means we get an Error exception and a much better error
message indicating the root cause (e.g. accessing a private class
constant).
2020-01-10 13:39:56 +01:00
Máté Kocsis
7b4a4d2ace
Use RETURN_THROWS() after try_convert_to_string()
2020-01-03 17:04:06 +01:00
Máté Kocsis
349a286461
Use RETURN_THROWS() after zend_throw_error()
2020-01-01 16:42:30 +01:00
Máté Kocsis
9099dbd961
Use RETURN_THROWS() after zend_type_error()
2020-01-01 14:23:21 +01:00
Máté Kocsis
31cf9a7ea9
Use RETURN_THROWS() when an exception is thrown
...
Closes GH-5036
2019-12-30 17:38:10 +01:00
Máté Kocsis
e34a1f9289
Convert zend_parse_parameters_none() to fast ZPP in standard lib
...
Closes GH-5037
2019-12-30 15:28:37 +01:00
Máté Kocsis
d59bc80782
Fix smaller issues with stubs
...
GH-5025
2019-12-20 14:31:07 +01:00
Máté Kocsis
d7b2082352
Add stubs for standard library
...
Closes GH-5017
2019-12-20 12:01:35 +01:00
Tyson Andre
1695d3ed07
Add funcinfo for spl global functions
...
This assumes that `iterator_*` will now always throw or abort on failure.
Also, move #include _arginfo.h directive to the top of the file - virtually all
other files put it there, and developers may base code on basic_functions.c.
Closes GH-4968
2019-12-11 18:17:04 -05:00
Máté Kocsis
51eefd8079
Add stubs for standard library
2019-12-11 18:50:36 +01:00
Máté Kocsis
9563449d8b
Add stubs for another batch of standard functions
2019-12-09 19:47:08 +01:00
Máté Kocsis
29ef07728e
Remove magic quotes legacy
2019-12-05 13:15:54 +01:00
Máté Kocsis
633926021b
Remove ezmlm_hash() function
2019-12-05 13:15:54 +01:00
Máté Kocsis
144b41ce88
Remove money_format() function
2019-12-05 13:15:54 +01:00
Máté Kocsis
64468d1e3b
Remove convert_cyr_string() function
2019-12-05 13:15:54 +01:00
Máté Kocsis
b63c625260
Remove hebrevc() function
2019-12-05 13:15:54 +01:00
Fabien Villepinte
2adb1bba17
Fix proto of forward_static_call_array
...
Closes GH-4928.
2019-11-18 12:46:05 +01:00
Máté Kocsis
ab6b412a0b
Add stubs for standard lib functions
2019-11-07 17:59:03 +01:00
Máté Kocsis
afe4a879c7
Promote register_tick_function() callback validation warning to an exception
2019-11-07 17:56:58 +01:00
Máté Kocsis
662afc80f8
Remove PHP_SLEEP_NON_VOID as it is not useful anymore
2019-11-07 17:56:26 +01:00
Máté Kocsis
f19950fea0
Promote some warnings to exceptions in standard lib
...
Closes GH-4879.
2019-11-01 17:07:51 +01:00
Máté Kocsis
ad9ea5abde
Add stubs for various standard functions
...
Closes GH-4851.
2019-10-30 10:34:06 +01:00
Máté Kocsis
fee94da127
Add stubs for directory and file functions
2019-10-30 10:10:40 +01:00