Polyfill PHP 8.3 is incomplete
llaville opened this issue · comments
Hello,
As author of package https://github.com/llaville/php-compatinfo-db that reference all PHP components since a long time now, I've introduced a new branch 6.x that reference PHP 8.3 introductions since alpha1.
TL;DR / just FYI : llaville/php-compatinfo-db#133
In summary here are elements I've found on original source code https://github.com/php/php-src/tree/php-8.3.0RC3/ext, and those what are already implement in this polyfill, and the others !
data/reference/extension/core/83/classes.json:
- Override 8.3.0alpha3
data/reference/extension/core/83/iniEntries.json:
- zend.max_allowed_stack_size 8.3.0alpha1
- zend.reserved_stack_size 8.3.0alpha1
data/reference/extension/curl/83/constants.json:
- CURLINFO_CAPATH 8.3.0beta1
- CURLINFO_CAINFO 8.3.0beta1
- CURLOPT_MIME_OPTIONS 8.3.0beta1
- CURLMIMEOPT_FORMESCAPE 8.3.0beta1
- CURLOPT_WS_OPTIONS 8.3.0beta1
- CURLWS_RAW_MODE 8.3.0beta1
- CURLOPT_SSH_HOSTKEYFUNCTION 8.3.0beta1
- CURLOPT_PROTOCOLS_STR 8.3.0beta1
- CURLOPT_REDIR_PROTOCOLS_STR 8.3.0beta1
- CURLOPT_CA_CACHE_TIMEOUT 8.3.0beta1
- CURLOPT_QUICK_EXIT 8.3.0beta1
- CURLKHMATCH_OK 8.3.0beta1
- CURLKHMATCH_MISMATCH 8.3.0beta1
- CURLKHMATCH_MISSING 8.3.0beta1
- CURLKHMATCH_LAST 8.3.0beta1
data/reference/extension/date/83/classes.json:
- DateError 8.3.0alpha1
- DateObjectError 8.3.0alpha1
- DateRangeError 8.3.0alpha1
- DateException 8.3.0alpha1
- DateInvalidTimeZoneException 8.3.0alpha1
- DateInvalidOperationException 8.3.0alpha1
data/reference/extension/date/83/methods.json:
- DatePeriod::createFromISO8601String 8.3.0beta1
data/reference/extension/dom/83/methods.json:
- DOMElement::getAttributeNames 8.3.0beta1
- DOMElement::insertAdjacentElement 8.3.0beta1
- DOMElement::insertAdjacentText 8.3.0beta1
- DOMElement::toggleAttribute 8.3.0beta1
- DOMNode::contains 8.3.0beta1
- DOMNode::getRootNode 8.3.0beta1
- DOMNode::isEqualNode 8.3.0beta1
- DOMNode::replaceChildren 8.3.0beta1
data/reference/extension/intl/83/const.json:
- Spoofchecker::MIXED_NUMBERS 8.3.0alpha1
- Spoofchecker::HIDDEN_OVERLAY 8.3.0alpha1
data/reference/extension/intl/83/methods.json:
- IntlCalendar::setDate 8.3.0beta1
- IntlCalendar::setDateTime 8.3.0beta1
- IntlGregorianCalendar::createFromDate 8.3.0beta1
- IntlGregorianCalendar::createFromDateTime 8.3.0beta1
data/reference/extension/json/83/functions.json:
- json_validate 8.3.0alpha1
data/reference/extension/ldap/83/functions.json:
- ldap_exop_sync 8.3.0beta1
- ldap_connect_wallet 8.3.0beta1
data/reference/extension/mbstring/83/functions.json:
- mb_str_pad 8.3.0alpha3
data/reference/extension/opcache/83/iniEntries.json:
- opcache.jit_max_trace_length 8.3.0alpha1
data/reference/extension/openssl/83/constants.json:
- OPENSSL_CMS_OLDMIMETYPE 8.3.0alpha1
- PKCS7_NOOLDMIMETYPE 8.3.0alpha1
data/reference/extension/pgsql/83/constants.json:
- PGSQL_PIPELINE_SYNC 8.3.0alpha1
- PGSQL_PIPELINE_ON 8.3.0alpha1
- PGSQL_PIPELINE_OFF 8.3.0alpha1
- PGSQL_PIPELINE_ABORTED 8.3.0alpha1
- PGSQL_ERRORS_SQLSTATE 8.3.0alpha1
- PGSQL_TRACE_SUPPRESS_TIMESTAMPS 8.3.0alpha1
- PGSQL_TRACE_REGRESS_MODE 8.3.0alpha1
- PGSQL_SHOW_CONTEXT_NEVER 8.3.0alpha2
- PGSQL_SHOW_CONTEXT_ERRORS 8.3.0alpha2
- PGSQL_SHOW_CONTEXT_ALWAYS 8.3.0alpha2
data/reference/extension/pgsql/83/functions.json:
- pg_enter_pipeline_mode 8.3.0alpha1
- pg_exit_pipeline_mode 8.3.0alpha1
- pg_pipeline_status 8.3.0alpha1
- pg_pipeline_sync 8.3.0alpha1
- pg_set_error_context_visibility 8.3.0alpha2
data/reference/extension/posix/83/constants.json:
- POSIX_SC_ARG_MAX 8.3.0alpha1
- POSIX_SC_PAGESIZE 8.3.0alpha1
- POSIX_SC_NPROCESSORS_CONF 8.3.0alpha1
- POSIX_SC_NPROCESSORS_ONLN 8.3.0alpha1
- POSIX_PC_LINK_MAX 8.3.0alpha1
- POSIX_PC_MAX_CANON 8.3.0alpha1
- POSIX_PC_MAX_INPUT 8.3.0alpha1
- POSIX_PC_NAME_MAX 8.3.0alpha1
- POSIX_PC_PATH_MAX 8.3.0alpha1
- POSIX_PC_PIPE_BUF 8.3.0alpha1
data/reference/extension/posix/83/functions.json:
- posix_eaccess 8.3.0alpha1
- posix_sysconf 8.3.0alpha1
- posix_pathconf 8.3.0alpha1
data/reference/extension/reflection/83/methods.json:
- ReflectionMethod::createFromMethodName 8.3.0beta1
- ReflectionClassConstant::getType 8.3.0alpha1
- ReflectionClassConstant::hasType 8.3.0alpha1
data/reference/extension/sockets/83/constants.json:
- IP_BIND_ADDRESS_NO_PORT 8.3.0alpha1
- SOL_UDPLITE 8.3.0alpha1
- UDPLITE_SEND_CSCOV 8.3.0alpha1
- UDPLITE_RECV_CSCOV 8.3.0alpha1
- SO_ATTACH_REUSEPORT_CBPF 8.3.0alpha1
- SO_DETACH_FILTER 8.3.0alpha1
- SO_DETACH_BPF 8.3.0alpha1
- TCP_QUICKACK 8.3.0alpha1
- TCP_REPAIR 8.3.0alpha1
- IP_DONTFRAG 8.3.0alpha1
- IP_MTU_DISCOVER 8.3.0alpha1
- IP_PMTUDISC_DO 8.3.0alpha1
- IP_PMTUDISC_DONT 8.3.0alpha1
- IP_PMTUDISC_WANT 8.3.0alpha1
- IP_PMTUDISC_PROBE 8.3.0alpha1
- IP_PMTUDISC_INTERFACE 8.3.0alpha1
- IP_PMTUDISC_OMIT 8.3.0alpha1
data/reference/extension/sockets/83/functions.json:
- socket_atmark 8.3.0alpha1
data/reference/extension/sqlite3/83/classes.json:
- SQLite3Exception 8.3.0alpha3
data/reference/extension/standard/83/functions.json:
- str_increment 8.3.0beta1
- str_decrement 8.3.0beta1
- stream_context_set_options 8.3.0beta1
Well, many of those things are not polyfillable. Only new functions and new classes are.
New constants are technically polyfillable. But when they are used to enable behavior in existing function, polyfilling the constant without polyfilling the new behavior in the existing function is actually worse because it provides a non-working polyfill (and it breaks feature detection of the actual support).
In this list, the only polyfillable things are the new str_increment
and str_decrement
functions (and nobody has contributed a polyfill for them yet, which is why they are not there)
data/reference/extension/core/83/iniEntries.json:
- zend.max_allowed_stack_size 8.3.0alpha1
- zend.reserved_stack_size 8.3.0alpha1
What shall we do about those? How would we polyfill a new ini setting?
- CURLINFO_CAPATH 8.3.0beta1
- CURLINFO_CAINFO 8.3.0beta1
- CURLOPT_MIME_OPTIONS 8.3.0beta1
- CURLMIMEOPT_FORMESCAPE 8.3.0beta1
- CURLOPT_WS_OPTIONS 8.3.0beta1
- CURLWS_RAW_MODE 8.3.0beta1
- CURLOPT_SSH_HOSTKEYFUNCTION 8.3.0beta1
- CURLOPT_PROTOCOLS_STR 8.3.0beta1
- CURLOPT_REDIR_PROTOCOLS_STR 8.3.0beta1
- CURLOPT_CA_CACHE_TIMEOUT 8.3.0beta1
- CURLOPT_QUICK_EXIT 8.3.0beta1
- CURLKHMATCH_OK 8.3.0beta1
- CURLKHMATCH_MISMATCH 8.3.0beta1
- CURLKHMATCH_MISSING 8.3.0beta1
- CURLKHMATCH_LAST 8.3.0beta1
We could polyfill those constants, but not the logic behind it. In fact, if you used one of the polyfilled constants like they're supposed to be used and passed it to actual ext-curl functions, you'd get an error. So what's the point in polyfilling them?
data/reference/extension/date/83/methods.json:
- DatePeriod::createFromISO8601String 8.3.0beta1
We cannot polyfill methods/constants of core classes. 🤷🏻♂️
Same issue for all ext-dom and ext-intl classes you've listed.
data/reference/extension/pgsql/83/functions.json:
- pg_enter_pipeline_mode 8.3.0alpha1
- pg_exit_pipeline_mode 8.3.0alpha1
- pg_pipeline_status 8.3.0alpha1
- pg_pipeline_sync 8.3.0alpha1
- pg_set_error_context_visibility 8.3.0alpha2
Those functions leverage functionality of the Postgres client library. I doubt that we can emulate them in userland.
data/reference/extension/standard/83/functions.json:
- str_increment 8.3.0beta1
- str_decrement 8.3.0beta1
PR welcome! 🙂
Closing in favor of #452