@@ -46,19 +46,19 @@ static void _breakiter_factory(const char *func_name,
4646 INTERNAL_FUNCTION_PARAMETERS)
4747{
4848 BreakIterator *biter;
49- const char *locale_str = NULL ;
49+ char *locale_str = NULL ;
5050 size_t dummy;
5151 char *msg;
5252 UErrorCode status = UErrorCode ();
5353 intl_error_reset (NULL );
5454
55- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), " |s! " ,
56- &locale_str, &dummy) == FAILURE) {
57- RETURN_THROWS ();
58- }
55+ ZEND_PARSE_PARAMETERS_START ( 0 , 1 )
56+ Z_PARAM_OPTIONAL
57+ Z_PARAM_STRING_OR_NULL (locale_str, dummy)
58+ ZEND_PARSE_PARAMETERS_END ();
5959
6060 if (locale_str == NULL ) {
61- locale_str = intl_locale_get_default ();
61+ locale_str = ( char *) intl_locale_get_default ();
6262 }
6363
6464 biter = func (Locale::createFromName (locale_str), status);
@@ -113,9 +113,7 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, createCodePointInstance)
113113{
114114 intl_error_reset (NULL );
115115
116- if (zend_parse_parameters_none () == FAILURE) {
117- RETURN_THROWS ();
118- }
116+ ZEND_PARSE_PARAMETERS_NONE ();
119117
120118 CodePointBreakIterator *cpbi = new CodePointBreakIterator ();
121119 breakiterator_object_create (return_value, cpbi, 1 );
@@ -126,9 +124,7 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, getText)
126124 BREAKITER_METHOD_INIT_VARS;
127125 object = ZEND_THIS;
128126
129- if (zend_parse_parameters_none () == FAILURE) {
130- RETURN_THROWS ();
131- }
127+ ZEND_PARSE_PARAMETERS_NONE ();
132128
133129 BREAKITER_METHOD_FETCH_OBJECT;
134130
@@ -146,9 +142,9 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, setText)
146142 BREAKITER_METHOD_INIT_VARS;
147143 object = ZEND_THIS;
148144
149- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), " S " , &text) == FAILURE) {
150- RETURN_THROWS ();
151- }
145+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
146+ Z_PARAM_STR (text)
147+ ZEND_PARSE_PARAMETERS_END ();
152148
153149 BREAKITER_METHOD_FETCH_OBJECT;
154150
@@ -176,9 +172,7 @@ static void _breakiter_no_args_ret_int32(
176172 BREAKITER_METHOD_INIT_VARS;
177173 object = ZEND_THIS;
178174
179- if (zend_parse_parameters_none () == FAILURE) {
180- RETURN_THROWS ();
181- }
175+ ZEND_PARSE_PARAMETERS_NONE ();
182176
183177 BREAKITER_METHOD_FETCH_OBJECT;
184178
@@ -195,9 +189,9 @@ static void _breakiter_int32_ret_int32(
195189 BREAKITER_METHOD_INIT_VARS;
196190 object = ZEND_THIS;
197191
198- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), " l " , &arg) == FAILURE) {
199- RETURN_THROWS ();
200- }
192+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
193+ Z_PARAM_LONG (arg)
194+ ZEND_PARSE_PARAMETERS_END ();
201195
202196 BREAKITER_METHOD_FETCH_OBJECT;
203197
@@ -233,16 +227,13 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, next)
233227{
234228 zval *arg = NULL ;
235229
236- if (ZEND_NUM_ARGS () == 0 ) {
237- goto no_arg_version;
238- }
239- if (zend_parse_parameters (ZEND_NUM_ARGS (), " z!" , &arg) == FAILURE) {
240- RETURN_THROWS ();
241- }
230+ ZEND_PARSE_PARAMETERS_START (0 , 1 )
231+ Z_PARAM_OPTIONAL
232+ Z_PARAM_ZVAL_OR_NULL (arg)
233+ ZEND_PARSE_PARAMETERS_END ();
242234
243235 if (arg == NULL ) {
244- ZEND_NUM_ARGS () = 0 ; /* pretend we don't have any argument */
245- no_arg_version:
236+ ZEND_NUM_ARGS () = 0 ;
246237 _breakiter_no_args_ret_int32 (&BreakIterator::next,
247238 INTERNAL_FUNCTION_PARAM_PASSTHRU);
248239 } else {
@@ -256,9 +247,7 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, current)
256247 BREAKITER_METHOD_INIT_VARS;
257248 object = ZEND_THIS;
258249
259- if (zend_parse_parameters_none () == FAILURE) {
260- RETURN_THROWS ();
261- }
250+ ZEND_PARSE_PARAMETERS_NONE ();
262251
263252 BREAKITER_METHOD_FETCH_OBJECT;
264253
@@ -287,10 +276,9 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, isBoundary)
287276 BREAKITER_METHOD_INIT_VARS;
288277 object = ZEND_THIS;
289278
290- if (zend_parse_parameters (ZEND_NUM_ARGS (), " l" ,
291- &offset) == FAILURE) {
292- RETURN_THROWS ();
293- }
279+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
280+ Z_PARAM_LONG (offset)
281+ ZEND_PARSE_PARAMETERS_END ();
294282
295283 if (UNEXPECTED (offset < INT32_MIN || offset > INT32_MAX)) {
296284 zend_argument_value_error (1 , " must be between %d and %d" , INT32_MIN, INT32_MAX);
@@ -310,9 +298,9 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, getLocale)
310298 BREAKITER_METHOD_INIT_VARS;
311299 object = ZEND_THIS;
312300
313- if ( zend_parse_parameters ( ZEND_NUM_ARGS (), " l " , &locale_type) == FAILURE) {
314- RETURN_THROWS ();
315- }
301+ ZEND_PARSE_PARAMETERS_START ( 1 , 1 )
302+ Z_PARAM_LONG (locale_type)
303+ ZEND_PARSE_PARAMETERS_END ();
316304
317305 /* Change to ValueError? */
318306 if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) {
@@ -337,9 +325,10 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, getPartsIterator)
337325 BREAKITER_METHOD_INIT_VARS;
338326 object = ZEND_THIS;
339327
340- if (zend_parse_parameters (ZEND_NUM_ARGS (), " |l" , &key_type) == FAILURE) {
341- RETURN_THROWS ();
342- }
328+ ZEND_PARSE_PARAMETERS_START (0 , 1 )
329+ Z_PARAM_OPTIONAL
330+ Z_PARAM_LONG (key_type)
331+ ZEND_PARSE_PARAMETERS_END ();
343332
344333 if (key_type != PARTS_ITERATOR_KEY_SEQUENTIAL
345334 && key_type != PARTS_ITERATOR_KEY_LEFT
@@ -360,9 +349,7 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, getErrorCode)
360349 BREAKITER_METHOD_INIT_VARS;
361350 object = ZEND_THIS;
362351
363- if (zend_parse_parameters_none () == FAILURE) {
364- RETURN_THROWS ();
365- }
352+ ZEND_PARSE_PARAMETERS_NONE ();
366353
367354 /* Fetch the object (without resetting its last error code ). */
368355 bio = Z_INTL_BREAKITERATOR_P (object);
@@ -375,10 +362,7 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, getErrorMessage)
375362 BREAKITER_METHOD_INIT_VARS;
376363 object = ZEND_THIS;
377364
378- if (zend_parse_parameters_none () == FAILURE) {
379- RETURN_THROWS ();
380- }
381-
365+ ZEND_PARSE_PARAMETERS_NONE ();
382366
383367 /* Fetch the object (without resetting its last error code ). */
384368 bio = Z_INTL_BREAKITERATOR_P (object);
@@ -390,9 +374,7 @@ U_CFUNC PHP_METHOD(IntlBreakIterator, getErrorMessage)
390374
391375U_CFUNC PHP_METHOD (IntlBreakIterator, getIterator)
392376{
393- if (zend_parse_parameters_none () == FAILURE) {
394- return ;
395- }
377+ ZEND_PARSE_PARAMETERS_NONE ();
396378
397379 zend_create_internal_iterator_zval (return_value, ZEND_THIS);
398380}
0 commit comments