]> granicus.if.org Git - php/commitdiff
use new param parsing API
authorIlia Alshanetsky <iliaa@php.net>
Tue, 22 Jan 2008 01:34:24 +0000 (01:34 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 22 Jan 2008 01:34:24 +0000 (01:34 +0000)
ext/standard/string.c

index 17ebd14f84707bb0803b126ab402d58f416fd1e9..e232d5c1eb94b3c7b8df029db971117a96c33db9 100644 (file)
@@ -2601,18 +2601,16 @@ PHP_FUNCTION(ord)
    Converts ASCII code to a character */
 PHP_FUNCTION(chr)
 {
-       zval **num;
+       long c;
        char temp[2];
-       
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
-               WRONG_PARAM_COUNT;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &c) == FAILURE) {
+               return;
        }
-       convert_to_long_ex(num);
-       
-       temp[0] = (char) Z_LVAL_PP(num);
-       temp[1] = 0;
+       temp[0] = (char)c;
+       temp[1] = '\0';
 
-       RETVAL_STRINGL(temp, 1, 1);
+       RETURN_STRINGL(temp, 1, 1);
 }
 /* }}} */