diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9365c0abb..a2948981e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - name: Run tests against php 8.1 + name: Run tests against php 8.2 steps: - name: Checkout uses: actions/checkout@v2 @@ -15,22 +15,22 @@ jobs: - name: Build Docker Container run: docker-compose -f docker-compose.yml build >/dev/null env: - PHP_VERSION: '8.1' + PHP_VERSION: '8.2' - name: Composer Install - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=8.1 test_runner composer update + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=8.2 test_runner composer update env: - PHP_VERSION: '8.1' + PHP_VERSION: '8.2' - name: Dump Reflection To File - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=8.1 php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=8.2 php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json env: - PHP_VERSION: '8.1' + PHP_VERSION: '8.2' - name: Run Tests - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=8.1 test_runner vendor/bin/phpunit --testsuite PHP_8.1 + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=8.2 test_runner vendor/bin/phpunit --testsuite PHP_8.2 env: - PHP_VERSION: '8.1' + PHP_VERSION: '8.2' additional: runs-on: ubuntu-latest name: Run cs-fixer and stubs structure tests diff --git a/Core/Core.php b/Core/Core.php index c4e6cb05e..4dd222921 100644 --- a/Core/Core.php +++ b/Core/Core.php @@ -669,9 +669,9 @@ function set_error_handler(?callable $callback, int $error_levels = E_ALL|E_STRI /** * Restores the previous error handler function * @link https://php.net/manual/en/function.restore-error-handler.php - * @return bool This function always returns true. + * @return true This function always returns true. */ -function restore_error_handler(): bool {} +function restore_error_handler(): true {} /** * Sets a user-defined exception handler function @@ -692,9 +692,9 @@ function set_exception_handler(?callable $callback) {} /** * Restores the previously defined exception handler function * @link https://php.net/manual/en/function.restore-exception-handler.php - * @return bool This function always returns true. + * @return true This function always returns true. */ -function restore_exception_handler(): bool {} +function restore_exception_handler(): true {} /** * Returns an array with the name of the defined classes diff --git a/Core/Core_c.php b/Core/Core_c.php index b72b6673d..cb2f2f500 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -1028,3 +1028,33 @@ final class ReturnTypeWillChange { public function __construct() {} } + +/** + * @since 8.2 + */ +final class AllowDynamicProperties +{ + public function __construct() {} +} + +/** + * @since 8.2 + */ +final class SensitiveParameter +{ + public function __construct() {} +} + +/** + * @since 8.2 + */ +final class SensitiveParameterValue +{ + private readonly mixed $value; + + public function __construct(mixed $value) {} + + public function getValue(): mixed {} + + public function __debugInfo(): array {} +} diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 75a6a3b5c..42b9478e2 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -13,6 +13,7 @@ final class PhpStormStubsMap 'AddressInfo' => 'sockets/sockets.php', 'Aerospike' => 'aerospike/aerospike.php', 'Aerospike\\Bytes' => 'aerospike/Bytes.php', + 'AllowDynamicProperties' => 'Core/Core_c.php', 'AppendIterator' => 'SPL/SPL.php', 'ArgumentCountError' => 'Core/Core_c.php', 'ArithmeticError' => 'Core/Core_c.php', @@ -158,6 +159,16 @@ final class PhpStormStubsMap 'PharException' => 'Phar/Phar.php', 'PharFileInfo' => 'Phar/Phar.php', 'PhpToken' => 'tokenizer/PhpToken.php', + 'Random\\BrokenRandomEngineError' => 'random/random.php', + 'Random\\CryptoSafeEngine' => 'random/random.php', + 'Random\\Engine' => 'random/random.php', + 'Random\\Engine\\Mt19937' => 'random/random.php', + 'Random\\Engine\\PcgOneseq128XslRr64' => 'random/random.php', + 'Random\\Engine\\Secure' => 'random/random.php', + 'Random\\Engine\\Xoshiro256StarStar' => 'random/random.php', + 'Random\\RandomError' => 'random/random.php', + 'Random\\RandomException' => 'random/random.php', + 'Random\\Randomizer' => 'random/random.php', 'RangeException' => 'SPL/SPL.php', 'RecursiveArrayIterator' => 'SPL/SPL.php', 'RecursiveCachingIterator' => 'SPL/SPL.php', @@ -203,6 +214,8 @@ final class PhpStormStubsMap 'SQLite3Result' => 'sqlite3/sqlite3.php', 'SQLite3Stmt' => 'sqlite3/sqlite3.php', 'SeekableIterator' => 'SPL/SPL.php', + 'SensitiveParameter' => 'Core/Core_c.php', + 'SensitiveParameterValue' => 'Core/Core_c.php', 'Serializable' => 'Core/Core_c.php', 'SessionHandler' => 'session/SessionHandler.php', 'SessionHandlerInterface' => 'session/SessionHandler.php', @@ -490,6 +503,7 @@ final class PhpStormStubsMap 'curl_share_strerror' => 'curl/curl.php', 'curl_strerror' => 'curl/curl.php', 'curl_unescape' => 'curl/curl.php', + 'curl_upkeep' => 'curl/curl.php', 'curl_version' => 'curl/curl.php', 'current' => 'standard/standard_8.php', 'date' => 'date/date.php', @@ -1225,6 +1239,7 @@ final class PhpStormStubsMap 'ini_alter' => 'standard/standard_4.php', 'ini_get' => 'standard/standard_4.php', 'ini_get_all' => 'standard/standard_4.php', + 'ini_parse_quantity' => 'standard/standard_4.php', 'ini_restore' => 'standard/standard_4.php', 'ini_set' => 'standard/standard_4.php', 'intcal_get_maximum' => 'intl/intl.php', @@ -1432,6 +1447,7 @@ final class PhpStormStubsMap 'libxml_clear_errors' => 'libxml/libxml.php', 'libxml_disable_entity_loader' => 'libxml/libxml.php', 'libxml_get_errors' => 'libxml/libxml.php', + 'libxml_get_external_entity_loader' => 'libxml/libxml.php', 'libxml_get_last_error' => 'libxml/libxml.php', 'libxml_set_external_entity_loader' => 'libxml/libxml.php', 'libxml_set_streams_context' => 'libxml/libxml.php', @@ -1581,6 +1597,7 @@ final class PhpStormStubsMap 'mdecrypt_generic' => 'mcrypt/mcrypt.php', 'memory_get_peak_usage' => 'standard/standard_4.php', 'memory_get_usage' => 'standard/standard_4.php', + 'memory_reset_peak_usage' => 'standard/standard_4.php', 'metaphone' => 'standard/standard_8.php', 'method_exists' => 'Core/Core.php', 'mhash' => 'hash/hash.php', @@ -1727,6 +1744,7 @@ final class PhpStormStubsMap 'mysqli_error_list' => 'mysqli/mysqli.php', 'mysqli_escape_string' => 'mysqli/mysqli.php', 'mysqli_execute' => 'mysqli/mysqli.php', + 'mysqli_execute_query' => 'mysqli/mysqli.php', 'mysqli_fetch' => 'mysqli/mysqli.php', 'mysqli_fetch_all' => 'mysqli/mysqli.php', 'mysqli_fetch_array' => 'mysqli/mysqli.php', @@ -2022,6 +2040,7 @@ final class PhpStormStubsMap 'opendir' => 'standard/standard_7.php', 'openlog' => 'standard/standard_7.php', 'openssl_cipher_iv_length' => 'openssl/openssl.php', + 'openssl_cipher_key_length' => 'openssl/openssl.php', 'openssl_cms_decrypt' => 'openssl/openssl.php', 'openssl_cms_encrypt' => 'openssl/openssl.php', 'openssl_cms_read' => 'openssl/openssl.php', @@ -2625,6 +2644,7 @@ final class PhpStormStubsMap 'sodium_crypto_stream_xchacha20' => 'sodium/sodium.php', 'sodium_crypto_stream_xchacha20_keygen' => 'sodium/sodium.php', 'sodium_crypto_stream_xchacha20_xor' => 'sodium/sodium.php', + 'sodium_crypto_stream_xchacha20_xor_ic' => 'sodium/sodium.php', 'sodium_crypto_stream_xor' => 'sodium/sodium.php', 'sodium_hex2bin' => 'sodium/sodium.php', 'sodium_increment' => 'sodium/sodium.php', @@ -3065,8 +3085,13 @@ final class PhpStormStubsMap 'CRYPT_SHA256' => 'standard/standard_defines.php', 'CRYPT_SHA512' => 'standard/standard_defines.php', 'CRYPT_STD_DES' => 'standard/standard_defines.php', + 'CURLALTSVC_H1' => 'curl/curl_d.php', + 'CURLALTSVC_H2' => 'curl/curl_d.php', + 'CURLALTSVC_H3' => 'curl/curl_d.php', + 'CURLALTSVC_READONLYFILE' => 'curl/curl_d.php', 'CURLAUTH_ANY' => 'curl/curl_d.php', 'CURLAUTH_ANYSAFE' => 'curl/curl_d.php', + 'CURLAUTH_AWS_SIGV4' => 'curl/curl_d.php', 'CURLAUTH_BASIC' => 'curl/curl_d.php', 'CURLAUTH_BEARER' => 'curl/curl_d.php', 'CURLAUTH_DIGEST' => 'curl/curl_d.php', @@ -3134,6 +3159,7 @@ final class PhpStormStubsMap 'CURLE_OPERATION_TIMEOUTED' => 'curl/curl_d.php', 'CURLE_OUT_OF_MEMORY' => 'curl/curl_d.php', 'CURLE_PARTIAL_FILE' => 'curl/curl_d.php', + 'CURLE_PROXY' => 'curl/curl_d.php', 'CURLE_READ_ERROR' => 'curl/curl_d.php', 'CURLE_RECV_ERROR' => 'curl/curl_d.php', 'CURLE_SEND_ERROR' => 'curl/curl_d.php', @@ -3159,6 +3185,7 @@ final class PhpStormStubsMap 'CURLFTPAUTH_DEFAULT' => 'curl/curl_d.php', 'CURLFTPAUTH_SSL' => 'curl/curl_d.php', 'CURLFTPAUTH_TLS' => 'curl/curl_d.php', + 'CURLFTPMETHOD_DEFAULT' => 'curl/curl_d.php', 'CURLFTPMETHOD_MULTICWD' => 'curl/curl_d.php', 'CURLFTPMETHOD_NOCWD' => 'curl/curl_d.php', 'CURLFTPMETHOD_SINGLECWD' => 'curl/curl_d.php', @@ -3176,6 +3203,8 @@ final class PhpStormStubsMap 'CURLGSSAPI_DELEGATION_POLICY_FLAG' => 'curl/curl_d.php', 'CURLHEADER_SEPARATE' => 'curl/curl_d.php', 'CURLHEADER_UNIFIED' => 'curl/curl_d.php', + 'CURLHSTS_ENABLE' => 'curl/curl_d.php', + 'CURLHSTS_READONLYFILE' => 'curl/curl_d.php', 'CURLINFO_APPCONNECT_TIME' => 'curl/curl_d.php', 'CURLINFO_APPCONNECT_TIME_T' => 'curl/curl_d.php', 'CURLINFO_CERTINFO' => 'curl/curl_d.php', @@ -3188,6 +3217,7 @@ final class PhpStormStubsMap 'CURLINFO_CONTENT_LENGTH_UPLOAD_T' => 'curl/curl_d.php', 'CURLINFO_CONTENT_TYPE' => 'curl/curl_d.php', 'CURLINFO_COOKIELIST' => 'curl/curl_d.php', + 'CURLINFO_EFFECTIVE_METHOD' => 'curl/curl_d.php', 'CURLINFO_EFFECTIVE_URL' => 'curl/curl_d.php', 'CURLINFO_FILETIME' => 'curl/curl_d.php', 'CURLINFO_FILETIME_T' => 'curl/curl_d.php', @@ -3212,13 +3242,16 @@ final class PhpStormStubsMap 'CURLINFO_PRIVATE' => 'curl/curl_d.php', 'CURLINFO_PROTOCOL' => 'curl/curl_d.php', 'CURLINFO_PROXYAUTH_AVAIL' => 'curl/curl_d.php', + 'CURLINFO_PROXY_ERROR' => 'curl/curl_d.php', 'CURLINFO_PROXY_SSL_VERIFYRESULT' => 'curl/curl_d.php', 'CURLINFO_REDIRECT_COUNT' => 'curl/curl_d.php', 'CURLINFO_REDIRECT_TIME' => 'curl/curl_d.php', 'CURLINFO_REDIRECT_TIME_T' => 'curl/curl_d.php', 'CURLINFO_REDIRECT_URL' => 'curl/curl_d.php', + 'CURLINFO_REFERER' => 'curl/curl_d.php', 'CURLINFO_REQUEST_SIZE' => 'curl/curl_d.php', 'CURLINFO_RESPONSE_CODE' => 'curl/curl_d.php', + 'CURLINFO_RETRY_AFTER' => 'curl/curl_d.php', 'CURLINFO_RTSP_CLIENT_CSEQ' => 'curl/curl_d.php', 'CURLINFO_RTSP_CSEQ_RECV' => 'curl/curl_d.php', 'CURLINFO_RTSP_SERVER_CSEQ' => 'curl/curl_d.php', @@ -3241,6 +3274,7 @@ final class PhpStormStubsMap 'CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE' => 'curl/curl_d.php', 'CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE' => 'curl/curl_d.php', 'CURLMOPT_MAXCONNECTS' => 'curl/curl_d.php', + 'CURLMOPT_MAX_CONCURRENT_STREAMS' => 'curl/curl_d.php', 'CURLMOPT_MAX_HOST_CONNECTIONS' => 'curl/curl_d.php', 'CURLMOPT_MAX_PIPELINE_LENGTH' => 'curl/curl_d.php', 'CURLMOPT_MAX_TOTAL_CONNECTIONS' => 'curl/curl_d.php', @@ -3258,11 +3292,15 @@ final class PhpStormStubsMap 'CURLOPT_ACCEPTTIMEOUT_MS' => 'curl/curl_d.php', 'CURLOPT_ACCEPT_ENCODING' => 'curl/curl_d.php', 'CURLOPT_ADDRESS_SCOPE' => 'curl/curl_d.php', + 'CURLOPT_ALTSVC' => 'curl/curl_d.php', + 'CURLOPT_ALTSVC_CTRL' => 'curl/curl_d.php', 'CURLOPT_APPEND' => 'curl/curl_d.php', 'CURLOPT_AUTOREFERER' => 'curl/curl_d.php', + 'CURLOPT_AWS_SIGV4' => 'curl/curl_d.php', 'CURLOPT_BINARYTRANSFER' => 'curl/curl_d.php', 'CURLOPT_BUFFERSIZE' => 'curl/curl_d.php', 'CURLOPT_CAINFO' => 'curl/curl_d.php', + 'CURLOPT_CAINFO_BLOB' => 'curl/curl_d.php', 'CURLOPT_CAPATH' => 'curl/curl_d.php', 'CURLOPT_CERTINFO' => 'curl/curl_d.php', 'CURLOPT_CLOSEPOLICY' => 'curl/curl_d.php', @@ -3288,6 +3326,9 @@ final class PhpStormStubsMap 'CURLOPT_DNS_SERVERS' => 'curl/curl_d.php', 'CURLOPT_DNS_SHUFFLE_ADDRESSES' => 'curl/curl_d.php', 'CURLOPT_DNS_USE_GLOBAL_CACHE' => 'curl/curl_d.php', + 'CURLOPT_DOH_SSL_VERIFYHOST' => 'curl/curl_d.php', + 'CURLOPT_DOH_SSL_VERIFYPEER' => 'curl/curl_d.php', + 'CURLOPT_DOH_SSL_VERIFYSTATUS' => 'curl/curl_d.php', 'CURLOPT_DOH_URL' => 'curl/curl_d.php', 'CURLOPT_EGDSOCKET' => 'curl/curl_d.php', 'CURLOPT_ENCODING' => 'curl/curl_d.php', @@ -3321,6 +3362,8 @@ final class PhpStormStubsMap 'CURLOPT_HEADER' => 'curl/curl_d.php', 'CURLOPT_HEADERFUNCTION' => 'curl/curl_d.php', 'CURLOPT_HEADEROPT' => 'curl/curl_d.php', + 'CURLOPT_HSTS' => 'curl/curl_d.php', + 'CURLOPT_HSTS_CTRL' => 'curl/curl_d.php', 'CURLOPT_HTTP09_ALLOWED' => 'curl/curl_d.php', 'CURLOPT_HTTP200ALIASES' => 'curl/curl_d.php', 'CURLOPT_HTTPAUTH' => 'curl/curl_d.php', @@ -3349,8 +3392,12 @@ final class PhpStormStubsMap 'CURLOPT_MAIL_AUTH' => 'curl/curl_d.php', 'CURLOPT_MAIL_FROM' => 'curl/curl_d.php', 'CURLOPT_MAIL_RCPT' => 'curl/curl_d.php', + 'CURLOPT_MAIL_RCPT_ALLLOWFAILS' => 'curl/curl_d.php', + 'CURLOPT_MAXAGE_CONN' => 'curl/curl_d.php', 'CURLOPT_MAXCONNECTS' => 'curl/curl_d.php', 'CURLOPT_MAXFILESIZE' => 'curl/curl_d.php', + 'CURLOPT_MAXFILESIZE_LARGE' => 'curl/curl_d.php', + 'CURLOPT_MAXLIFETIME_CONN' => 'curl/curl_d.php', 'CURLOPT_MAXREDIRS' => 'curl/curl_d.php', 'CURLOPT_MAX_RECV_SPEED_LARGE' => 'curl/curl_d.php', 'CURLOPT_MAX_SEND_SPEED_LARGE' => 'curl/curl_d.php', @@ -3387,6 +3434,7 @@ final class PhpStormStubsMap 'CURLOPT_PROXYUSERNAME' => 'curl/curl_d.php', 'CURLOPT_PROXYUSERPWD' => 'curl/curl_d.php', 'CURLOPT_PROXY_CAINFO' => 'curl/curl_d.php', + 'CURLOPT_PROXY_CAINFO_BLOB' => 'curl/curl_d.php', 'CURLOPT_PROXY_CAPATH' => 'curl/curl_d.php', 'CURLOPT_PROXY_CRLFILE' => 'curl/curl_d.php', 'CURLOPT_PROXY_ISSUERCERT' => 'curl/curl_d.php', @@ -3429,6 +3477,7 @@ final class PhpStormStubsMap 'CURLOPT_RTSP_STREAM_URI' => 'curl/curl_d.php', 'CURLOPT_RTSP_TRANSPORT' => 'curl/curl_d.php', 'CURLOPT_SAFE_UPLOAD' => 'curl/curl_d.php', + 'CURLOPT_SASL_AUTHZID' => 'curl/curl_d.php', 'CURLOPT_SASL_IR' => 'curl/curl_d.php', 'CURLOPT_SERVICE_NAME' => 'curl/curl_d.php', 'CURLOPT_SHARE' => 'curl/curl_d.php', @@ -3438,6 +3487,7 @@ final class PhpStormStubsMap 'CURLOPT_SSH_AUTH_TYPES' => 'curl/curl_d.php', 'CURLOPT_SSH_COMPRESSION' => 'curl/curl_d.php', 'CURLOPT_SSH_HOST_PUBLIC_KEY_MD5' => 'curl/curl_d.php', + 'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256' => 'curl/curl_d.php', 'CURLOPT_SSH_KNOWNHOSTS' => 'curl/curl_d.php', 'CURLOPT_SSH_PRIVATE_KEYFILE' => 'curl/curl_d.php', 'CURLOPT_SSH_PUBLIC_KEYFILE' => 'curl/curl_d.php', @@ -3453,6 +3503,7 @@ final class PhpStormStubsMap 'CURLOPT_SSLKEY_BLOB' => 'curl/curl_d.php', 'CURLOPT_SSLVERSION' => 'curl/curl_d.php', 'CURLOPT_SSL_CIPHER_LIST' => 'curl/curl_d.php', + 'CURLOPT_SSL_EC_CURVES' => 'curl/curl_d.php', 'CURLOPT_SSL_ENABLE_ALPN' => 'curl/curl_d.php', 'CURLOPT_SSL_ENABLE_NPN' => 'curl/curl_d.php', 'CURLOPT_SSL_FALSESTART' => 'curl/curl_d.php', @@ -3485,7 +3536,9 @@ final class PhpStormStubsMap 'CURLOPT_TRANSFER_ENCODING' => 'curl/curl_d.php', 'CURLOPT_UNIX_SOCKET_PATH' => 'curl/curl_d.php', 'CURLOPT_UNRESTRICTED_AUTH' => 'curl/curl_d.php', + 'CURLOPT_UPKEEP_INTERVAL_MS' => 'curl/curl_d.php', 'CURLOPT_UPLOAD' => 'curl/curl_d.php', + 'CURLOPT_UPLOAD_BUFFERSIZE' => 'curl/curl_d.php', 'CURLOPT_URL' => 'curl/curl_d.php', 'CURLOPT_USERAGENT' => 'curl/curl_d.php', 'CURLOPT_USERNAME' => 'curl/curl_d.php', @@ -3495,6 +3548,7 @@ final class PhpStormStubsMap 'CURLOPT_WILDCARDMATCH' => 'curl/curl_d.php', 'CURLOPT_WRITEFUNCTION' => 'curl/curl_d.php', 'CURLOPT_WRITEHEADER' => 'curl/curl_d.php', + 'CURLOPT_XFERINFOFUNCTION' => 'curl/curl_d.php', 'CURLOPT_XOAUTH2_BEARER' => 'curl/curl_d.php', 'CURLPAUSE_ALL' => 'curl/curl_d.php', 'CURLPAUSE_CONT' => 'curl/curl_d.php', @@ -3517,6 +3571,7 @@ final class PhpStormStubsMap 'CURLPROTO_IMAPS' => 'curl/curl_d.php', 'CURLPROTO_LDAP' => 'curl/curl_d.php', 'CURLPROTO_LDAPS' => 'curl/curl_d.php', + 'CURLPROTO_MQTT' => 'curl/curl_d.php', 'CURLPROTO_POP3' => 'curl/curl_d.php', 'CURLPROTO_POP3S' => 'curl/curl_d.php', 'CURLPROTO_RTMP' => 'curl/curl_d.php', @@ -3541,6 +3596,40 @@ final class PhpStormStubsMap 'CURLPROXY_SOCKS4A' => 'curl/curl_d.php', 'CURLPROXY_SOCKS5' => 'curl/curl_d.php', 'CURLPROXY_SOCKS5_HOSTNAME' => 'curl/curl_d.php', + 'CURLPX_BAD_ADDRESS_TYPE' => 'curl/curl_d.php', + 'CURLPX_BAD_VERSION' => 'curl/curl_d.php', + 'CURLPX_CLOSED' => 'curl/curl_d.php', + 'CURLPX_GSSAPI' => 'curl/curl_d.php', + 'CURLPX_GSSAPI_PERMSG' => 'curl/curl_d.php', + 'CURLPX_GSSAPI_PROTECTION' => 'curl/curl_d.php', + 'CURLPX_IDENTD' => 'curl/curl_d.php', + 'CURLPX_IDENTD_DIFFER' => 'curl/curl_d.php', + 'CURLPX_LONG_HOSTNAME' => 'curl/curl_d.php', + 'CURLPX_LONG_PASSWD' => 'curl/curl_d.php', + 'CURLPX_LONG_USER' => 'curl/curl_d.php', + 'CURLPX_NO_AUTH' => 'curl/curl_d.php', + 'CURLPX_OK' => 'curl/curl_d.php', + 'CURLPX_RECV_ADDRESS' => 'curl/curl_d.php', + 'CURLPX_RECV_AUTH' => 'curl/curl_d.php', + 'CURLPX_RECV_CONNECT' => 'curl/curl_d.php', + 'CURLPX_RECV_REQACK' => 'curl/curl_d.php', + 'CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED' => 'curl/curl_d.php', + 'CURLPX_REPLY_COMMAND_NOT_SUPPORTED' => 'curl/curl_d.php', + 'CURLPX_REPLY_CONNECTION_REFUSED' => 'curl/curl_d.php', + 'CURLPX_REPLY_GENERAL_SERVER_FAILURE' => 'curl/curl_d.php', + 'CURLPX_REPLY_HOST_UNREACHABLE' => 'curl/curl_d.php', + 'CURLPX_REPLY_NETWORK_UNREACHABLE' => 'curl/curl_d.php', + 'CURLPX_REPLY_NOT_ALLOWED' => 'curl/curl_d.php', + 'CURLPX_REPLY_TTL_EXPIRED' => 'curl/curl_d.php', + 'CURLPX_REPLY_UNASSIGNED' => 'curl/curl_d.php', + 'CURLPX_REQUEST_FAILED' => 'curl/curl_d.php', + 'CURLPX_RESOLVE_HOST' => 'curl/curl_d.php', + 'CURLPX_SEND_AUTH' => 'curl/curl_d.php', + 'CURLPX_SEND_CONNECT' => 'curl/curl_d.php', + 'CURLPX_SEND_REQUEST' => 'curl/curl_d.php', + 'CURLPX_UNKNOWN_FAIL' => 'curl/curl_d.php', + 'CURLPX_UNKNOWN_MODE' => 'curl/curl_d.php', + 'CURLPX_USER_REJECTED' => 'curl/curl_d.php', 'CURLSHOPT_NONE' => 'curl/curl_d.php', 'CURLSHOPT_SHARE' => 'curl/curl_d.php', 'CURLSHOPT_UNSHARE' => 'curl/curl_d.php', @@ -3554,7 +3643,11 @@ final class PhpStormStubsMap 'CURLSSH_AUTH_PASSWORD' => 'curl/curl_d.php', 'CURLSSH_AUTH_PUBLICKEY' => 'curl/curl_d.php', 'CURLSSLOPT_ALLOW_BEAST' => 'curl/curl_d.php', + 'CURLSSLOPT_AUTO_CLIENT_CERT' => 'curl/curl_d.php', + 'CURLSSLOPT_NATIVE_CA' => 'curl/curl_d.php', + 'CURLSSLOPT_NO_PARTIALCHAIN' => 'curl/curl_d.php', 'CURLSSLOPT_NO_REVOKE' => 'curl/curl_d.php', + 'CURLSSLOPT_REVOKE_BEST_EFFORT' => 'curl/curl_d.php', 'CURLUSESSL_ALL' => 'curl/curl_d.php', 'CURLUSESSL_CONTROL' => 'curl/curl_d.php', 'CURLUSESSL_NONE' => 'curl/curl_d.php', @@ -3625,9 +3718,12 @@ final class PhpStormStubsMap 'CURL_VERSION_CONV' => 'curl/curl_d.php', 'CURL_VERSION_CURLDEBUG' => 'curl/curl_d.php', 'CURL_VERSION_DEBUG' => 'curl/curl_d.php', + 'CURL_VERSION_GSASL' => 'curl/curl_d.php', 'CURL_VERSION_GSSAPI' => 'curl/curl_d.php', 'CURL_VERSION_GSSNEGOTIATE' => 'curl/curl_d.php', + 'CURL_VERSION_HSTS' => 'curl/curl_d.php', 'CURL_VERSION_HTTP2' => 'curl/curl_d.php', + 'CURL_VERSION_HTTP3' => 'curl/curl_d.php', 'CURL_VERSION_HTTPS_PROXY' => 'curl/curl_d.php', 'CURL_VERSION_IDN' => 'curl/curl_d.php', 'CURL_VERSION_IPV6' => 'curl/curl_d.php', @@ -3643,11 +3739,15 @@ final class PhpStormStubsMap 'CURL_VERSION_SSL' => 'curl/curl_d.php', 'CURL_VERSION_SSPI' => 'curl/curl_d.php', 'CURL_VERSION_TLSAUTH_SRP' => 'curl/curl_d.php', + 'CURL_VERSION_UNICODE' => 'curl/curl_d.php', 'CURL_VERSION_UNIX_SOCKETS' => 'curl/curl_d.php', + 'CURL_VERSION_ZSTD' => 'curl/curl_d.php', 'CURL_WRITEFUNC_PAUSE' => 'curl/curl_d.php', + 'CURRENCY_SYMBOL' => 'standard/standard_defines.php', 'DATE_ATOM' => 'date/date_d.php', 'DATE_COOKIE' => 'date/date_d.php', 'DATE_ISO8601' => 'date/date_d.php', + 'DATE_ISO8601_EXPANDED' => 'date/date_d.php', 'DATE_RFC1036' => 'date/date_d.php', 'DATE_RFC1123' => 'date/date_d.php', 'DATE_RFC2822' => 'date/date_d.php', @@ -3665,8 +3765,11 @@ final class PhpStormStubsMap 'DAY_5' => 'standard/standard_defines.php', 'DAY_6' => 'standard/standard_defines.php', 'DAY_7' => 'standard/standard_defines.php', + 'DBA_LMDB_NO_SUB_DIR' => 'dba/dba.php', + 'DBA_LMDB_USE_SUB_DIR' => 'dba/dba.php', 'DEBUG_BACKTRACE_IGNORE_ARGS' => 'Core/Core_d.php', 'DEBUG_BACKTRACE_PROVIDE_OBJECT' => 'Core/Core_d.php', + 'DECIMAL_POINT' => 'standard/standard_defines.php', 'DEFAULT_INCLUDE_PATH' => 'Core/Core_d.php', 'DIRECTORY_SEPARATOR' => 'standard/standard_defines.php', 'DNS_A' => 'standard/standard_defines.php', @@ -3725,6 +3828,7 @@ final class PhpStormStubsMap 'ERA_D_FMT' => 'standard/standard_defines.php', 'ERA_D_T_FMT' => 'standard/standard_defines.php', 'ERA_T_FMT' => 'standard/standard_defines.php', + 'ERA_YEAR' => 'standard/standard_defines.php', 'EXIF_USE_MBSTRING' => 'exif/exif.php', 'EXTR_IF_EXISTS' => 'standard/standard_defines.php', 'EXTR_OVERWRITE' => 'standard/standard_defines.php', @@ -3750,6 +3854,7 @@ final class PhpStormStubsMap 'E_USER_NOTICE' => 'Core/Core_d.php', 'E_USER_WARNING' => 'Core/Core_d.php', 'E_WARNING' => 'Core/Core_d.php', + 'FILEINFO_APPLE' => 'fileinfo/fileinfo.php', 'FILEINFO_CONTINUE' => 'fileinfo/fileinfo.php', 'FILEINFO_DEVICES' => 'fileinfo/fileinfo.php', 'FILEINFO_EXTENSION' => 'fileinfo/fileinfo.php', @@ -3779,6 +3884,7 @@ final class PhpStormStubsMap 'FILTER_FLAG_ENCODE_AMP' => 'filter/filter.php', 'FILTER_FLAG_ENCODE_HIGH' => 'filter/filter.php', 'FILTER_FLAG_ENCODE_LOW' => 'filter/filter.php', + 'FILTER_FLAG_GLOBAL_RANGE' => 'filter/filter.php', 'FILTER_FLAG_HOSTNAME' => 'filter/filter.php', 'FILTER_FLAG_HOST_REQUIRED' => 'filter/filter.php', 'FILTER_FLAG_IPV4' => 'filter/filter.php', @@ -3833,6 +3939,7 @@ final class PhpStormStubsMap 'FPE_FLTUND' => 'pcntl/pcntl.php', 'FPE_INTDIV' => 'pcntl/pcntl.php', 'FPE_INTOVF' => 'pcntl/pcntl.php', + 'FRAC_DIGITS' => 'standard/standard_defines.php', 'FTP_ASCII' => 'ftp/ftp.php', 'FTP_AUTORESUME' => 'ftp/ftp.php', 'FTP_AUTOSEEK' => 'ftp/ftp.php', @@ -3876,6 +3983,7 @@ final class PhpStormStubsMap 'GRAPHEME_EXTR_COUNT' => 'intl/intl.php', 'GRAPHEME_EXTR_MAXBYTES' => 'intl/intl.php', 'GRAPHEME_EXTR_MAXCHARS' => 'intl/intl.php', + 'GROUPING' => 'standard/standard_defines.php', 'HASH_HMAC' => 'hash/hash.php', 'HTML_ENTITIES' => 'standard/standard_defines.php', 'HTML_SPECIALCHARS' => 'standard/standard_defines.php', @@ -4110,6 +4218,8 @@ final class PhpStormStubsMap 'INTL_IDNA_VARIANT_2003' => 'intl/intl.php', 'INTL_IDNA_VARIANT_UTS46' => 'intl/intl.php', 'INTL_MAX_LOCALE_LEN' => 'intl/intl.php', + 'INT_CURR_SYMBOL' => 'standard/standard_defines.php', + 'INT_FRAC_DIGITS' => 'standard/standard_defines.php', 'IPPROTO_IP' => 'sockets/sockets.php', 'IPPROTO_IPV6' => 'sockets/sockets.php', 'IPV6_HOPLIMIT' => 'sockets/sockets.php', @@ -4450,6 +4560,9 @@ final class PhpStormStubsMap 'MON_7' => 'standard/standard_defines.php', 'MON_8' => 'standard/standard_defines.php', 'MON_9' => 'standard/standard_defines.php', + 'MON_DECIMAL_POINT' => 'standard/standard_defines.php', + 'MON_GROUPING' => 'standard/standard_defines.php', + 'MON_THOUSANDS_SEP' => 'standard/standard_defines.php', 'MSG_CMSG_CLOEXEC' => 'sockets/sockets.php', 'MSG_CONFIRM' => 'sockets/sockets.php', 'MSG_CTRUNC' => 'sockets/sockets.php', @@ -4470,6 +4583,7 @@ final class PhpStormStubsMap 'MSG_TRUNC' => 'sockets/sockets.php', 'MSG_WAITALL' => 'sockets/sockets.php', 'MSG_WAITFORONE' => 'sockets/sockets.php', + 'MSG_ZEROCOPY' => 'sockets/sockets.php', 'MSSQL_ASSOC' => 'mssql/mssql.php', 'MSSQL_BOTH' => 'mssql/mssql.php', 'MSSQL_NUM' => 'mssql/mssql.php', @@ -4614,9 +4728,13 @@ final class PhpStormStubsMap 'M_SQRT3' => 'standard/standard_defines.php', 'M_SQRTPI' => 'standard/standard_defines.php', 'NAN' => 'standard/standard_defines.php', + 'NEGATIVE_SIGN' => 'standard/standard_defines.php', 'NIL' => 'imap/imap.php', 'NOEXPR' => 'standard/standard_defines.php', 'NOSTR' => 'standard/standard_defines.php', + 'N_CS_PRECEDES' => 'standard/standard_defines.php', + 'N_SEP_BY_SPACE' => 'standard/standard_defines.php', + 'N_SIGN_POSN' => 'standard/standard_defines.php', 'OCI_ASSOC' => 'oci8/oci8.php', 'OCI_BOTH' => 'oci8/oci8.php', 'OCI_B_BFILE' => 'oci8/oci8.php', @@ -4928,6 +5046,7 @@ final class PhpStormStubsMap 'POLL_MSG' => 'pcntl/pcntl.php', 'POLL_OUT' => 'pcntl/pcntl.php', 'POLL_PRI' => 'pcntl/pcntl.php', + 'POSITIVE_SIGN' => 'standard/standard_defines.php', 'POSIX_F_OK' => 'posix/posix.php', 'POSIX_RLIMIT_AS' => 'posix/posix.php', 'POSIX_RLIMIT_CORE' => 'posix/posix.php', @@ -4982,6 +5101,9 @@ final class PhpStormStubsMap 'PSPELL_FAST' => 'pspell/pspell.php', 'PSPELL_NORMAL' => 'pspell/pspell.php', 'PSPELL_RUN_TOGETHER' => 'pspell/pspell.php', + 'P_CS_PRECEDES' => 'standard/standard_defines.php', + 'P_SEP_BY_SPACE' => 'standard/standard_defines.php', + 'P_SIGN_POSN' => 'standard/standard_defines.php', 'RADIXCHAR' => 'standard/standard_defines.php', 'READLINE_LIB' => 'readline/readline.php', 'SA_ALL' => 'imap/imap.php', @@ -5055,6 +5177,24 @@ final class PhpStormStubsMap 'SI_TIMER' => 'pcntl/pcntl.php', 'SI_TKILL' => 'pcntl/pcntl.php', 'SI_USER' => 'pcntl/pcntl.php', + 'SKF_AD_ALU_XOR_X' => 'sockets/sockets.php', + 'SKF_AD_CPU' => 'sockets/sockets.php', + 'SKF_AD_HATYPE' => 'sockets/sockets.php', + 'SKF_AD_IFINDEX' => 'sockets/sockets.php', + 'SKF_AD_MARK' => 'sockets/sockets.php', + 'SKF_AD_MAX' => 'sockets/sockets.php', + 'SKF_AD_NLATTR' => 'sockets/sockets.php', + 'SKF_AD_NLATTR_NEST' => 'sockets/sockets.php', + 'SKF_AD_OFF' => 'sockets/sockets.php', + 'SKF_AD_PAY_OFFSET' => 'sockets/sockets.php', + 'SKF_AD_PKTTYPE' => 'sockets/sockets.php', + 'SKF_AD_PROTOCOL' => 'sockets/sockets.php', + 'SKF_AD_QUEUE' => 'sockets/sockets.php', + 'SKF_AD_RANDOM' => 'sockets/sockets.php', + 'SKF_AD_RXHASH' => 'sockets/sockets.php', + 'SKF_AD_VLAN_TAG' => 'sockets/sockets.php', + 'SKF_AD_VLAN_TAG_PRESENT' => 'sockets/sockets.php', + 'SKF_AD_VLAN_TPID' => 'sockets/sockets.php', 'SNMP_BIT_STR' => 'snmp/snmp.php', 'SNMP_COUNTER' => 'snmp/snmp.php', 'SNMP_COUNTER64' => 'snmp/snmp.php', @@ -5334,14 +5474,17 @@ final class PhpStormStubsMap 'SORT_REGULAR' => 'standard/standard_defines.php', 'SORT_STRING' => 'standard/standard_defines.php', 'SO_BINDTODEVICE' => 'sockets/sockets.php', + 'SO_BPF_EXTENSIONS' => 'sockets/sockets.php', 'SO_BROADCAST' => 'sockets/sockets.php', 'SO_DEBUG' => 'sockets/sockets.php', 'SO_DONTROUTE' => 'sockets/sockets.php', 'SO_ERROR' => 'sockets/sockets.php', 'SO_FREE' => 'imap/imap.php', + 'SO_INCOMING_CPU' => 'sockets/sockets.php', 'SO_KEEPALIVE' => 'sockets/sockets.php', 'SO_LINGER' => 'sockets/sockets.php', 'SO_MARK' => 'sockets/sockets.php', + 'SO_MEMINFO' => 'sockets/sockets.php', 'SO_NOSERVER' => 'imap/imap.php', 'SO_OOBINLINE' => 'sockets/sockets.php', 'SO_PASSCRED' => 'sockets/sockets.php', @@ -5354,6 +5497,7 @@ final class PhpStormStubsMap 'SO_SNDLOWAT' => 'sockets/sockets.php', 'SO_SNDTIMEO' => 'sockets/sockets.php', 'SO_TYPE' => 'sockets/sockets.php', + 'SO_ZEROCOPY' => 'sockets/sockets.php', 'SQLBIT' => 'mssql/mssql.php', 'SQLCHAR' => 'mssql/mssql.php', 'SQLFLT4' => 'mssql/mssql.php', @@ -5564,8 +5708,14 @@ final class PhpStormStubsMap 'S_SESSION' => 'Core/Core_d.php', 'S_SQL' => 'Core/Core_d.php', 'S_VARS' => 'Core/Core_d.php', + 'TCP_CONGESTION' => 'sockets/sockets.php', 'TCP_DEFER_ACCEPT' => 'sockets/sockets.php', + 'TCP_KEEPCNT' => 'sockets/sockets.php', + 'TCP_KEEPIDLE' => 'sockets/sockets.php', + 'TCP_KEEPINTVL' => 'sockets/sockets.php', 'TCP_NODELAY' => 'sockets/sockets.php', + 'TCP_NOTSENT_LOWAT' => 'sockets/sockets.php', + 'THOUSANDS_SEP' => 'standard/standard_defines.php', 'THOUSEP' => 'standard/standard_defines.php', 'TIDY_NODETYPE_ASP' => 'tidy/tidy.php', 'TIDY_NODETYPE_CDATA' => 'tidy/tidy.php', diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index 520f1701e..d9673471b 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -34,6 +34,11 @@ class ReflectionClass implements Reflector */ public const IS_FINAL = 32; + /** + * @since 8.2 + */ + public const IS_READONLY = 65536; + /** * @var class-string Name of the class, same as calling the {@see ReflectionClass::getName()} method */ @@ -417,6 +422,12 @@ public function isAbstract(): bool {} #[TentativeType] public function isFinal(): bool {} + /** + * @return bool + */ + #[Pure] + public function isReadOnly(): bool {} + /** * Gets modifiers * diff --git a/Reflection/ReflectionEnum.php b/Reflection/ReflectionEnum.php index 628a95f72..35960ba52 100644 --- a/Reflection/ReflectionEnum.php +++ b/Reflection/ReflectionEnum.php @@ -32,5 +32,5 @@ public function isBacked(): bool {} /** * @return ReflectionType|null */ - public function getBackingType(): null|ReflectionType {} + public function getBackingType(): null|ReflectionNamedType {} } diff --git a/Reflection/ReflectionFunction.php b/Reflection/ReflectionFunction.php index 83bce3548..7c9a74c83 100644 --- a/Reflection/ReflectionFunction.php +++ b/Reflection/ReflectionFunction.php @@ -101,4 +101,6 @@ public function invokeArgs(array $args): mixed {} #[Pure] #[TentativeType] public function getClosure(): Closure {} + + public function isAnonymous(): bool {} } diff --git a/Reflection/ReflectionMethod.php b/Reflection/ReflectionMethod.php index bc807ec2c..4dcd2f310 100644 --- a/Reflection/ReflectionMethod.php +++ b/Reflection/ReflectionMethod.php @@ -276,4 +276,6 @@ public function getPrototype(): ReflectionMethod {} #[Pure] #[TentativeType] public function setAccessible(bool $accessible): void {} + + public function hasPrototype(): bool {} } diff --git a/SPL/SPL.php b/SPL/SPL.php index 712ee3b63..078b37fcb 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -182,11 +182,11 @@ public function key(): never {} /** * Checks if current position is valid * @link https://php.net/manual/en/iterator.valid.php - * @return bool The return value will be casted to boolean and then evaluated. + * @return false The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ #[TentativeType] - public function valid(): bool {} + public function valid(): false {} /** * Rewind the Iterator to the first element diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index fb1642fa0..781a4aa28 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -993,19 +993,19 @@ public function getMaxLineLen(): int {} /** * SplFileObject does not have children * @link https://php.net/manual/en/splfileobject.haschildren.php - * @return bool false + * @return false false * @since 5.1.2 */ #[TentativeType] - public function hasChildren(): bool {} + public function hasChildren(): false {} /** * No purpose * @link https://php.net/manual/en/splfileobject.getchildren.php - * @return null|RecursiveIterator An SplFileObject does not have children so this method returns NULL. + * @return null An SplFileObject does not have children so this method returns NULL. */ #[TentativeType] - public function getChildren(): null|RecursiveIterator {} + public function getChildren(): null {} /** * Seek to specified line @@ -1936,6 +1936,13 @@ public function valid(): bool {} #[TentativeType] public function __wakeup(): void {} + public function __serialize(): array {} + + /** + * @param array $data + */ + public function __unserialize(array $data): void {} + /** * @return Traversable */ diff --git a/SPL/SPL_f.php b/SPL/SPL_f.php index 6f65d2f88..eb92e0bbb 100644 --- a/SPL/SPL_f.php +++ b/SPL/SPL_f.php @@ -136,7 +136,7 @@ function spl_object_hash(object $object): string {} /** * Copy the iterator into an array * @link https://php.net/manual/en/function.iterator-to-array.php - * @param Traversable $iterator

+ * @param Traversable|array $iterator

* The iterator being copied. *

* @param bool $preserve_keys [optional]

@@ -144,18 +144,18 @@ function spl_object_hash(object $object): string {} *

* @return array An array containing the elements of the iterator. */ -function iterator_to_array(Traversable $iterator, bool $preserve_keys = true): array {} +function iterator_to_array(Traversable|array $iterator, bool $preserve_keys = true): array {} /** * Count the elements in an iterator * @link https://php.net/manual/en/function.iterator-count.php - * @param Traversable $iterator

+ * @param Traversable|array $iterator

* The iterator being counted. *

* @return int The number of elements in iterator. */ #[Pure] -function iterator_count(Traversable $iterator): int {} +function iterator_count(Traversable|array $iterator): int {} /** * Call a function for every element in an iterator diff --git a/ctype/ctype.php b/ctype/ctype.php index 9f3063edc..93d075369 100644 --- a/ctype/ctype.php +++ b/ctype/ctype.php @@ -5,7 +5,7 @@ /** * Check for alphanumeric character(s) * @link https://php.net/manual/en/function.ctype-alnum.php - * @param string $text

+ * @param mixed $text

* The tested string. *

* @return bool TRUE if every character in text is either diff --git a/curl/curl.php b/curl/curl.php index f19e9593c..08bb95ca8 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -2703,6 +2703,11 @@ function curl_share_errno(CurlShareHandle $share_handle): int {} #[Pure] function curl_share_strerror(int $error_code): ?string {} +/** + * @since 8.2 + */ +function curl_upkeep(CurlHandle $handle): bool {} + class CURLFile { public string $name; diff --git a/curl/curl_d.php b/curl/curl_d.php index 2ac337fa3..c652d28b1 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -4236,3 +4236,393 @@ * @since 8.1 */ define('CURLOPT_SSLKEY_BLOB', 40292); + +/** + * @since 8.2 + */ +define('CURLOPT_XFERINFOFUNCTION', 20219); + +/** + * @since 8.2 + */ +define('CURLINFO_EFFECTIVE_METHOD', 1048634); + +/** + * @since 8.2 + */ +define('CURLOPT_MAXFILESIZE_LARGE', 30117); + +/** + * @since 8.2 + */ +define('CURLFTPMETHOD_DEFAULT', 0); + +/** + * @since 8.2 + */ +define('CURLOPT_UPKEEP_INTERVAL_MS', 281); + +/** + * @since 8.2 + */ +define('CURLOPT_UPLOAD_BUFFERSIZE', 280); + +/** + * @since 8.2 + */ +define('CURLALTSVC_H1', 8); + +/** + * @since 8.2 + */ +define('CURLALTSVC_H2', 16); + +/** + * @since 8.2 + */ +define('CURLALTSVC_H3', 32); + +/** + * @since 8.2 + */ +define('CURLALTSVC_READONLYFILE', 4); + +/** + * @since 8.2 + */ +define('CURLOPT_ALTSVC', 10287); + +/** + * @since 8.2 + */ +define('CURLOPT_ALTSVC_CTRL', 286); + +/** + * @since 8.2 + */ +define('CURLOPT_MAXAGE_CONN', 288); + +/** + * @since 8.2 + */ +define('CURLOPT_SASL_AUTHZID', 10289); + +/** + * @since 8.2 + */ +define('CURL_VERSION_HTTP3', 33554432); + +/** + * @since 8.2 + */ +define('CURLINFO_RETRY_AFTER', 6291513); + +/** + * @since 8.2 + */ +define('CURLMOPT_MAX_CONCURRENT_STREAMS', 16); + +/** + * @since 8.2 + */ +define('CURLSSLOPT_NO_PARTIALCHAIN', 4); + +/** + * @since 8.2 + */ +define('CURLOPT_MAIL_RCPT_ALLLOWFAILS', 290); + +/** + * @since 8.2 + */ +define('CURLSSLOPT_REVOKE_BEST_EFFORT', 8); + +/** + * @since 8.2 + */ +define('CURLPROTO_MQTT', 268435456); + +/** + * @since 8.2 + */ +define('CURLSSLOPT_NATIVE_CA', 16); + +/** + * @since 8.2 + */ +define('CURL_VERSION_UNICODE', 134217728); + +/** + * @since 8.2 + */ +define('CURL_VERSION_ZSTD', 67108864); + +/** + * @since 8.2 + */ +define('CURLE_PROXY', 97); + +/** + * @since 8.2 + */ +define('CURLINFO_PROXY_ERROR', 2097211); + +/** + * @since 8.2 + */ +define('CURLOPT_SSL_EC_CURVES', 10298); + +/** + * @since 8.2 + */ +define('CURLPX_BAD_ADDRESS_TYPE', 1); + +/** + * @since 8.2 + */ +define('CURLPX_BAD_VERSION', 2); + +/** + * @since 8.2 + */ +define('CURLPX_CLOSED', 3); + +/** + * @since 8.2 + */ +define('CURLPX_GSSAPI', 4); + +/** + * @since 8.2 + */ +define('CURLPX_GSSAPI_PERMSG', 5); + +/** + * @since 8.2 + */ +define('CURLPX_GSSAPI_PROTECTION', 6); + +/** + * @since 8.2 + */ +define('CURLPX_IDENTD', 7); + +/** + * @since 8.2 + */ +define('CURLPX_IDENTD_DIFFER', 8); + +/** + * @since 8.2 + */ +define('CURLPX_LONG_HOSTNAME', 9); + +/** + * @since 8.2 + */ +define('CURLPX_LONG_PASSWD', 10); + +/** + * @since 8.2 + */ +define('CURLPX_LONG_USER', 11); + +/** + * @since 8.2 + */ +define('CURLPX_NO_AUTH', 12); + +/** + * @since 8.2 + */ +define('CURLPX_OK', 0); + +/** + * @since 8.2 + */ +define('CURLPX_RECV_ADDRESS', 13); + +/** + * @since 8.2 + */ +define('CURLPX_RECV_AUTH', 14); + +/** + * @since 8.2 + */ +define('CURLPX_RECV_CONNECT', 15); + +/** + * @since 8.2 + */ +define('CURLPX_RECV_REQACK', 16); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED', 17); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_COMMAND_NOT_SUPPORTED', 18); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_CONNECTION_REFUSED', 19); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_GENERAL_SERVER_FAILURE', 20); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_HOST_UNREACHABLE', 21); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_NETWORK_UNREACHABLE', 22); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_NOT_ALLOWED', 23); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_TTL_EXPIRED', 24); + +/** + * @since 8.2 + */ +define('CURLPX_REPLY_UNASSIGNED', 25); + +/** + * @since 8.2 + */ +define('CURLPX_REQUEST_FAILED', 26); + +/** + * @since 8.2 + */ +define('CURLPX_RESOLVE_HOST', 27); + +/** + * @since 8.2 + */ +define('CURLPX_SEND_CONNECT', 29); + +/** + * @since 8.2 + */ +define('CURLPX_SEND_AUTH', 28); + +/** + * @since 8.2 + */ +define('CURLPX_SEND_REQUEST', 30); + +/** + * @since 8.2 + */ +define('CURLPX_UNKNOWN_FAIL', 31); + +/** + * @since 8.2 + */ +define('CURLPX_UNKNOWN_MODE', 32); + +/** + * @since 8.2 + */ +define('CURLPX_USER_REJECTED', 33); + +/** + * @since 8.2 + */ +define('CURLHSTS_ENABLE', 1); + +/** + * @since 8.2 + */ +define('CURLHSTS_READONLYFILE', 2); + +/** + * @since 8.2 + */ +define('CURLOPT_HSTS', 10300); + +/** + * @since 8.2 + */ +define('CURLOPT_HSTS_CTRL', 299); + +/** + * @since 8.2 + */ +define('CURL_VERSION_HSTS', 268435456); + +/** + * @since 8.2 + */ +define('CURLAUTH_AWS_SIGV4', 128); + +/** + * @since 8.2 + */ +define('CURLOPT_AWS_SIGV4', 10305); + +/** + * @since 8.2 + */ +define('CURLINFO_REFERER', 1048636); + +/** + * @since 8.2 + */ +define('CURLOPT_DOH_SSL_VERIFYHOST', 307); + +/** + * @since 8.2 + */ +define('CURLOPT_DOH_SSL_VERIFYPEER', 306); + +/** + * @since 8.2 + */ +define('CURLOPT_DOH_SSL_VERIFYSTATUS', 308); + +/** + * @since 8.2 + */ +define('CURL_VERSION_GSASL', 536870912); + +/** + * @since 8.2 + */ +define('CURLOPT_CAINFO_BLOB', 40309); + +/** + * @since 8.2 + */ +define('CURLOPT_PROXY_CAINFO_BLOB', 40310); + +/** + * @since 8.2 + */ +define('CURLSSLOPT_AUTO_CLIENT_CERT', 32); + +/** + * @since 8.2 + */ +define('CURLOPT_MAXLIFETIME_CONN', 314); + +/** + * @since 8.2 + */ +define('CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256', 10311); diff --git a/date/date_c.php b/date/date_c.php index 0612fb008..de82edc28 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -28,6 +28,11 @@ interface DateTimeInterface */ public const ISO8601 = 'Y-m-d\TH:i:sO'; + /** + * @since 8.2 + */ + public const ISO8601_EXPANDED = 'DATE_ISO8601_EXPANDED'; + /** * @since 7.2 */ @@ -148,6 +153,10 @@ public function getTimezone(): DateTimeZone|false; */ #[TentativeType] public function __wakeup(): void; + + public function __serialize(): array; + + public function __unserialize(array $data): void; } /** @@ -196,7 +205,7 @@ public static function createFromFormat(string $format, string $datetime, DateTi * @since 5.6 */ #[TentativeType] - public static function createFromMutable(DateTime $object): DateTimeImmutable {} + public static function createFromMutable(DateTime $object): static {} /** * (PHP 5 >=5.5.0)
@@ -405,6 +414,10 @@ public function getTimezone(): DateTimeZone|false {} */ #[TentativeType] public function __wakeup(): void {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} } /** @@ -515,7 +528,7 @@ public function __construct(string $datetime = 'now', DateTimeZone|null $timezon * @since 7.3 */ #[TentativeType] - public static function createFromImmutable(DateTimeImmutable $object): DateTime {} + public static function createFromImmutable(DateTimeImmutable $object): static {} /** * Parse a string into a new DateTime object according to the specified format @@ -681,6 +694,10 @@ public function getTimestamp(): int {} */ #[TentativeType] public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} } /** @@ -771,6 +788,10 @@ public function getTransitions(int $timestampBegin = null, int $timestampEnd = n */ #[TentativeType] public function __wakeup(): void {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} } /** @@ -866,6 +887,10 @@ public function format(string $format): string {} #[TentativeType] public function __wakeup(): void {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} } /** @@ -879,46 +904,51 @@ class DatePeriod implements IteratorAggregate { public const EXCLUDE_START_DATE = 1; + /** + * @since 8.2 + */ + public const INCLUDE_END_DATE = 2; + /** * Start date - * @var DateTimeInterface + * @var DateTimeInterface|null */ #[Immutable] - public $start; + public DateTimeInterface|null $start; /** * Current iterator value. * @var DateTimeInterface|null */ - public $current; + public DateTimeInterface|null $current; /** * End date. * @var DateTimeInterface|null */ #[Immutable] - public $end; + public DateTimeInterface|null $end; /** * The interval - * @var DateInterval + * @var DateInterval|null */ #[Immutable] - public $interval; + public DateInterval|null $interval; /** * Number of recurrences. * @var int */ #[Immutable] - public $recurrences; + public int $recurrences; /** * Start of period. * @var bool */ #[Immutable] - public $include_start_date; + public bool $include_start_date; /** * @since 8.2 @@ -1000,4 +1030,8 @@ public function getRecurrences(): ?int {} * @since 8.0 */ public function getIterator(): Iterator {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} } diff --git a/date/date_d.php b/date/date_d.php index ace1d7eaf..fce1a37e5 100644 --- a/date/date_d.php +++ b/date/date_d.php @@ -11,6 +11,9 @@ */ define('DATE_ISO8601', "Y-m-d\TH:i:sO"); +/** @since 8.2 */ +define('DATE_ISO8601_EXPANDED', "X-m-d\TH:i:sP"); + define('DATE_RFC822', "D, d M y H:i:s O"); define('DATE_RFC850', "l, d-M-y H:i:s T"); diff --git a/dba/dba.php b/dba/dba.php index 27837c3f1..92bbdc12f 100644 --- a/dba/dba.php +++ b/dba/dba.php @@ -1,146 +1,14 @@ - * Commonly a regular path in your filesystem. - *

- * @param string $mode

- * It is r for read access, w for - * read/write access to an already existing database, c - * for read/write access and database creation if it doesn't currently exist, - * and n for create, truncate and read/write access. - * The database is created in BTree mode, other modes (like Hash or Queue) - * are not supported. - *

- *

- * Additionally you can set the database lock method with the next char. - * Use l to lock the database with a .lck - * file or d to lock the databasefile itself. It is - * important that all of your applications do this consistently. - *

- *

- * If you want to test the access and do not want to wait for the lock - * you can add t as third character. When you are - * absolutely sure that you do not require database locking you can do - * so by using - instead of l or - * d. When none of d, - * l or - is used, dba will lock - * on the database file as it would with d. - *

- *

- * There can only be one writer for one database file. When you use dba on - * a web server and more than one request requires write operations they can - * only be done one after another. Also read during write is not allowed. - * The dba extension uses locks to prevent this. See the following table: - * - * DBA locking - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
already openmode = "rl"mode = "rlt"mode = "wl"mode = "wlt"mode = "rd"mode = "rdt"mode = "wd"mode = "wdt"
not openokokokokokokokok
mode = "rl"okokwaitfalseillegalillegalillegalillegal
mode = "wl"waitfalsewaitfalseillegalillegalillegalillegal
mode = "rd"illegalillegalillegalillegalokokwaitfalse
mode = "wd"illegalillegalillegalillegalwaitfalsewaitfalse
- * ok: the second call will be successful. - * wait: the second call waits until dba_close is called for the first. - * false: the second call returns false. - * illegal: you must not mix "l" and "d" modifiers for mode parameter. - *

- * @param string $handler [optional]

- * The name of the handler which - * shall be used for accessing path. It is passed - * all optional parameters given to dba_open and - * can act on behalf of them. - *

- * @param mixed ...$handler_params [optional] - * @return resource|false a positive handle on success or FALSE on failure. - */ -function dba_open($path, $mode, $handler, ...$handler_params) {} +/** @since 8.2 */ +define('DBA_LMDB_USE_SUB_DIR', 0); -/** - * Open database persistently - * @link https://php.net/manual/en/function.dba-popen.php - * @param string $path

- * Commonly a regular path in your filesystem. - *

- * @param string $mode

- * It is r for read access, w for - * read/write access to an already existing database, c - * for read/write access and database creation if it doesn't currently exist, - * and n for create, truncate and read/write access. - *

- * @param string $handler [optional]

- * The name of the handler which - * shall be used for accessing path. It is passed - * all optional parameters given to dba_popen and - * can act on behalf of them. - *

- * @param mixed ...$handler_params [optional] - * @return resource|false a positive handle on success or FALSE on failure. - */ -function dba_popen($path, $mode, $handler, ...$handler_params) {} +/** @since 8.2 */ +define('DBA_LMDB_NO_SUB_DIR', 0); + +function dba_open(string $path, string $mode, ?string $handler = null, int $permission = 420, int $map_size = 0, ?int $flags = null) {} + +function dba_popen(string $path, string $mode, ?string $handler = null, int $permission = 420, int $map_size = 0, ?int $flags = null) {} /** * Close a DBA database @@ -165,7 +33,7 @@ function dba_close($dba): void {} *

* @return bool TRUE on success or FALSE on failure. */ -function dba_delete($key, $dba): bool {} +function dba_delete(array|string $key, $dba): bool {} /** * Check whether key exists @@ -179,7 +47,7 @@ function dba_delete($key, $dba): bool {} *

* @return bool TRUE if the key exists, FALSE otherwise. */ -function dba_exists($key, $dba): bool {} +function dba_exists(array|string $key, $dba): bool {} /** * Fetch data specified by key @@ -239,7 +107,7 @@ function dba_fetch($key, $skip, $dba): string|false {} *

* @return bool TRUE on success or FALSE on failure. */ -function dba_insert($key, string $value, $dba): bool {} +function dba_insert(array|string $key, string $value, $dba): bool {} /** * Replace or insert entry @@ -256,7 +124,7 @@ function dba_insert($key, string $value, $dba): bool {} *

* @return bool TRUE on success or FALSE on failure. */ -function dba_replace($key, string $value, $dba): bool {} +function dba_replace(array|string $key, string $value, $dba): bool {} /** * Fetch first key diff --git a/fileinfo/fileinfo.php b/fileinfo/fileinfo.php index 39b94edf4..94b548351 100644 --- a/fileinfo/fileinfo.php +++ b/fileinfo/fileinfo.php @@ -67,6 +67,11 @@ */ define('FILEINFO_EXTENSION', 2097152); +/** + * @since 8.2 + */ +define('FILEINFO_APPLE', 2048); + /** * (PHP >= 5.3.0, PECL fileinfo >= 0.1.0)
* Create a new fileinfo resource diff --git a/filter/filter.php b/filter/filter.php index e6ec8e377..4d96423fb 100644 --- a/filter/filter.php +++ b/filter/filter.php @@ -347,6 +347,12 @@ define('FILTER_FLAG_EMAIL_UNICODE', 1048576); +/** + * filters Global IPs per RFC 6890 + * @since 8.2 + */ +define('FILTER_FLAG_GLOBAL_RANGE', 268435456); + /** * Gets a specific external variable by name and optionally filters it * @link https://php.net/manual/en/function.filter-input.php diff --git a/gd/gd.php b/gd/gd.php index f48c965fd..b3a8bfa19 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -899,9 +899,9 @@ function imagecolorexact(GdImage $image, int $red, int $green, int $blue): int { * @param int $alpha [optional]

* Value of alpha component. *

- * @return bool|null + * @return false|null */ -function imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0): null|bool {} +function imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0): ?false {} /** * Define a color as transparent diff --git a/libxml/libxml.php b/libxml/libxml.php index ec3ad4dcb..079db47a6 100644 --- a/libxml/libxml.php +++ b/libxml/libxml.php @@ -270,6 +270,17 @@ function libxml_disable_entity_loader(bool $disable = true): bool {} */ function libxml_set_external_entity_loader(?callable $resolver_function): bool {} +/** + * Returns the currently installed external entity loader, i.e. the value which was passed to + * libxml_set_external_entity_loader() or null if no loader was installed and the default entity loader will be used. + * This allows libraries to save and restore the loader, controlling entity expansion without interfering with the rest + * of the application. + * + * @return callable|null + * @since 8.2 + */ +function libxml_get_external_entity_loader(): ?callable {} + /** * Contains various information about errors thrown by libxml. The error codes * are described within the official diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index 1d2639f64..edf960ac1 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -213,12 +213,12 @@ function mb_http_output(?string $encoding): string|bool {} *

* Useless detect order example *

- * @return bool|string[] When setting the encoding detection order, + * @return true|string[] When setting the encoding detection order, * true is returned on success or FALSE on failure. * When getting the encoding detection order, an ordered array * of the encodings is returned. */ -function mb_detect_order(array|string|null $encoding = null): array|bool {} +function mb_detect_order(array|string|null $encoding = null): array|true {} /** * Set/Get substitution character diff --git a/mysqli/mysqli.php b/mysqli/mysqli.php index 67db5ea11..3676f39a6 100644 --- a/mysqli/mysqli.php +++ b/mysqli/mysqli.php @@ -749,9 +749,9 @@ function mysqli_character_set_name(mysqli $mysql): string {} * Closes a previously opened database connection * @link https://php.net/manual/en/mysqli.close.php * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() - * @return bool + * @return true */ -function mysqli_close(mysqli $mysql): bool {} +function mysqli_close(mysqli $mysql): true {} /** * Commits the current transaction @@ -813,9 +813,9 @@ function mysqli_dump_debug_info(mysqli $mysql): bool {} * Performs debugging operations using the Fred Fish debugging library. * @link https://php.net/manual/en/mysqli.debug.php * @param string $options - * @return bool + * @return true */ -function mysqli_debug(string $options): bool {} +function mysqli_debug(string $options): true {} /** * Returns the error code for the most recent function call @@ -874,6 +874,15 @@ function mysqli_stmt_execute(mysqli_stmt $statement, ?array $params = null): boo #[Deprecated(since: "5.3")] function mysqli_execute(mysqli_stmt $statement, ?array $params = null): bool {} +/** + * @param mysqli $mysql + * @param string $query + * @param array|null $params + * @return mysqli_result|bool + * @since 8.2 + */ +function mysqli_execute_query(mysqli $mysql, string $query, ?array $params = null): mysqli_result|bool {} + /** * Returns the next field in the result set * @link https://secure.php.net/manual/en/mysqli-result.fetch-field.php @@ -1630,17 +1639,17 @@ function mysqli_stat(mysqli $mysql): string|false {} * @param string|null $ca_certificate The path name to the certificate authority file * @param string|null $ca_path The pathname to a directory that contains trusted SSL CA certificates in PEM format * @param string|null $cipher_algos A list of allowable ciphers to use for SSL encryption - * @return bool This function always returns TRUE value. + * @return true This function always returns TRUE value. */ -function mysqli_ssl_set(mysqli $mysql, string|null $key, string|null $certificate, string|null $ca_certificate, string|null $ca_path, string|null $cipher_algos): bool {} +function mysqli_ssl_set(mysqli $mysql, string|null $key, string|null $certificate, string|null $ca_certificate, string|null $ca_path, string|null $cipher_algos): true {} /** * Closes a prepared statement * @link https://php.net/manual/en/mysqli-stmt.close.php * @param mysqli_stmt $statement - * @return bool + * @return true */ -function mysqli_stmt_close(mysqli_stmt $statement): bool {} +function mysqli_stmt_close(mysqli_stmt $statement): true {} /** * Seeks to an arbitrary row in statement result set @@ -2168,6 +2177,16 @@ public function debug(string $options) {} #[TentativeType] public function get_charset(): ?object {} + /** + * @param mysqli $mysql + * @param string $query + * @param array|null $params + * @return mysqli_result|bool + * @see mysqli_execute_query + * @since 8.2 + */ + public function execute_query(string $query, ?array $params = null): mysqli_result|bool {} + /** * Returns the MySQL client version as a string * @link https://php.net/manual/en/mysqli.get-client-info.php diff --git a/openssl/openssl.php b/openssl/openssl.php index 14bc6d951..9366bb688 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -905,6 +905,15 @@ function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, */ function openssl_cipher_iv_length(string $cipher_algo): int|false {} +/** + * This function works in exactly the same way as openssl_cipher_iv_length but for a key length. This is especially + * useful to make sure that the right key length is provided to openssl_encrypt and openssl_decrypt. + * @param string $cipher_algo + * @return int|false + * @since 8.2 + */ +function openssl_cipher_key_length(string $cipher_algo): int|false {} + /** * Generate signature * @link https://php.net/manual/en/function.openssl-sign.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f55cf2cfd..0b29376f5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,11 @@ - + tests/BaseClassesTest.php tests/BaseConstantsTest.php tests/BaseFunctionsTest.php + tests/StubsConstantsAndParametersValuesTest.php tests/StubsParameterNamesTest.php tests/StubsTypeHintsTest.php tests/StubsForbiddenTypeHintsTest.php diff --git a/random/random.php b/random/random.php index 12bdb4686..5527eb256 100644 --- a/random/random.php +++ b/random/random.php @@ -1,100 +1,229 @@ - * An optional seed value - *

- * @param int $mode [optional]

- * Use one of the following constants to specify the implementation of the algorithm to use. - *

- * @return void - */ -function mt_srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {} - -/** - * Seed the random number generator - *

Note: As of PHP 7.1.0, {@see srand()} has been made - * an alias of {@see mt_srand()}. - *

- * @link https://php.net/manual/en/function.srand.php - * @param int $seed

- * Optional seed value - *

- * @param int $mode [optional]

- * Use one of the following constants to specify the implementation of the algorithm to use. - *

- * @return void - */ -function srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {} - -/** - * Generate a random integer - * @link https://php.net/manual/en/function.rand.php - * @param int $min - * @param int $max [optional] - * @return int A pseudo random value between min - * (or 0) and max (or getrandmax, inclusive). - */ -function rand(int $min = null, int $max): int {} - -/** - * Generate a random value via the Mersenne Twister Random Number Generator - * @link https://php.net/manual/en/function.mt-rand.php - * @param int $min

- * Optional lowest value to be returned (default: 0) - *

- * @param int $max [optional]

- * Optional highest value to be returned (default: mt_getrandmax()) - *

- * @return int A random integer value between min (or 0) - * and max (or mt_getrandmax, inclusive) - */ -function mt_rand(int $min = null, int $max): int {} - -/** - * Show largest possible random value - * @link https://php.net/manual/en/function.mt-getrandmax.php - * @return int the maximum random value returned by mt_rand - */ -#[Pure] -function mt_getrandmax(): int {} - -/** - * Show largest possible random value - * @link https://php.net/manual/en/function.getrandmax.php - * @return int The largest possible random value returned by rand - */ -#[Pure] -function getrandmax(): int {} - -/** - * Generates cryptographically secure pseudo-random bytes - * @link https://php.net/manual/en/function.random-bytes.php - * @param int $length The length of the random string that should be returned in bytes. - * @return string Returns a string containing the requested number of cryptographically secure random bytes. - * @since 7.0 - * @throws Exception if an appropriate source of randomness cannot be found. - */ -function random_bytes(int $length): string {} - -/** - * Generates cryptographically secure pseudo-random integers - * @link https://php.net/manual/en/function.random-int.php - * @param int $min The lowest value to be returned, which must be PHP_INT_MIN or higher. - * @param int $max The highest value to be returned, which must be less than or equal to PHP_INT_MAX. - * @return int Returns a cryptographically secure random integer in the range min to max, inclusive. - * @since 7.0 - * @throws Exception if an appropriate source of randomness cannot be found. - */ -function random_int(int $min, int $max): int {} +namespace { + use JetBrains\PhpStorm\Pure; + + /** + * Combined linear congruential generator + * @link https://php.net/manual/en/function.lcg-value.php + * @return float A pseudo random float value in the range of (0, 1) + * @return float A pseudo random float value in the range of (0, 1) + */ + function lcg_value(): float {} + + /** + * Seeds the Mersenne Twister Random Number Generator + * @link https://php.net/manual/en/function.mt-srand.php + * @param int $seed

