andrei Mon Oct 9 20:17:13 2006 UTC
Modified files:
/php-src/ext/standard basic_functions.c
Log:
print_r(), error_log() and sys_getloadavg() are Unicode-safe.
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.812&r2=1.813&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.812
php-src/ext/standard/basic_functions.c:1.813
--- php-src/ext/standard/basic_functions.c:1.812 Mon Oct 9 19:48:32 2006
+++ php-src/ext/standard/basic_functions.c Mon Oct 9 20:17:12 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.812 2006/10/09 19:48:32 andrei Exp $ */
+/* $Id: basic_functions.c,v 1.813 2006/10/09 20:17:12 andrei Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -4984,13 +4984,14 @@
return SG(request_info).current_user;
}
-/* {{{ proto array error_get_last()
+/* {{{ proto array error_get_last() U
Get the last occurred error as associative array. Returns NULL if there
hasn't been an error yet. */
PHP_FUNCTION(error_get_last)
{
- if (ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ return;
}
+
if (PG(last_error_message)) {
array_init(return_value);
add_ascii_assoc_long_ex(return_value, "type", sizeof("type"),
PG(last_error_type));
@@ -5726,24 +5727,24 @@
/* }}} */
-/* {{{ proto mixed print_r(mixed var [, bool return])
+/* {{{ proto mixed print_r(mixed var [, bool return]) U
Prints out or returns information about the specified variable */
PHP_FUNCTION(print_r)
{
zval *var;
- zend_bool i = 0;
+ zend_bool do_return = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &i)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var,
&do_returni) == FAILURE) {
RETURN_FALSE;
}
- if (i) {
+ if (do_returni) {
php_output_start_default(TSRMLS_C);
}
zend_print_zval_r(var, 0 TSRMLS_CC);
- if (i) {
+ if (do_returni) {
php_output_get_contents(return_value TSRMLS_CC);
php_output_discard(TSRMLS_C);
} else {
@@ -6288,7 +6289,7 @@
/* }}} */
#ifdef HAVE_GETLOADAVG
-/* {{{ proto array sys_getloadavg()
+/* {{{ proto array sys_getloadavg() U
*/
PHP_FUNCTION(sys_getloadavg)
{
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php