Skip to content

Commit 7f00352

Browse files
committed
Do not generate frameless function entries for PHP 8.4<
1 parent f8635d0 commit 7f00352

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build/gen_stub.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,14 @@ public function getFramelessDeclaration(FuncInfo $funcInfo): ?string {
13771377
return null;
13781378
}
13791379

1380+
$php84MinimumCompatibility = $this->minimumPhpVersionIdCompatibility === null || $this->minimumPhpVersionIdCompatibility >= PHP_84_VERSION_ID;
1381+
13801382
$code = '';
1383+
1384+
if (!$php84MinimumCompatibility) {
1385+
$code .= "#if (PHP_VERSION_ID >= " . PHP_84_VERSION_ID . ")\n";
1386+
}
1387+
13811388
foreach ($this->framelessFunctionInfos as $framelessFunctionInfo) {
13821389
$code .= "ZEND_FRAMELESS_FUNCTION({$this->name->getFunctionName()}, {$framelessFunctionInfo->arity});\n";
13831390
}
@@ -1388,6 +1395,11 @@ public function getFramelessDeclaration(FuncInfo $funcInfo): ?string {
13881395
}
13891396
$code .= "\t{ 0 },\n";
13901397
$code .= "};\n";
1398+
1399+
if (!$php84MinimumCompatibility) {
1400+
$code .= "#endif\n";
1401+
}
1402+
13911403
return $code;
13921404
}
13931405

0 commit comments

Comments
 (0)