+ * An optional seed value + *

+ * @param int $mode [optional]

+ * Use one of the following constants to specify the implementation of the algorithm to use. + *

+ * @return void + */ + function mt_srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {} + + /** + * Seed the random number generator + *

Note: As of PHP 7.1.0, {@see srand()} has been made + * an alias of {@see mt_srand()}. + *

+ * @link https://php.net/manual/en/function.srand.php + * @param int $seed

+ * Optional seed value + *

+ * @param int $mode [optional]

+ * Use one of the following constants to specify the implementation of the algorithm to use. + *

+ * @return void + */ + function srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {} + + /** + * Generate a random integer + * @link https://php.net/manual/en/function.rand.php + * @param int $min + * @param int $max [optional] + * @return int A pseudo random value between min + * (or 0) and max (or getrandmax, inclusive). + */ + function rand(int $min = null, int $max): int {} + + /** + * Generate a random value via the Mersenne Twister Random Number Generator + * @link https://php.net/manual/en/function.mt-rand.php + * @param int $min

+ * Optional lowest value to be returned (default: 0) + *

+ * @param int $max [optional]

+ * Optional highest value to be returned (default: mt_getrandmax()) + *

+ * @return int A random integer value between min (or 0) + * and max (or mt_getrandmax, inclusive) + */ + function mt_rand(int $min = null, int $max): int {} + + /** + * Show largest possible random value + * @link https://php.net/manual/en/function.mt-getrandmax.php + * @return int the maximum random value returned by mt_rand + */ + #[Pure] + function mt_getrandmax(): int {} + + /** + * Show largest possible random value + * @link https://php.net/manual/en/function.getrandmax.php + * @return int The largest possible random value returned by rand + */ + #[Pure] + function getrandmax(): int {} + + /** + * Generates cryptographically secure pseudo-random bytes + * @link https://php.net/manual/en/function.random-bytes.php + * @param int $length The length of the random string that should be returned in bytes. + * @return string Returns a string containing the requested number of cryptographically secure random bytes. + * @since 7.0 + * @throws Exception if an appropriate source of randomness cannot be found. + */ + function random_bytes(int $length): string {} + + /** + * Generates cryptographically secure pseudo-random integers + * @link https://php.net/manual/en/function.random-int.php + * @param int $min The lowest value to be returned, which must be PHP_INT_MIN or higher. + * @param int $max The highest value to be returned, which must be less than or equal to PHP_INT_MAX. + * @return int Returns a cryptographically secure random integer in the range min to max, inclusive. + * @since 7.0 + * @throws Exception if an appropriate source of randomness cannot be found. + */ + function random_int(int $min, int $max): int {} +} + +namespace Random\Engine { + use Random\CryptoSafeEngine; + use Random\Engine; + + /** + * @since 8.2 + */ + final class Mt19937 implements Engine + { + public function __construct(int|null $seed = null, int $mode = MT_RAND_MT19937) {} + + public function generate(): string {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} + + public function __debugInfo(): array {} + } + + /** + * @since 8.2 + */ + final class PcgOneseq128XslRr64 implements Engine + { + public function __construct(string|int|null $seed = null) {} + + public function generate(): string {} + + public function jump(int $advance): void {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} + + public function __debugInfo(): array {} + } + + /** + * @since 8.2 + */ + final class Xoshiro256StarStar implements Engine + { + public function __construct(string|int|null $seed = null) {} + + public function generate(): string {} + + public function jump(): void {} + + public function jumpLong(): void {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} + + public function __debugInfo(): array {} + } + + /** + * @since 8.2 + */ + final class Secure implements CryptoSafeEngine + { + public function generate(): string {} + } +} + +namespace Random { + use Error; + use Exception; + + /** + * @since 8.2 + */ + interface Engine + { + public function generate(): string; + } + + /** + * @since 8.2 + */ + interface CryptoSafeEngine extends Engine {} + + /** + * @since 8.2 + */ + final class Randomizer + { + public readonly Engine $engine; + + public function __construct(?Engine $engine = null) {} + + public function nextInt(): int {} + + public function getInt(int $min, int $max): int {} + + public function getBytes(int $length): string {} + + public function shuffleArray(array $array): array {} + + public function shuffleBytes(string $bytes): string {} + + public function pickArrayKeys(array $array, int $num): array {} + + public function __serialize(): array {} + + public function __unserialize(array $data): void {} + } + + /** + * @since 8.2 + */ + class RandomError extends Error {} + + /** + * @since 8.2 + */ + class BrokenRandomEngineError extends RandomError {} + + /** + * @since 8.2 + */ + class RandomException extends Exception {} +} diff --git a/sockets/sockets.php b/sockets/sockets.php index f6da00787..8b67511ec 100644 --- a/sockets/sockets.php +++ b/sockets/sockets.php @@ -884,6 +884,150 @@ */ define('TCP_DEFER_ACCEPT', 9); +/** + * @since 8.2 + */ +define('SO_INCOMING_CPU', 49); + +/** + * @since 8.2 + */ +define('SO_MEMINFO', 55); + +/** + * @since 8.2 + */ +define('SO_BPF_EXTENSIONS', 48); + +/** + * @since 8.2 + */ +define('SKF_AD_OFF', -4096); + +/** + * @since 8.2 + */ +define('SKF_AD_PROTOCOL', 0); + +/** + * @since 8.2 + */ +define('SKF_AD_PKTTYPE', 4); + +/** + * @since 8.2 + */ +define('SKF_AD_IFINDEX', 8); + +/** + * @since 8.2 + */ +define('SKF_AD_NLATTR', 12); + +/** + * @since 8.2 + */ +define('SKF_AD_NLATTR_NEST', 16); + +/** + * @since 8.2 + */ +define('SKF_AD_MARK', 20); + +/** + * @since 8.2 + */ +define('SKF_AD_QUEUE', 24); + +/** + * @since 8.2 + */ +define('SKF_AD_HATYPE', 28); + +/** + * @since 8.2 + */ +define('SKF_AD_RXHASH', 32); + +/** + * @since 8.2 + */ +define('SKF_AD_CPU', 36); + +/** + * @since 8.2 + */ +define('SKF_AD_ALU_XOR_X', 40); + +/** + * @since 8.2 + */ +define('SKF_AD_VLAN_TAG', 44); + +/** + * @since 8.2 + */ +define('SKF_AD_VLAN_TAG_PRESENT', 48); + +/** + * @since 8.2 + */ +define('SKF_AD_PAY_OFFSET', 52); + +/** + * @since 8.2 + */ +define('SKF_AD_RANDOM', 56); + +/** + * @since 8.2 + */ +define('SKF_AD_VLAN_TPID', 60); + +/** + * @since 8.2 + */ +define('SKF_AD_MAX', 64); + +/** + * @since 8.2 + */ +define('TCP_CONGESTION', 13); + +/** + * @since 8.2 + */ +define('TCP_NOTSENT_LOWAT', 25); + +/** + * @since 8.2 + */ +define('TCP_KEEPIDLE', 4); + +/** + * @since 8.2 + */ +define('TCP_KEEPINTVL', 5); + +/** + * @since 8.2 + */ +define('TCP_KEEPCNT', 6); + +/** + * Socket_set_option for the socket_send* functions. + * It avoids copy b/w userland and kernel for both TCP and UDP protocols. + * @since 8.2 + */ +define('SO_ZEROCOPY', 60); + +/** + * Socket_set_option for the socket_send* functions. + * It avoids copy b/w userland and kernel for both TCP and UDP protocols. + * @since 8.2 + */ +define('MSG_ZEROCOPY', 67108864); + /** * (PHP 7 >= 7.2.0)
* Get array with contents of getaddrinfo about the given hostname. diff --git a/sodium/sodium.php b/sodium/sodium.php index 1f1a5ed72..2766a0bb2 100644 --- a/sodium/sodium.php +++ b/sodium/sodium.php @@ -172,7 +172,7 @@ define('SODIUM_CRYPTO_PWHASH_SALTBYTES', 16); -define('SODIUM_CRYPTO_PWHASH_STRPREFIX', "$argon2id$"); +define('SODIUM_CRYPTO_PWHASH_STRPREFIX', '$argon2id$'); define('SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES', 24); @@ -224,6 +224,8 @@ function sodium_crypto_stream_xchacha20(int $length, string $nonce, string $key) function sodium_crypto_stream_xchacha20_xor(string $message, string $nonce, string $key): string {} +function sodium_crypto_stream_xchacha20_xor_ic(string $message, string $nonce, int $counter, string $key): string {} + function sodium_crypto_stream_xchacha20_keygen(): string {} /** @@ -629,11 +631,11 @@ function sodium_crypto_generichash_init(string $key = '', int $length = 32): str * @link https://www.php.net/manual/en/function.sodium-crypto-generichash-update.php * @param string &$state * @param string $message - * @return bool + * @return true * @throws SodiumException * @since 7.2 */ -function sodium_crypto_generichash_update(string &$state, string $message): bool {} +function sodium_crypto_generichash_update(string &$state, string $message): true {} /** * Get the final hash diff --git a/standard/standard_0.php b/standard/standard_0.php index 8ba2a7e79..7a6968606 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -954,9 +954,9 @@ function image_type_to_extension(int $image_type, bool $include_dot = true): str * * *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function phpinfo(#[ExpectedValues([INFO_GENERAL, INFO_CREDITS, INFO_CONFIGURATION, INFO_MODULES, INFO_ENVIRONMENT, INFO_VARIABLES, INFO_LICENSE, INFO_ALL])] int $flags = INFO_ALL): bool {} +function phpinfo(#[ExpectedValues([INFO_GENERAL, INFO_CREDITS, INFO_CONFIGURATION, INFO_MODULES, INFO_ENVIRONMENT, INFO_VARIABLES, INFO_LICENSE, INFO_ALL])] int $flags = INFO_ALL): true {} /** * Gets the current PHP version @@ -1033,9 +1033,9 @@ function phpversion(?string $extension): string|false {} * * *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function phpcredits(int $flags = CREDITS_ALL): bool {} +function phpcredits(int $flags = CREDITS_ALL): true {} /** * Gets the logo guid diff --git a/standard/standard_1.php b/standard/standard_1.php index 612753824..b7699d0da 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -635,7 +635,7 @@ function lcfirst(string $string): string {} * @return string the modified string. */ #[Pure] -function ucwords(string $string, string $separators = " \t\r\n\f\u000b"): string {} +function ucwords(string $string, string $separators = " \t\r\n\f\v"): string {} /** * Translate characters or replace substrings diff --git a/standard/standard_2.php b/standard/standard_2.php index 4b2e9743e..acd6bfda7 100644 --- a/standard/standard_2.php +++ b/standard/standard_2.php @@ -713,9 +713,9 @@ function escapeshellarg(string $arg): string {} * If the return_var argument is present, the * return status of the Unix command will be placed here. *

