phuture/continuum
Composer 安装命令:
composer require phuture/continuum
包简介
A forward-compatibility layer bringing tomorrow’s PHP features to today’s runtimes.
README 文档
README
Phuture Continuum
A forward-compatibility layer bringing tomorrow’s PHP features to today’s runtimes.
Introduction
Continuum bridges the gap between PHP versions by extending Symfony Polyfill with additional methods, constants, and stubs. Built on Symfony's solid foundation, Continuum provides extra polyfills and graceful fallbacks—enabling you to write forward-compatible code that works consistently across different PHP runtimes.
Features
This package polyfills most common PHP functions from PHP 8.1 to 8.6, designed to be used on PHP 8.0 or later.
| Polyfill | Level | Type |
|---|---|---|
| ▶️ PHP 8.1+ | ||
array_is_list() |
✅ Full | Function |
enum_exists() |
✅ Full | Function |
fsync() |
❇️ Partial | Function |
fdatasync() |
❇️ Partial | Function |
IMAGETYPE_AVIF |
✅ Full | Constant |
IMG_AVIF |
✅ Full | Constant |
IMG_WEBP_LOSSLESS |
✅ Full | Constant |
MYSQLI_REFRESH_REPLICA |
✅ Full | Constant |
T_READONLY |
✅ Full | Constant |
CURLStringFile |
✅ Full | Class |
ReturnTypeWillChange |
✅ Full | Attribute |
| ▶️ PHP 8.2+ | ||
ini_parse_quantity() |
✅ Full | Function |
odbc_connection_string_is_quoted() |
✅ Full | Function |
odbc_connection_string_should_quote() |
✅ Full | Function |
odbc_connection_string_quote() |
✅ Full | Function |
curl_upkeep() |
❇️ Partial | Function |
memory_reset_peak_usage() |
⚠️ No-op | Function |
mysqli_execute_query() |
✅ Full | Function |
openssl_cipher_key_length() |
✅ Full | Function |
imap_is_open() |
✅ Full | Function |
AllowDynamicProperties |
✅ Full | Attribute |
SensitiveParameter |
✅ Full | Attribute |
SensitiveParameterValue |
✅ Full | Class |
Random\Engine |
✅ Full | Interface |
Random\CryptoSafeEngine |
✅ Full | Interface |
Random\Engine\Secure |
✅ Full | Class |
| ▶️ PHP 8.3+ | ||
json_validate() |
✅ Full | Function |
mb_str_pad() |
✅ Full | Function |
str_increment() |
✅ Full | Function |
str_decrement() |
✅ Full | Function |
stream_context_set_options() |
✅ Full | Function |
posix_eaccess() |
✅ Full | Function |
POSIX_PC_* (10 constants) |
✅ Full | Constant |
POSIX_*_OK (4 constants) |
✅ Full | Constant |
Override |
✅ Full | Attribute |
DateError / DateException (and related) |
✅ Full | Class |
SQLite3Exception |
✅ Full | Class |
ldap_exop_sync() |
✅ Full | Function |
ldap_connect_wallet() |
✅ Full | Function |
| ▶️ PHP 8.4+ | ||
array_find() |
✅ Full | Function |
array_find_key() |
✅ Full | Function |
array_any() |
✅ Full | Function |
array_all() |
✅ Full | Function |
fpow() |
✅ Full | Function |
grapheme_str_split() |
✅ Full | Function |
PHP_SBINDIR |
✅ Full | Constant |
CURL_HTTP_VERSION_3 |
✅ Full | Constant |
CURL_HTTP_VERSION_3ONLY |
✅ Full | Constant |
Deprecated |
✅ Full | Attribute |
RoundingMode |
✅ Full | Enum |
ReflectionConstant |
✅ Full | Class |
PDO driver subclasses (Dblib, Firebird, etc.) |
✅ Full | Class |
| ▶️ PHP 8.5+ | ||
array_first() |
✅ Full | Function |
array_last() |
✅ Full | Function |
get_error_handler() |
✅ Full | Function |
get_exception_handler() |
✅ Full | Function |
locale_is_right_to_left() |
✅ Full | Function |
grapheme_levenshtein() |
✅ Full | Function |
PHP_BUILD_DATE |
✅ Full | Constant |
PHP_BUILD_PROVIDER |
✅ Full | Constant |
NoDiscard |
✅ Full | Attribute |
DelayedTargetValidation |
✅ Full | Attribute |
Uri\Rfc3986\Uri |
✅ Full | Class |
Uri\WhatWg\Url |
✅ Full | Class |
Uri\WhatWg\InvalidUrlException |
✅ Full | Class |
Uri\WhatWg\UrlValidationError |
✅ Full | Class |
Uri\WhatWg\UrlValidationErrorType |
✅ Full | Class |
Uri\UriException |
✅ Full | Class |
Uri\InvalidUriException |
✅ Full | Class |
Uri\UriComparisonMode |
✅ Full | Class |
Filter\FilterException |
✅ Full | Class |
Filter\FilterFailedException |
✅ Full | Class |
| ▶️ PHP 8.6+ | ||
clamp() |
✅ Full | Function |
grapheme_strrev() |
✅ Full | Function |
SortDirection |
✅ Full | Enum |
This package also provides polyfills for some PHP extensions, allowing better portability across different PHP runtimes.
| Extension | Level |
|---|---|
ext-mbstring |
⚠️ Partial |
ext-iconv |
✅ Full |
ext-apcu |
⚠️ Partial |
ext-ctype |
✅ Full |
ext-uuid |
✅ Full |
ext-bcmath |
✅ Full |
ext-intl |
⚠️ Partial |
ext-zip |
⚠️ Partial |
What's Not Covered
The entries marked ❇️ Partial or ⚠️ Partial in the tables above have meaningful gaps. This section documents exactly what each one omits or cannot replicate.
Partial Polyfills
fsync() / fdatasync() (PHP 8.1)
- Both fall back to
fflush(), plusposix_fsync()when theposixextension is loaded. - There is no guarantee of actual disk-level synchronization on systems without the POSIX extension.
- The return value is always
true, even when the underlying OS sync did not occur.
curl_upkeep() (PHP 8.2)
- Only sets
CURLOPT_FORBID_REUSE = falseandCURLOPT_FRESH_CONNECT = false. - Does not perform real HTTP/2 connection maintenance (window-size updates, PING frames, or keep-alive signalling).
- Full behaviour requires PHP 8.2+ with libcurl ≥ 7.62.0.
Partial Extensions
ext-mbstring
- The only functions with no polyfill are the stateful regex-search family:
mb_ereg_search(),mb_ereg_search_init(),mb_ereg_search_pos(),mb_ereg_search_regs(),mb_ereg_search_getpos(),mb_ereg_search_getregs(), andmb_ereg_search_setpos(). mb_convert_kana()supports only theR,r,N,n,K,k,V,A,aconversion modes.
ext-apcu
- In-memory, non-persistent cache: data is lost between requests.
- Scoped to a single process; entries are not shared across PHP-FPM workers.
- No atomic operations beyond basic
get/set; no TTL-based eviction or shared-memory sizing.
ext-intl
Collator: simplified sorting - does not implement the full Unicode Collation Algorithm.NumberFormatter: advanced formatting features (currency symbol overrides, padding, significant digits) are missing.Locale: operations are simplified; no full CLDR data lookup.- No direct access to ICU binary data; limited to the subset bundled with Symfony.
ext-zip
ZipArchive::getArchiveFlag()- always returns0; archive-level flags are a libzip internal concept not accessible through userland php.ZipArchive::setArchiveFlag()- always returnsfalse.ZipArchive::registerProgressCallback()- always returnsfalse.ZipArchive::registerCancelCallback()- always returnsfalse.- Procedural
zip_entry_open()only accepts modesrandrb; write-mode entry access is not supported. - Multi-disk ZIP archives are not supported.
- Writing with compression methods
CM_LZMA,CM_LZMA2, andCM_XZis not supported.
Installation
composer require phuture/continuum
Contributing
Thank you for considering contributing to this project! You can read the Contribution Guide and our Developer Workflow Guide.
Code of Conduct
This project follows a Code of Conduct that all community members and contributors are expected to adhere to our Contributor Code of Conduct.
License
This project is open-source and available under the MIT License.
phuture/continuum 适用场景与选型建议
phuture/continuum 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 283 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「compatibility」 「portable」 「polyfill」 「shim」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phuture/continuum 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phuture/continuum 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phuture/continuum 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony polyfill backporting some PHP 8.6+ features to lower PHP versions
A polyfill for pthreads
Polyfill for the New Relic PHP extension
Compatibility layer for emulating enumerations in PHP < 8.1 and native enumerations in PHP >= 8.1
PHP polyfill for the Apache Functions. The aim is to provides functions as the PHP way in order to get them available even if PHP is not running as an Apache module.
Polyfill for mb_ereg(), mb_eregi(), mb_ereg_match(), and mb_ereg_replace*() functions; primary use case is for mbstring on Windows 7.4+
统计信息
- 总下载量: 283
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 49
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-01