diff options
| author | Hannes Magnusson <bjori@php.net> | 2006-11-03 15:48:39 +0000 |
|---|---|---|
| committer | Hannes Magnusson <bjori@php.net> | 2006-11-03 15:48:39 +0000 |
| commit | b11b08e9879c7f1d61e02c662db0bf7104ef49d0 (patch) | |
| tree | 062f1d13980d6f47d291a410d3cc0d72517a7e43 | |
| parent | 4deb09e72e7407900abf3be1a52694edc226d9e7 (diff) | |
| download | php-git-b11b08e9879c7f1d61e02c662db0bf7104ef49d0.tar.gz | |
MFH: fix parameter parsing in getrusage()
| -rw-r--r-- | README.UPDATE_5_2 | 8 | ||||
| -rw-r--r-- | ext/standard/microtime.c | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/README.UPDATE_5_2 b/README.UPDATE_5_2 index 78f69c816a..a9b84950a6 100644 --- a/README.UPDATE_5_2 +++ b/README.UPDATE_5_2 @@ -173,6 +173,14 @@ Items from the NEWS file explained you to fine-grain the levels of the messages stored. +============================== +Backwards incompatible changes +============================== + +In the PHP core +=============== +getrusage() will return NULL when passed incompatible arguments + ================== NEW ERROR MESSAGES ================== diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 36c9409688..60a5c5e1dc 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -115,7 +115,11 @@ PHP_FUNCTION(getrusage) long pwho = 0; int who = RUSAGE_SELF; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) == FAILURE) { + return; + } + + if (pwho == 1) { who = RUSAGE_CHILDREN; } |