- * @return bool|null null on success or false on failure. + * @return false|null null on success or false on failure. */ -function passthru(string $command, &$result_code): null|bool {} +function passthru(string $command, &$result_code): null|false {} /** * Execute command via shell and return the complete output as a string diff --git a/standard/standard_4.php b/standard/standard_4.php index 5b33f9190..ecc6eb623 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -259,6 +259,11 @@ function memory_get_usage(bool $real_usage = false): int {} #[Pure(true)] function memory_get_peak_usage(bool $real_usage = false): int {} +/** + * @since 8.2 + */ +function memory_reset_peak_usage(): void {} + /** * Register a function for execution on shutdown * @link https://php.net/manual/en/function.register-shutdown-function.php @@ -280,9 +285,9 @@ function memory_get_peak_usage(bool $real_usage = false): int {} * It is possible to pass parameters to the shutdown function by passing * additional parameters. *

- * @return bool|null + * @return void */ -function register_shutdown_function(callable $callback, mixed ...$args): null|bool {} +function register_shutdown_function(callable $callback, mixed ...$args): void {} /** * Register a function for execution on each tick @@ -469,6 +474,13 @@ function ini_alter(string $option, string|int|float|bool|null $value): string|fa */ function ini_restore(string $option): void {} +/** + * @param string $shorthand + * @return int + * @since 8.2 + */ +function ini_parse_quantity(string $shorthand): int {} + /** * Gets the current include_path configuration option * @link https://php.net/manual/en/function.get-include-path.php diff --git a/standard/standard_7.php b/standard/standard_7.php index 2484d7b8d..70e3d1993 100644 --- a/standard/standard_7.php +++ b/standard/standard_7.php @@ -1129,6 +1129,6 @@ function ezmlm_hash(string $addr): int {} * LOG_USER is the only valid log type under Windows * operating systems *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function openlog(string $prefix, int $flags, int $facility): bool {} +function openlog(string $prefix, int $flags, int $facility): true {} diff --git a/standard/standard_8.php b/standard/standard_8.php index a2f1dc1fa..77157aece 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -57,16 +57,16 @@ * (strerror) corresponding to the present value of * errno. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function syslog(int $priority, string $message): bool {} +function syslog(int $priority, string $message): true {} /** * Close connection to system logger * @link https://php.net/manual/en/function.closelog.php - * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function closelog(): bool {} +function closelog(): true {} /** * Registers a function that will be called when PHP starts sending output. @@ -380,9 +380,9 @@ function ob_list_handlers(): array {} * parameter sort_flags, for details * see sort. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function ksort(array &$array, int $flags = SORT_REGULAR): bool {} +function ksort(array &$array, int $flags = SORT_REGULAR): true {} /** * Sort an array by key in reverse order @@ -395,9 +395,9 @@ function ksort(array &$array, int $flags = SORT_REGULAR): bool {} * sort_flags, for details see * sort. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function krsort(array &$array, int $flags = SORT_REGULAR): bool {} +function krsort(array &$array, int $flags = SORT_REGULAR): true {} /** * Sort an array using a "natural order" algorithm @@ -430,9 +430,9 @@ function natcasesort(array &$array): bool {} * parameter sort_flags, for details * see sort. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function asort(array &$array, int $flags = SORT_REGULAR): bool {} +function asort(array &$array, int $flags = SORT_REGULAR): true {} /** * Sort an array in reverse order and maintain index association @@ -445,9 +445,9 @@ function asort(array &$array, int $flags = SORT_REGULAR): bool {} * sort_flags, for details see * sort. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function arsort(array &$array, int $flags = SORT_REGULAR): bool {} +function arsort(array &$array, int $flags = SORT_REGULAR): true {} /** * Sort an array @@ -463,9 +463,9 @@ function arsort(array &$array, int $flags = SORT_REGULAR): bool {} * Sorting type flags:
* SORT_REGULAR - compare items normally * (don't change types)

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function sort(array &$array, int $flags = SORT_REGULAR): bool {} +function sort(array &$array, int $flags = SORT_REGULAR): true {} /** * Sort an array in reverse order @@ -493,9 +493,9 @@ function rsort(array &$array, int $flags = SORT_REGULAR): bool {} * greater than zero if the first argument is considered to be * respectively less than, equal to, or greater than the second. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function usort(array &$array, callable $callback): bool {} +function usort(array &$array, callable $callback): true {} /** * Sort an array with a user-defined comparison function and maintain index association @@ -507,9 +507,9 @@ function usort(array &$array, callable $callback): bool {} * See usort and uksort for * examples of user-defined comparison functions. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function uasort(array &$array, callable $callback): bool {} +function uasort(array &$array, callable $callback): true {} /** * Sort an array by keys using a user-defined comparison function @@ -528,9 +528,9 @@ function uasort(array &$array, callable $callback): bool {} * be respectively less than, equal to, or greater than the * second. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function uksort(array &$array, callable $callback): bool {} +function uksort(array &$array, callable $callback): true {} /** * Shuffle an array @@ -538,9 +538,9 @@ function uksort(array &$array, callable $callback): bool {} * @param array &$array

* The array. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function shuffle(array &$array): bool {} +function shuffle(array &$array): true {} /** * Apply a user function to every member of an array @@ -572,9 +572,9 @@ function shuffle(array &$array): bool {} * it will be passed as the third parameter to the callback * funcname. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function array_walk(object|array &$array, callable $callback, mixed $arg): bool {} +function array_walk(object|array &$array, callable $callback, mixed $arg): true {} /** * Apply a user function recursively to every member of an array @@ -600,9 +600,9 @@ function array_walk(object|array &$array, callable $callback, mixed $arg): bool * it will be passed as the third parameter to the callback * funcname. *

- * @return bool true on success or false on failure. + * @return true true on success or false on failure. */ -function array_walk_recursive(object|array &$array, callable $callback, mixed $arg): bool {} +function array_walk_recursive(object|array &$array, callable $callback, mixed $arg): true {} /** * Counts all elements in an array, or something in an object. diff --git a/standard/standard_defines.php b/standard/standard_defines.php index 53cfbb9a9..5014f1bb0 100644 --- a/standard/standard_defines.php +++ b/standard/standard_defines.php @@ -1610,3 +1610,98 @@ * @link https://php.net/manual/en/network.constants.php */ define('LOG_PERROR', 32); + +/** + * @since 8.2 + */ +define('DECIMAL_POINT', 65536); + +/** + * @since 8.2 + */ +define('THOUSANDS_SEP', 65537); + +/** + * @since 8.2 + */ +define('GROUPING', 65538); + +/** + * @since 8.2 + */ +define('ERA_YEAR', 131117); + +/** + * @since 8.2 + */ +define('INT_CURR_SYMBOL', 262144); + +/** + * @since 8.2 + */ +define('CURRENCY_SYMBOL', 262145); + +/** + * @since 8.2 + */ +define('MON_DECIMAL_POINT', 262146); + +/** + * @since 8.2 + */ +define('MON_THOUSANDS_SEP', 262147); + +/** + * @since 8.2 + */ +define('MON_GROUPING', 262148); + +/** + * @since 8.2 + */ +define('POSITIVE_SIGN', 262149); + +/** + * @since 8.2 + */ +define('NEGATIVE_SIGN', 262150); + +/** + * @since 8.2 + */ +define('INT_FRAC_DIGITS', 262151); + +/** + * @since 8.2 + */ +define('FRAC_DIGITS', 262152); + +/** + * @since 8.2 + */ +define('P_CS_PRECEDES', 262153); + +/** + * @since 8.2 + */ +define('P_SEP_BY_SPACE', 262154); + +/** + * @since 8.2 + */ +define('N_CS_PRECEDES', 262155); + +/** + * @since 8.2 + */ +define('N_SEP_BY_SPACE', 262156); + +/** + * @since 8.2 + */ +define('P_SIGN_POSN', 262157); + +/** + * @since 8.2 + */ +define('N_SIGN_POSN', 262158); diff --git a/tests/Model/StubsContainer.php b/tests/Model/StubsContainer.php index aa93c096c..2e1b2ace2 100644 --- a/tests/Model/StubsContainer.php +++ b/tests/Model/StubsContainer.php @@ -126,7 +126,7 @@ public function getFunction($name, $sourceFilePath = null, $shouldSuitCurrentPhp if (!empty($functions)) { return array_pop($functions); } else { - throw new RuntimeException("Could not get function {$name} from reflection"); + throw new RuntimeException("Could not get function {$name} from stubs"); } } diff --git a/xml/xml.php b/xml/xml.php index 19a493ad2..dc222a8ae 100644 --- a/xml/xml.php +++ b/xml/xml.php @@ -115,9 +115,9 @@ function xml_parser_create_ns(?string $encoding, string $separator = ':'): XMLPa * @param object $object

