Skip to content

Commit 11a9574

Browse files
Convert more zend_parse_parameters_none() to fast ZPP (#21330)
1 parent 471ae15 commit 11a9574

File tree

34 files changed

+80
-240
lines changed

34 files changed

+80
-240
lines changed

ext/com_dotnet/com_com.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,7 @@ PHP_FUNCTION(com_create_guid)
658658
GUID retval;
659659
OLECHAR *guid_string;
660660

661-
if (zend_parse_parameters_none() == FAILURE) {
662-
RETURN_THROWS();
663-
}
661+
ZEND_PARSE_PARAMETERS_NONE();
664662

665663
php_com_initialize();
666664
if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {

ext/com_dotnet/com_persist.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,7 @@ CPH_METHOD(GetCurFileName)
319319
OLECHAR *olename = NULL;
320320
CPH_FETCH();
321321

322-
if (zend_parse_parameters_none() == FAILURE) {
323-
RETURN_THROWS();
324-
}
322+
ZEND_PARSE_PARAMETERS_NONE();
325323

326324
CPH_NO_OBJ();
327325

@@ -457,9 +455,7 @@ CPH_METHOD(GetMaxStreamSize)
457455
ULARGE_INTEGER size;
458456
CPH_FETCH();
459457

460-
if (zend_parse_parameters_none() == FAILURE) {
461-
RETURN_THROWS();
462-
}
458+
ZEND_PARSE_PARAMETERS_NONE();
463459

464460
CPH_NO_OBJ();
465461

@@ -491,9 +487,7 @@ CPH_METHOD(InitNew)
491487
HRESULT res;
492488
CPH_FETCH();
493489

494-
if (zend_parse_parameters_none() == FAILURE) {
495-
RETURN_THROWS();
496-
}
490+
ZEND_PARSE_PARAMETERS_NONE();
497491

498492
CPH_NO_OBJ();
499493

ext/dba/dba.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,9 +1301,7 @@ PHP_FUNCTION(dba_handlers)
13011301
/* {{{ List opened databases */
13021302
PHP_FUNCTION(dba_list)
13031303
{
1304-
if (zend_parse_parameters_none() == FAILURE) {
1305-
RETURN_THROWS();
1306-
}
1304+
ZEND_PARSE_PARAMETERS_NONE();
13071305

13081306
array_init(return_value);
13091307

ext/dom/document.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,7 @@ PHP_METHOD(DOMDocument, createDocumentFragment)
502502
dom_object *intern;
503503

504504
id = ZEND_THIS;
505-
if (zend_parse_parameters_none() == FAILURE) {
506-
RETURN_THROWS();
507-
}
505+
ZEND_PARSE_PARAMETERS_NONE();
508506

509507
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
510508

@@ -1251,9 +1249,7 @@ PHP_METHOD(DOMDocument, normalizeDocument)
12511249
dom_object *intern;
12521250

12531251
id = ZEND_THIS;
1254-
if (zend_parse_parameters_none() == FAILURE) {
1255-
RETURN_THROWS();
1256-
}
1252+
ZEND_PARSE_PARAMETERS_NONE();
12571253

12581254
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
12591255

@@ -1818,9 +1814,7 @@ PHP_METHOD(DOMDocument, validate)
18181814
xmlValidCtxt *cvp;
18191815

18201816
id = ZEND_THIS;
1821-
if (zend_parse_parameters_none() == FAILURE) {
1822-
RETURN_THROWS();
1823-
}
1817+
ZEND_PARSE_PARAMETERS_NONE();
18241818

18251819
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
18261820

ext/dom/documentfragment.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ PHP_METHOD(DOMDocumentFragment, __construct)
3636
xmlNodePtr nodep = NULL, oldnode = NULL;
3737
dom_object *intern;
3838

39-
if (zend_parse_parameters_none() == FAILURE) {
40-
RETURN_THROWS();
41-
}
39+
ZEND_PARSE_PARAMETERS_NONE();
4240

4341
nodep = xmlNewDocFragment(NULL);
4442

ext/dom/element.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,9 +1477,7 @@ PHP_METHOD(DOMElement, remove)
14771477
{
14781478
dom_object *intern;
14791479

1480-
if (zend_parse_parameters_none() == FAILURE) {
1481-
RETURN_THROWS();
1482-
}
1480+
ZEND_PARSE_PARAMETERS_NONE();
14831481

14841482
DOM_GET_THIS_INTERN(intern);
14851483

ext/enchant/enchant.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ PHP_FUNCTION(enchant_broker_init)
264264
enchant_broker *broker;
265265
EnchantBroker *pbroker;
266266

267-
if (zend_parse_parameters_none() == FAILURE) {
268-
RETURN_THROWS();
269-
}
267+
ZEND_PARSE_PARAMETERS_NONE();
270268

271269
pbroker = enchant_broker_init();
272270
if (pbroker) {

ext/filter/filter.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,7 @@ PHP_FUNCTION(filter_list)
825825
{
826826
int size = sizeof(filter_list) / sizeof(filter_list_entry);
827827

828-
if (zend_parse_parameters_none() == FAILURE) {
829-
RETURN_THROWS();
830-
}
828+
ZEND_PARSE_PARAMETERS_NONE();
831829

832830
array_init(return_value);
833831
for (int i = 0; i < size; ++i) {

ext/hash/hash.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,7 @@ PHP_FUNCTION(hash_algos)
858858
{
859859
zend_string *str;
860860

861-
if (zend_parse_parameters_none() == FAILURE) {
862-
RETURN_THROWS();
863-
}
861+
ZEND_PARSE_PARAMETERS_NONE();
864862

865863
array_init(return_value);
866864
ZEND_HASH_MAP_FOREACH_STR_KEY(&php_hash_hashtable, str) {
@@ -875,9 +873,7 @@ PHP_FUNCTION(hash_hmac_algos)
875873
zend_string *str;
876874
const php_hash_ops *ops;
877875

878-
if (zend_parse_parameters_none() == FAILURE) {
879-
RETURN_THROWS();
880-
}
876+
ZEND_PARSE_PARAMETERS_NONE();
881877

882878
array_init(return_value);
883879
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&php_hash_hashtable, str, ops) {
@@ -1260,9 +1256,7 @@ PHP_FUNCTION(mhash_get_hash_name)
12601256
/* {{{ Gets the number of available hashes */
12611257
PHP_FUNCTION(mhash_count)
12621258
{
1263-
if (zend_parse_parameters_none() == FAILURE) {
1264-
RETURN_THROWS();
1265-
}
1259+
ZEND_PARSE_PARAMETERS_NONE();
12661260
RETURN_LONG(MHASH_NUM_ALGOS - 1);
12671261
}
12681262
/* }}} */
@@ -1463,9 +1457,7 @@ PHP_METHOD(HashContext, __serialize)
14631457
zend_long magic = 0;
14641458
zval tmp;
14651459

1466-
if (zend_parse_parameters_none() == FAILURE) {
1467-
RETURN_THROWS();
1468-
}
1460+
ZEND_PARSE_PARAMETERS_NONE();
14691461

14701462
array_init(return_value);
14711463

ext/mbstring/php_mbregex.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,9 +1506,7 @@ PHP_FUNCTION(mb_ereg_search_getregs)
15061506
int beg, end;
15071507
OnigUChar *str;
15081508

1509-
if (zend_parse_parameters_none() == FAILURE) {
1510-
RETURN_THROWS();
1511-
}
1509+
ZEND_PARSE_PARAMETERS_NONE();
15121510

15131511
if (MBREX(search_regs) != NULL && Z_TYPE(MBREX(search_str)) == IS_STRING) {
15141512
array_init(return_value);
@@ -1544,9 +1542,7 @@ PHP_FUNCTION(mb_ereg_search_getregs)
15441542
/* {{{ Get search start position */
15451543
PHP_FUNCTION(mb_ereg_search_getpos)
15461544
{
1547-
if (zend_parse_parameters_none() == FAILURE) {
1548-
RETURN_THROWS();
1549-
}
1545+
ZEND_PARSE_PARAMETERS_NONE();
15501546

15511547
RETVAL_LONG(MBREX(search_pos));
15521548
}

0 commit comments

Comments
 (0)