diff options
| -rw-r--r-- | ext/standard/string.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 17ebd14f84..e232d5c1eb 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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); } /* }}} */ |