* The object where to use the XML parser. *

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_object(XMLParser $parser, object $object): bool {} +function xml_set_object(XMLParser $parser, object $object): true {} /** * Set up start and end element handlers @@ -144,9 +144,9 @@ function xml_set_object(XMLParser $parser, object $object): bool {} * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_element_handler(XMLParser $parser, $start_handler, $end_handler): bool {} +function xml_set_element_handler(XMLParser $parser, $start_handler, $end_handler): true {} /** * Set up character data handler @@ -168,9 +168,9 @@ function xml_set_element_handler(XMLParser $parser, $start_handler, $end_handler * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_character_data_handler(XMLParser $parser, $handler): bool {} +function xml_set_character_data_handler(XMLParser $parser, $handler): true {} /** * Set up processing instruction (PI) handler @@ -193,9 +193,9 @@ function xml_set_character_data_handler(XMLParser $parser, $handler): bool {} * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_processing_instruction_handler(XMLParser $parser, $handler): bool {} +function xml_set_processing_instruction_handler(XMLParser $parser, $handler): true {} /** * Set up default handler @@ -217,9 +217,9 @@ function xml_set_processing_instruction_handler(XMLParser $parser, $handler): bo * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_default_handler(XMLParser $parser, $handler): bool {} +function xml_set_default_handler(XMLParser $parser, $handler): true {} /** * Set up unparsed entity declaration handler @@ -246,9 +246,9 @@ function xml_set_default_handler(XMLParser $parser, $handler): bool {} * The first parameter, parser, is a * reference to the XML parser calling the * handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_unparsed_entity_decl_handler(XMLParser $parser, $handler): bool {} +function xml_set_unparsed_entity_decl_handler(XMLParser $parser, $handler): true {} /** * Set up notation declaration handler @@ -273,9 +273,9 @@ function xml_set_unparsed_entity_decl_handler(XMLParser $parser, $handler): bool * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_notation_decl_handler(XMLParser $parser, $handler): bool {} +function xml_set_notation_decl_handler(XMLParser $parser, $handler): true {} /** * Set up external entity reference handler @@ -304,9 +304,9 @@ function xml_set_notation_decl_handler(XMLParser $parser, $handler): bool {} * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_external_entity_ref_handler(XMLParser $parser, $handler): bool {} +function xml_set_external_entity_ref_handler(XMLParser $parser, $handler): true {} /** * Set up start namespace declaration handler @@ -333,9 +333,9 @@ function xml_set_external_entity_ref_handler(XMLParser $parser, $handler): bool * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_start_namespace_decl_handler(XMLParser $parser, $handler): bool {} +function xml_set_start_namespace_decl_handler(XMLParser $parser, $handler): true {} /** * Set up end namespace declaration handler @@ -361,9 +361,9 @@ function xml_set_start_namespace_decl_handler(XMLParser $parser, $handler): bool * parser * The first parameter, parser, is a * reference to the XML parser calling the handler.

- * @return bool TRUE on success or FALSE on failure. + * @return true TRUE on success or FALSE on failure. */ -function xml_set_end_namespace_decl_handler(XMLParser $parser, $handler): bool {} +function xml_set_end_namespace_decl_handler(XMLParser $parser, $handler): true {} /** * Start parsing an XML document