diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-06-06 12:50:57 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-06-06 12:50:57 +0000 |
commit | 44518f05f892db7cfe3b85a6a039853656a4fee1 (patch) | |
tree | 84ed4cf5e977da8fe96da9351ae7b0b3d291e039 /ext | |
parent | d1602669bcbc2eb96851429ac3008ea6b3b0163b (diff) | |
download | php-git-44518f05f892db7cfe3b85a6a039853656a4fee1.tar.gz |
MFH: Fixed strval to not print notices on strval(array()).
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/type.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/standard/type.c b/ext/standard/type.c index f09ca87730..240f781710 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -180,14 +180,24 @@ PHP_FUNCTION(floatval) PHP_FUNCTION(strval) { pval **num; + zval expr_copy; + int use_copy; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { WRONG_PARAM_COUNT; } *return_value = **num; - zval_copy_ctor(return_value); - convert_to_string(return_value); + + zend_make_printable_zval(return_value, &expr_copy, &use_copy); + if (use_copy) { + *return_value = expr_copy; + INIT_PZVAL(return_value); + zval_copy_ctor(return_value); + zval_dtor(&expr_copy); + } else { + zval_copy_ctor(return_value); + } } /* }}} */ |