diff --git a/docs/bootstrap-inventory.md b/docs/bootstrap-inventory.md index 1c43e394fd..83a164686a 100644 --- a/docs/bootstrap-inventory.md +++ b/docs/bootstrap-inventory.md @@ -8,11 +8,11 @@ Regenerate: `php script/bootstrap-inventory.php` | Metric | Count | |--------|------:| -| PHP files on vm.php path | 6518 | -| Phase A inventory files (M2 ratio SSOT) | 6518 | +| PHP files on vm.php path | 6519 | +| Phase A inventory files (M2 ratio SSOT) | 6519 | | Phase A ratio-deferred paths | 0 | | Source constructs flagged (blockers) | 1 | -| Source constructs flagged (warnings) | 20931 | +| Source constructs flagged (warnings) | 20930 | ## Compiler CFG gaps (`lib/Compiler.php`) @@ -738,6 +738,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag | `ext/gettext/ngettext.php` | 0 | 1 | | `ext/gettext/textdomain.php` | 0 | 2 | | `ext/gmp/GmpConstants.php` | 0 | 1 | +| `ext/gmp/GmpExtensionPolicy.php` | 0 | 1 | | `ext/gmp/GmpFunction.php` | 0 | 1 | | `ext/gmp/GmpToString.php` | 0 | 1 | | `ext/gmp/Module.php` | 0 | 52 | @@ -6216,7 +6217,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag | `lib/VM/Builtin/WeakReferenceCreate.php` | 0 | 3 | | `lib/VM/Builtin/WeakReferenceGet.php` | 0 | 1 | | `lib/VM/BuiltinClasses.php` | 0 | 572 | -| `lib/VM/BuiltinExceptionSupport.php` | 0 | 7 | +| `lib/VM/BuiltinExceptionSupport.php` | 0 | 5 | | `lib/VM/BuiltinExecute.php` | 0 | 1 | | `lib/VM/CallUnpack.php` | 0 | 8 | | `lib/VM/CallUnpackJitHelper.php` | 0 | 2 | @@ -11691,6 +11692,11 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag **Warnings** (review for bootstrap subset): - 1 class method(s) +### `ext/gmp/GmpExtensionPolicy.php` + +**Warnings** (review for bootstrap subset): +- 1 class method(s) + ### `ext/gmp/GmpFunction.php` **Warnings** (review for bootstrap subset): @@ -11704,57 +11710,57 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag ### `ext/gmp/Module.php` **Warnings** (review for bootstrap subset): -- new VM\Variable (line 20) -- new gmp_init (line 34) -- new gmp_add (line 35) -- new gmp_sub (line 36) -- new gmp_mul (line 37) -- new gmp_cmp (line 38) -- new gmp_strval (line 39) -- new gmp_pow (line 40) -- new gmp_mod (line 41) -- new gmp_div_q (line 42) -- new gmp_div_r (line 43) -- new gmp_div_qr (line 44) -- new gmp_abs (line 45) -- new gmp_neg (line 46) -- new gmp_and (line 47) -- new gmp_or (line 48) -- new gmp_xor (line 49) -- new gmp_intval (line 50) -- new gmp_powm (line 51) -- new gmp_fact (line 52) -- new gmp_binomial (line 53) -- new gmp_gcd (line 54) -- new gmp_lcm (line 55) -- new gmp_sqrt (line 56) -- new gmp_sqrtrem (line 57) -- new gmp_perfect_square (line 58) -- new gmp_com (line 59) -- new gmp_random_seed (line 60) -- new gmp_random_bits (line 61) -- new gmp_random_range (line 62) -- new gmp_import (line 63) -- new gmp_export (line 64) -- new gmp_sign (line 65) -- new gmp_prob_prime (line 66) -- new gmp_nextprime (line 67) -- new gmp_invert (line 68) -- new gmp_jacobi (line 69) -- new gmp_legendre (line 70) -- new gmp_kronecker (line 71) -- new gmp_divexact (line 72) -- new gmp_gcdext (line 73) -- new gmp_root (line 74) -- new gmp_rootrem (line 75) -- new gmp_perfect_power (line 76) -- new gmp_testbit (line 77) -- new gmp_setbit (line 78) -- new gmp_clrbit (line 79) -- new gmp_scan0 (line 80) -- new gmp_scan1 (line 81) -- new gmp_popcount (line 82) -- new gmp_hamdist (line 83) +- new VM\Variable (line 28) +- new gmp_init (line 49) +- new gmp_add (line 50) +- new gmp_sub (line 51) +- new gmp_mul (line 52) +- new gmp_cmp (line 53) +- new gmp_strval (line 54) +- new gmp_pow (line 55) +- new gmp_mod (line 56) +- new gmp_div_q (line 57) +- new gmp_div_r (line 58) +- new gmp_div_qr (line 59) +- new gmp_abs (line 60) +- new gmp_neg (line 61) +- new gmp_and (line 62) +- new gmp_or (line 63) +- new gmp_xor (line 64) +- new gmp_intval (line 65) +- new gmp_powm (line 66) +- new gmp_fact (line 67) +- new gmp_binomial (line 68) +- new gmp_gcd (line 69) +- new gmp_lcm (line 70) +- new gmp_sqrt (line 71) +- new gmp_sqrtrem (line 72) +- new gmp_perfect_square (line 73) +- new gmp_com (line 74) +- new gmp_random_seed (line 75) +- new gmp_random_bits (line 76) +- new gmp_random_range (line 77) +- new gmp_import (line 78) +- new gmp_export (line 79) +- new gmp_sign (line 80) +- new gmp_prob_prime (line 81) +- new gmp_nextprime (line 82) +- new gmp_invert (line 83) +- new gmp_jacobi (line 84) +- new gmp_legendre (line 85) +- new gmp_kronecker (line 86) +- new gmp_divexact (line 87) +- new gmp_gcdext (line 88) +- new gmp_root (line 89) +- new gmp_rootrem (line 90) +- new gmp_perfect_power (line 91) +- new gmp_testbit (line 92) +- new gmp_setbit (line 93) +- new gmp_clrbit (line 94) +- new gmp_scan0 (line 95) +- new gmp_scan1 (line 96) +- new gmp_popcount (line 97) +- new gmp_hamdist (line 98) - 3 class method(s) ### `ext/gmp/VmGmp.php` @@ -13974,39 +13980,39 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag - new NumberFormatterGetErrorMessage (line 265) - new Error (line 283) - new ObjectEntry (line 285) -- new ArgumentCountError (line 1868) -- new Error (line 1876) -- new ArgumentCountError (line 1900) -- new ArgumentCountError (line 1930) -- new Error (line 1938) -- new ArgumentCountError (line 1970) -- new Error (line 1978) -- new ArgumentCountError (line 2007) -- new Error (line 2015) -- new ArgumentCountError (line 2070) -- new Error (line 2078) -- new ArgumentCountError (line 2131) -- new Error (line 2139) -- new ArgumentCountError (line 2171) -- new Error (line 2179) -- new ArgumentCountError (line 2203) -- new Error (line 2211) -- new ArgumentCountError (line 2239) -- new Error (line 2247) -- new ArgumentCountError (line 2271) -- new Error (line 2279) -- new ArgumentCountError (line 2307) -- new Error (line 2315) -- new ArgumentCountError (line 2339) -- new Error (line 2347) -- new ArgumentCountError (line 2374) -- new Error (line 2382) -- new ArgumentCountError (line 2405) -- new Error (line 2413) -- new ArgumentCountError (line 2440) -- new Error (line 2448) -- new ArgumentCountError (line 2469) -- new Error (line 2477) +- new ArgumentCountError (line 1879) +- new Error (line 1887) +- new ArgumentCountError (line 1911) +- new ArgumentCountError (line 1941) +- new Error (line 1949) +- new ArgumentCountError (line 1981) +- new Error (line 1989) +- new ArgumentCountError (line 2018) +- new Error (line 2026) +- new ArgumentCountError (line 2081) +- new Error (line 2089) +- new ArgumentCountError (line 2142) +- new Error (line 2150) +- new ArgumentCountError (line 2182) +- new Error (line 2190) +- new ArgumentCountError (line 2214) +- new Error (line 2222) +- new ArgumentCountError (line 2250) +- new Error (line 2258) +- new ArgumentCountError (line 2282) +- new Error (line 2290) +- new ArgumentCountError (line 2318) +- new Error (line 2326) +- new ArgumentCountError (line 2350) +- new Error (line 2358) +- new ArgumentCountError (line 2385) +- new Error (line 2393) +- new ArgumentCountError (line 2416) +- new Error (line 2424) +- new ArgumentCountError (line 2451) +- new Error (line 2459) +- new ArgumentCountError (line 2480) +- new Error (line 2488) - 72 class method(s) ### `ext/intl/VmResourceBundle.php` @@ -41582,7 +41588,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag ### `lib/CompilerVersion.php` **Warnings** (review for bootstrap subset): -- 248 class method(s) +- 249 class method(s) ### `lib/CurlyBraceOffsetRejector.php` @@ -46358,77 +46364,77 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag - new Builtin\ErrorHandler (line 578) - new Scope (line 598) - new Call\ExternalMethod (line 648) -- new Builtin\IsNullFn (line 910) -- new Builtin\IsNullFn (line 911) -- new Call\SplObjectStorageMethod (line 912) -- new Call\SplObjectStorageMethod (line 913) -- new Call\SplObjectStorageMethod (line 914) -- new Call\SplObjectStorageMethod (line 915) -- new Call\SplObjectStorageMethod (line 916) -- new Call\SplObjectStorageMethod (line 917) -- new Call\WeakReferenceCreate (line 919) -- new Call\WeakReferenceGet (line 920) -- new Call\WeakMapMethod (line 921) -- new Call\WeakMapMethod (line 922) -- new Call\WeakMapMethod (line 923) -- new Call\WeakMapMethod (line 924) -- new Call\WeakMapMethod (line 925) -- new Call\ReflectionClassConstruct (line 927) -- new Call\ReflectionObjectConstruct (line 928) -- new Call\ReflectionClassGetName (line 929) -- new Call\ReflectionClassGetShortName (line 930) -- new Call\ReflectionClassGetAttributes (line 931) -- new Call\ReflectionClassGetMethod (line 932) -- new Call\ReflectionClassGetReflectionConstant (line 933) -- new Call\ReflectionClassIsFinal (line 934) -- new Call\ReflectionClassIsIterateable (line 935) -- new Call\ReflectionClassIsIterateable (line 936) -- new Call\ReflectionClassNewLazyProxy (line 938) -- new Call\ReflectionClassNewLazyGhost (line 939) -- new Call\ReflectionClassCreateLazyGhost (line 940) -- new Call\ReflectionClassCreateLazyProxy (line 941) -- new Call\ReflectionPropertyConstruct (line 943) -- new Call\ReflectionPropertyGetAttributes (line 944) -- new Call\ReflectionConstantConstruct (line 945) -- new Call\ReflectionConstantGetAttributes (line 946) -- new Call\ReflectionMethodGetAttributes (line 947) -- new Call\ReflectionFunctionConstruct (line 948) -- new Call\ReflectionFunctionGetName (line 949) -- new Call\ReflectionFunctionIsVariadic (line 950) -- new Call\ReflectionParameterIsSensitiveParameter (line 952) -- new Call\ReflectionFunctionGetNamedArguments (line 955) -- new Call\ReflectionMethodGetNamedArguments (line 956) -- new Call\ReflectionAttributeGetName (line 958) -- new Call\ReflectionAttributeGetTarget (line 959) -- new Call\ReflectionAttributeNewInstance (line 960) -- new Call\ReflectionEnumConstruct (line 961) -- new Call\ReflectionEnumGetName (line 962) -- new Call\ReflectionEnumHasCase (line 963) -- new Call\ReflectionEnumGetCase (line 964) -- new Call\ReflectionEnumIsBacked (line 965) -- new Call\ReflectionEnumUnitCaseGetName (line 966) -- new Call\ReflectionEnumUnitCaseGetName (line 967) -- new Call\ExceptionGetMessage (line 968) -- new Call\DatePeriodCreateFromISO8601String (line 974) -- new Call\DatePeriodIteratorMethod (line 976) -- new Call\DateTimeFormat (line 979) -- new Call\DateTimeFormat (line 980) -- new Call\DateTimeSetTimezone (line 982) -- new Call\DateTimeSetTimezone (line 988) -- new Result (line 1332) -- new Result (line 1354) -- new Variable (line 1956) -- new Variable (line 2093) -- new Variable (line 2319) -- new Variable (line 2377) -- new VMVariable (line 2515) -- new VMVariable (line 2531) -- new VMVariable (line 2537) -- new VMVariable (line 2543) -- new VMVariable (line 2554) -- new Variable (line 2584) -- new Variable (line 2624) -- 102 class method(s) +- new Builtin\IsNullFn (line 948) +- new Builtin\IsNullFn (line 949) +- new Call\SplObjectStorageMethod (line 950) +- new Call\SplObjectStorageMethod (line 951) +- new Call\SplObjectStorageMethod (line 952) +- new Call\SplObjectStorageMethod (line 953) +- new Call\SplObjectStorageMethod (line 954) +- new Call\SplObjectStorageMethod (line 955) +- new Call\WeakReferenceCreate (line 957) +- new Call\WeakReferenceGet (line 958) +- new Call\WeakMapMethod (line 959) +- new Call\WeakMapMethod (line 960) +- new Call\WeakMapMethod (line 961) +- new Call\WeakMapMethod (line 962) +- new Call\WeakMapMethod (line 963) +- new Call\ReflectionClassConstruct (line 965) +- new Call\ReflectionObjectConstruct (line 966) +- new Call\ReflectionClassGetName (line 967) +- new Call\ReflectionClassGetShortName (line 968) +- new Call\ReflectionClassGetAttributes (line 969) +- new Call\ReflectionClassGetMethod (line 970) +- new Call\ReflectionClassGetReflectionConstant (line 971) +- new Call\ReflectionClassIsFinal (line 972) +- new Call\ReflectionClassIsIterateable (line 973) +- new Call\ReflectionClassIsIterateable (line 974) +- new Call\ReflectionClassNewLazyProxy (line 976) +- new Call\ReflectionClassNewLazyGhost (line 977) +- new Call\ReflectionClassCreateLazyGhost (line 978) +- new Call\ReflectionClassCreateLazyProxy (line 979) +- new Call\ReflectionPropertyConstruct (line 981) +- new Call\ReflectionPropertyGetAttributes (line 982) +- new Call\ReflectionConstantConstruct (line 983) +- new Call\ReflectionConstantGetAttributes (line 984) +- new Call\ReflectionMethodGetAttributes (line 985) +- new Call\ReflectionFunctionConstruct (line 986) +- new Call\ReflectionFunctionGetName (line 987) +- new Call\ReflectionFunctionIsVariadic (line 988) +- new Call\ReflectionParameterIsSensitiveParameter (line 990) +- new Call\ReflectionFunctionGetNamedArguments (line 993) +- new Call\ReflectionMethodGetNamedArguments (line 994) +- new Call\ReflectionAttributeGetName (line 996) +- new Call\ReflectionAttributeGetTarget (line 997) +- new Call\ReflectionAttributeNewInstance (line 998) +- new Call\ReflectionEnumConstruct (line 999) +- new Call\ReflectionEnumGetName (line 1000) +- new Call\ReflectionEnumHasCase (line 1001) +- new Call\ReflectionEnumGetCase (line 1002) +- new Call\ReflectionEnumIsBacked (line 1003) +- new Call\ReflectionEnumUnitCaseGetName (line 1004) +- new Call\ReflectionEnumUnitCaseGetName (line 1005) +- new Call\ExceptionGetMessage (line 1006) +- new Call\DatePeriodCreateFromISO8601String (line 1012) +- new Call\DatePeriodIteratorMethod (line 1014) +- new Call\DateTimeFormat (line 1017) +- new Call\DateTimeFormat (line 1018) +- new Call\DateTimeSetTimezone (line 1020) +- new Call\DateTimeSetTimezone (line 1026) +- new Result (line 1373) +- new Result (line 1395) +- new Variable (line 1997) +- new Variable (line 2134) +- new Variable (line 2360) +- new Variable (line 2418) +- new VMVariable (line 2556) +- new VMVariable (line 2572) +- new VMVariable (line 2578) +- new VMVariable (line 2584) +- new VMVariable (line 2595) +- new Variable (line 2625) +- new Variable (line 2665) +- 103 class method(s) - 28 closure(s) ### `lib/JIT/DnfParamCheck.php` @@ -51239,9 +51245,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag - new HashTable (line 214) - new Variable (line 216) - new ObjectEntry (line 686) -- new Variable (line 690) -- new ObjectEntry (line 706) -- new Variable (line 710) +- new Variable (line 692) - 44 class method(s) ### `lib/VM/BuiltinExecute.php` diff --git a/ext/gmp/GmpExtensionPolicy.php b/ext/gmp/GmpExtensionPolicy.php new file mode 100644 index 0000000000..20790c4e9c --- /dev/null +++ b/ext/gmp/GmpExtensionPolicy.php @@ -0,0 +1,23 @@ +vmContext); foreach (GmpConstants::registeredConstants() as $name => $value) { $var = new VM\Variable(); @@ -25,11 +33,18 @@ public function init(Runtime $runtime): void public static function registerClasses(Context $ctx): void { + if (!GmpExtensionPolicy::advertisesExtension()) { + return; + } VmGmpObject::registerClass($ctx); } public function getFunctions(): array { + if (!GmpExtensionPolicy::advertisesExtension()) { + return []; + } + return [ new gmp_init(), new gmp_add(), diff --git a/ext/standard/BuiltinIntrospectionPolicy.php b/ext/standard/BuiltinIntrospectionPolicy.php index 93be39242c..ffcc1e2dc2 100644 --- a/ext/standard/BuiltinIntrospectionPolicy.php +++ b/ext/standard/BuiltinIntrospectionPolicy.php @@ -189,6 +189,9 @@ public static function functionIsAdvertised(string $functionName): bool if (\in_array($lc, ['yaml_parse', 'yaml_parse_file', 'yaml_emit', 'yaml_emit_file'], true)) { return \PHPCompiler\ext\yaml\YamlExtensionPolicy::advertisesExtension(); } + if (str_starts_with($lc, 'gmp_')) { + return \PHPCompiler\ext\gmp\GmpExtensionPolicy::advertisesExtension(); + } if (\in_array($lc, [ 'ldap_escape', 'ldap_dn2ufn', @@ -285,6 +288,9 @@ public static function extensionIsAdvertised(string $extension): bool if ('ftp' === $ext) { return \PHPCompiler\ext\ftp\FtpExtensionPolicy::advertisesExtension(); } + if ('gmp' === $ext) { + return \PHPCompiler\ext\gmp\GmpExtensionPolicy::advertisesExtension(); + } if ('gnupg' === $ext) { return \PHPCompiler\ext\gnupg\GnupgExtensionPolicy::advertisesExtension(); } diff --git a/ext/standard/ExtensionConstantGroups.php b/ext/standard/ExtensionConstantGroups.php index 2f458e2bbf..f769600ad8 100644 --- a/ext/standard/ExtensionConstantGroups.php +++ b/ext/standard/ExtensionConstantGroups.php @@ -100,7 +100,9 @@ public static function groups(): array // Module buckets for extensions that register into Context::$constants (#22337 / re-#19113). $groups['ftp'] = FtpConstants::registeredConstants(); $groups['mysqli'] = MysqliConstants::registeredConstants(); - $groups['gmp'] = GmpConstants::registeredConstants(); + if (\PHPCompiler\ext\gmp\GmpExtensionPolicy::advertisesExtension()) { + $groups['gmp'] = GmpConstants::registeredConstants(); + } $groups['soap'] = SoapConstants::registeredConstants(); $groups['tidy'] = TidyConstants::registeredConstants(); $groups['pgsql'] = PgsqlConstants::registeredConstants(); diff --git a/ext/standard/ModuleRegistry.php b/ext/standard/ModuleRegistry.php index 3223e080d9..e272921f72 100644 --- a/ext/standard/ModuleRegistry.php +++ b/ext/standard/ModuleRegistry.php @@ -151,10 +151,12 @@ public static function registerModule(Module $module): void && !\PHPCompiler\ext\mongodb\MongodbExtensionPolicy::advertisesExtension(); $withholdSnmpSurface = 'snmp' === $primary && !\PHPCompiler\ext\snmp\SnmpExtensionPolicy::advertisesExtension(); + $withholdGmpSurface = 'gmp' === $primary + && !\PHPCompiler\ext\gmp\GmpExtensionPolicy::advertisesExtension(); $withholdFfiSurface = 'ffi' === $primary && !\PHPCompiler\ext\ffi\FfiExtensionPolicy::advertisesExtension(); - if (!$withholdOpensslSurface && !$withholdSqlite3Surface && !$withholdLdapSurface && !$withholdInotifySurface && !$withholdXslSurface && !$withholdXmlrpcSurface && !$withholdWddxSurface && !$withholdYamlSurface && !$withholdRedisSurface && !$withholdMongodbSurface && !$withholdSnmpSurface && !$withholdFfiSurface) { + if (!$withholdOpensslSurface && !$withholdSqlite3Surface && !$withholdLdapSurface && !$withholdInotifySurface && !$withholdXslSurface && !$withholdXmlrpcSurface && !$withholdWddxSurface && !$withholdYamlSurface && !$withholdRedisSurface && !$withholdMongodbSurface && !$withholdSnmpSurface && !$withholdGmpSurface && !$withholdFfiSurface) { self::register($module->getExtensionName(), $moduleVersion); } elseif ($registerSqlite3ExtensionLoaded) { self::register($module->getExtensionName(), $moduleVersion); @@ -181,7 +183,7 @@ public static function registerModule(Module $module): void continue; } $fnName = strtolower($func->getName()); - if ($withholdOpensslSurface || $withholdSqlite3Surface || $withholdLdapSurface || $withholdInotifySurface || $withholdXslSurface || $withholdXmlrpcSurface || $withholdWddxSurface || $withholdYamlSurface || $withholdRedisSurface || $withholdMongodbSurface || $withholdSnmpSurface || $withholdFfiSurface) { + if ($withholdOpensslSurface || $withholdSqlite3Surface || $withholdLdapSurface || $withholdInotifySurface || $withholdXslSurface || $withholdXmlrpcSurface || $withholdWddxSurface || $withholdYamlSurface || $withholdRedisSurface || $withholdMongodbSurface || $withholdSnmpSurface || $withholdGmpSurface || $withholdFfiSurface) { self::registerBuiltinLookup($fnName); continue; diff --git a/lib/CompilerVersion.php b/lib/CompilerVersion.php index af3838e6a6..e96ef33004 100644 --- a/lib/CompilerVersion.php +++ b/lib/CompilerVersion.php @@ -2812,6 +2812,17 @@ public static function supportsMongodb(): bool return version_compare(self::languageProfileVersion(), '8.4.0', '>='); } + /** + * ext/gmp via pure PHP {@see \PHPCompiler\ext\gmp\VmGmp} — withheld on reference profile (#22860). + * + * Gated on stable 8.4.0 / {@see languageProfileVersion()} so 8.4.0-dev reference profile matches Zend 8.2 + * phantom gate (host ext-gmp absent). Enable forward profile via `PHP_COMPILER_PROFILE=8.4`. + */ + public static function supportsGmp(): bool + { + return version_compare(self::languageProfileVersion(), '8.4.0', '>='); + } + /** * ext/snmp via pure PHP {@see \PHPCompiler\ext\snmp\VmSnmp} — withheld on reference profile (#6070). * diff --git a/test/compliance/JITTest.php b/test/compliance/JITTest.php index 1f630ef6db..6840d8ce3e 100755 --- a/test/compliance/JITTest.php +++ b/test/compliance/JITTest.php @@ -880,6 +880,15 @@ public static function providePHPTests(): \Generator && str_contains($name, 'snmp_phantom')) { continue; } + if (CompilerVersion::supportsGmp() + && str_contains($name, 'extension_loaded_gmp_phantom')) { + continue; + } + // extension_loaded / class_exists introspection — VM-only (JIT module-verify on bool→int path; #22860). + if (str_contains($name, 'extension_loaded_gmp_phantom') + || str_contains($name, 'extension_loaded_gmp_forward84')) { + continue; + } if (!CompilerVersion::supportsZip() && (str_contains($name, 'zip') || str_contains($name, 'ziparchive')) diff --git a/test/compliance/VMTest.php b/test/compliance/VMTest.php index 3fb517004a..ad5bae3733 100755 --- a/test/compliance/VMTest.php +++ b/test/compliance/VMTest.php @@ -753,6 +753,10 @@ public static function providePHPTests(): \Generator && str_contains($name, 'snmp_phantom')) { continue; } + if (CompilerVersion::supportsGmp() + && str_contains($name, 'extension_loaded_gmp_phantom')) { + continue; + } if (!CompilerVersion::supportsZip() && (str_contains($name, 'zip') || str_contains($name, 'ziparchive')) diff --git a/test/compliance/cases/gmp/add_cmp.phpt b/test/compliance/cases/gmp/add_cmp.phpt index fd9dbe2f36..e0e1e5ab54 100644 --- a/test/compliance/cases/gmp/add_cmp.phpt +++ b/test/compliance/cases/gmp/add_cmp.phpt @@ -1,5 +1,7 @@ --TEST-- gmp add/cmp phase-1 parity (ext/gmp/gmp.c; issue #3341) +--ENV-- +PHP_COMPILER_PROFILE=8.4 --FILE-- getMessage(), "\n"; -} -?> ---EXPECT-- -0 -1 -gmp_init(): Argument #1 ($num) must be of type GMP|string|int, array given diff --git a/test/compliance/cases/gmp/object_operators.phpt b/test/compliance/cases/gmp/object_operators.phpt index 0a3c24f272..c35e5e3349 100644 --- a/test/compliance/cases/gmp/object_operators.phpt +++ b/test/compliance/cases/gmp/object_operators.phpt @@ -1,5 +1,7 @@ --TEST-- GMP object operators do_operation/compare (ext/gmp/gmp.c; issue #21265) +--ENV-- +PHP_COMPILER_PROFILE=8.4 --FILE-- self::parsePHPT( - __DIR__.'/../compliance/cases/gmp/gmp_init_null.phpt', - 'gmp_init_null.phpt' + yield 'extension_loaded_gmp_forward84.phpt' => self::parsePHPT( + __DIR__.'/../compliance/cases/gmp/extension_loaded_gmp_forward84.phpt', + 'extension_loaded_gmp_forward84.phpt' ); yield 'gmp_init_null_forward84.phpt' => self::parsePHPT( __DIR__.'/../compliance/cases/gmp/gmp_init_null_forward84.phpt', @@ -42,5 +42,9 @@ public static function providePHPTests(): \Generator __DIR__.'/../compliance/cases/gmp/phase4_random_import.phpt', 'gmp_phase4_random_import.phpt' ); + yield 'extension_loaded_gmp_phantom.phpt' => self::parsePHPT( + __DIR__.'/../compliance/cases/stdlib/extension_loaded_gmp_phantom.phpt', + 'extension_loaded_gmp_phantom.phpt' + ); } }