Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ PHP NEWS
. Fixed UConverter::transcode() silently truncating from_subst and to_subst
option lengths greater than 127 bytes. (Weilin Du)

- IO:
. Added new polling API. (Jakub Zelenka)

- JSON:
. Enriched JSON last error / exception message with error location.
(Juan Morales)
Expand Down
21 changes: 21 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ PHP 8.6 UPGRADE NOTES
IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks.
It is supported from icu 63.

- IO:
. Added new polling API.
RFC: https://wiki.php.net/rfc/poll_api

- JSON:
. Added extra info about error location to the JSON error messages returned
from json_last_error_msg() and JsonException message.
Expand Down Expand Up @@ -351,6 +355,23 @@ PHP 8.6 UPGRADE NOTES
. enum StreamErrorMode
. enum StreamErrorCode
RFC: https://wiki.php.net/rfc/stream_errors
. Io\Poll\Context
. Io\Poll\Watcher
. enum Io\Poll\Backend
. enum Io\Poll\Event
. interface Io\Poll\Handle
. Io\IoException
. Io\Poll\PollException
. Io\Poll\FailedPollOperationException
. Io\Poll\FailedContextInitializationException
. Io\Poll\FailedHandleAddException
. Io\Poll\FailedWatcherModificationException
. Io\Poll\FailedPollWaitException
. Io\Poll\BackendUnavailableException
. Io\Poll\InactiveWatcherException
. Io\Poll\HandleAlreadyWatchedException
. Io\Poll\InvalidHandleException
. StreamPollHandle

========================================
8. Removed Extensions and SAPIs
Expand Down
44 changes: 44 additions & 0 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,50 @@ int main(void) {
])
])

AC_DEFUN([PHP_POLL_MECHANISMS],
[
AC_MSG_CHECKING([for polling mechanisms])
poll_mechanisms=""

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/epoll.h>
], [
int fd = epoll_create(1);
return fd;
])], [
AC_DEFINE([HAVE_EPOLL], [1], [Define if epoll is available])
poll_mechanisms="$poll_mechanisms epoll"

AC_CHECK_FUNCS([epoll_pwait2], [], [], [#include <sys/epoll.h>])
])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/event.h>
#include <sys/time.h>
], [
int kq = kqueue();
return kq;
])], [
AC_DEFINE([HAVE_KQUEUE], [1], [Define if kqueue is available])
poll_mechanisms="$poll_mechanisms kqueue"
])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <port.h>
], [
int port = port_create();
return port;
])], [
AC_DEFINE([HAVE_EVENT_PORTS], [1], [Define if event ports are available])
poll_mechanisms="$poll_mechanisms eventport"
])

dnl Set poll mechanisms including poll that is always available
poll_mechanisms="$poll_mechanisms poll"

AC_MSG_RESULT([$poll_mechanisms])
])

dnl ----------------------------------------------------------------------------
dnl Library/function existence and build sanity checks.
dnl ----------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ AC_CHECK_HEADERS(m4_normalize([
])

PHP_FOPENCOOKIE
PHP_POLL_MECHANISMS
PHP_BROKEN_GETCWD
AS_VAR_IF([GCC], [yes], [PHP_BROKEN_GCC_STRLEN_OPT])

Expand Down Expand Up @@ -1682,6 +1683,17 @@ PHP_ADD_SOURCES_X([main],
[PHP_FASTCGI_OBJS],
[no])

PHP_ADD_SOURCES([main/poll], m4_normalize([
poll_backend_epoll.c
poll_backend_eventport.c
poll_backend_kqueue.c
poll_backend_poll.c
poll_core.c
poll_fd_table.c
poll_handle.c
]),
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])

