@@ -316,30 +316,24 @@ function funcInfoToCode(FuncInfo $funcInfo): string {
316
316
}
317
317
318
318
foreach ($ funcInfo ->args as $ argInfo ) {
319
- if ($ argInfo ->isVariadic ) {
320
- if ($ argInfo ->type ) {
321
- throw new Exception ("Not implemented " );
322
- }
323
- $ code .= sprintf (
324
- "\tZEND_ARG_VARIADIC_INFO(%d, %s) \n" ,
325
- $ argInfo ->byRef , $ argInfo ->name
326
- );
327
- } else if ($ argInfo ->type ) {
319
+ $ argKind = $ argInfo ->isVariadic ? "ARG_VARIADIC " : "ARG " ;
320
+ if ($ argInfo ->type ) {
328
321
if ($ argInfo ->type ->isBuiltin ) {
329
322
$ code .= sprintf (
330
- "\t ZEND_ARG_TYPE_INFO (%d, %s, %s, %d) \n" ,
331
- $ argInfo ->byRef , $ argInfo ->name ,
323
+ "\t ZEND_%s_TYPE_INFO (%d, %s, %s, %d) \n" ,
324
+ $ argKind , $ argInfo ->byRef , $ argInfo ->name ,
332
325
$ argInfo ->type ->toTypeCode (), $ argInfo ->type ->isNullable
333
326
);
334
327
} else {
335
328
$ code .= sprintf (
336
- "\t ZEND_ARG_OBJ_INFO (%d, %s, %s, %d) \n" ,
337
- $ argInfo ->byRef , $ argInfo ->name ,
329
+ "\t ZEND_%s_OBJ_INFO (%d, %s, %s, %d) \n" ,
330
+ $ argKind , $ argInfo ->byRef , $ argInfo ->name ,
338
331
$ argInfo ->type ->name , $ argInfo ->type ->isNullable
339
332
);
340
333
}
341
334
} else {
342
- $ code .= sprintf ("\tZEND_ARG_INFO(%d, %s) \n" , $ argInfo ->byRef , $ argInfo ->name );
335
+ $ code .= sprintf (
336
+ "\tZEND_%s_INFO(%d, %s) \n" , $ argKind , $ argInfo ->byRef , $ argInfo ->name );
343
337
}
344
338
}
345
339
0 commit comments