diff options
author | Felipe Pena <felipe@php.net> | 2008-07-23 19:34:35 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-07-23 19:34:35 +0000 |
commit | 0bbed66ede05909f3f12c202f75780054638cd03 (patch) | |
tree | 7d2f2998644237ea8d044c640ca258e8f76ad31b /ext/standard/assert.c | |
parent | 11f9cd84f7a499257fbb9c67e64748076301eb52 (diff) | |
download | php-git-0bbed66ede05909f3f12c202f75780054638cd03.tar.gz |
- MFH: New parameter parsing API
Diffstat (limited to 'ext/standard/assert.c')
-rw-r--r-- | ext/standard/assert.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/standard/assert.c b/ext/standard/assert.c index cc6dd80848..91eacb94a9 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -148,8 +148,8 @@ PHP_FUNCTION(assert) RETURN_TRUE; } - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &assertion) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &assertion) == FAILURE) { + return; } if (Z_TYPE_PP(assertion) == IS_STRING) { @@ -239,17 +239,16 @@ PHP_FUNCTION(assert) Set/get the various assert flags */ PHP_FUNCTION(assert_options) { - zval **what, **value; + zval **value; + long what; int oldint; int ac = ZEND_NUM_ARGS(); - if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &what, &value) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ac TSRMLS_CC, "l|Z", &what, &value) == FAILURE) { + return; } - convert_to_long_ex(what); - - switch (Z_LVAL_PP(what)) { + switch (what) { case ASSERT_ACTIVE: oldint = ASSERTG(active); if (ac == 2) { @@ -305,7 +304,7 @@ PHP_FUNCTION(assert_options) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %ld", Z_LVAL_PP(what)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %ld", what); break; } |