PHP_ADD_SOURCES([main/streams], m4_normalize([
cast.c
filter.c
Expand Down
4 changes: 1 addition & 3 deletions ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -4635,9 +4635,7 @@ ZEND_METHOD(ReflectionClass, getProperty)
str_name = ZSTR_VAL(name);
if ((tmp = strstr(ZSTR_VAL(name), "::")) != NULL) {
classname_len = tmp - ZSTR_VAL(name);
classname = zend_string_alloc(classname_len, 0);
zend_str_tolower_copy(ZSTR_VAL(classname), ZSTR_VAL(name), classname_len);
ZSTR_VAL(classname)[classname_len] = '\0';
classname = zend_string_init(ZSTR_VAL(name), classname_len, 0);
str_name_len = ZSTR_LEN(name) - (classname_len + 2);
str_name = tmp + 2;

Expand Down
2 changes: 1 addition & 1 deletion ext/reflection/tests/ReflectionClass_getProperty_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,4 @@ Fully qualified property name X::$privC does not specify a base class of C
--- (Reflecting on X::doesNotExist) ---
Fully qualified property name X::$doesNotExist does not specify a base class of C
--- (Reflecting on doesNotexist::doesNotExist) ---
Class "doesnotexist" does not exist
Class "doesNotexist" does not exist
2 changes: 1 addition & 1 deletion ext/reflection/tests/ReflectionClass_getProperty_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ Fully qualified property name X::$privC does not specify a base class of C
--- (Reflecting on X::doesNotExist) ---
Fully qualified property name X::$doesNotExist does not specify a base class of C
--- (Reflecting on doesNotexist::doesNotExist) ---
Class "doesnotexist" does not exist
Class "doesNotexist" does not exist
17 changes: 17 additions & 0 deletions ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ foreach ($classNames as $className) {
--EXPECT--
AssertionError
Directory
Io\IoException
Io\Poll\Backend
Io\Poll\BackendUnavailableException
Io\Poll\Context
Io\Poll\Event
Io\Poll\FailedContextInitializationException
Io\Poll\FailedHandleAddException
Io\Poll\FailedPollOperationException
Io\Poll\FailedPollWaitException
Io\Poll\FailedWatcherModificationException
Io\Poll\Handle
Io\Poll\HandleAlreadyWatchedException
Io\Poll\InactiveWatcherException
Io\Poll\InvalidHandleException
Io\Poll\PollException
Io\Poll\Watcher
RoundingMode
SortDirection
StreamBucket
Expand All @@ -22,5 +38,6 @@ StreamErrorCode
StreamErrorMode
StreamErrorStore
StreamException
StreamPollHandle
__PHP_Incomplete_Class
php_user_filter
1 change: 1 addition & 0 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
BASIC_MINIT_SUBMODULE(browscap)
BASIC_MINIT_SUBMODULE(standard_filters)
BASIC_MINIT_SUBMODULE(user_filters)
BASIC_MINIT_SUBMODULE(poll)
BASIC_MINIT_SUBMODULE(password)
BASIC_MINIT_SUBMODULE(image)

Expand Down
1 change: 1 addition & 0 deletions ext/standard/basic_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ PHP_MINFO_FUNCTION(basic);

ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini);

PHP_MINIT_FUNCTION(poll);
PHP_MINIT_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(browscap);
Expand Down
1 change: 1 addition & 0 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ PHP_NEW_EXTENSION([standard], m4_normalize([
image.c
incomplete_class.c
info.c
io_poll.c
iptc.c
levenshtein.c
libavifinfo/avifinfo.c
Expand Down
5 changes: 3 additions & 2 deletions ext/standard/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
crypt_sha512.c php_crypt_r.c " + (TARGET_ARCH != 'arm64'? " crc32_x86.c" : "") + " \
datetime.c dir.c dl.c dns.c dns_win32.c exec.c \
file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
info.c iptc.c link.c mail.c math.c md5.c metaphone.c microtime.c \
info.c io_poll.c iptc.c link.c mail.c math.c md5.c metaphone.c microtime.c \
net.c pack.c pageinfo.c quot_print.c soundex.c \
string.c scanf.c syslog.c type.c uniqid.c url.c var.c \
versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c password.c \
streamsfuncs.c http.c flock_compat.c hrtime.c", false /* never shared */,
streamsfuncs.c http.c flock_compat.c hrtime.c",
false /* never shared */,
'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_SOURCES("ext/standard/libavifinfo", "avifinfo.c", "standard");
PHP_STANDARD = "yes";
Expand Down
Loading
Loading