summaryrefslogtreecommitdiff
path: root/ext/standard/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r--ext/standard/exec.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index da8b5712cf..86a97e5e55 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -217,7 +215,7 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
Z_PARAM_ZVAL(ret_array)
}
Z_PARAM_ZVAL(ret_code)
- ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
+ ZEND_PARSE_PARAMETERS_END();
if (!cmd_len) {
php_error_docref(NULL, E_WARNING, "Cannot execute a blank command");
@@ -249,7 +247,7 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
}
/* }}} */
-/* {{{ proto string exec(string command [, array &output [, int &return_value]])
+/* {{{ proto string|false exec(string command [, array &output [, int &return_value]])
Execute an external program */
PHP_FUNCTION(exec)
{
@@ -257,7 +255,7 @@ PHP_FUNCTION(exec)
}
/* }}} */
-/* {{{ proto int system(string command [, int &return_value])
+/* {{{ proto int|false system(string command [, int &return_value])
Execute an external program and display output */
PHP_FUNCTION(system)
{
@@ -265,7 +263,7 @@ PHP_FUNCTION(system)
}
/* }}} */
-/* {{{ proto void passthru(string command [, int &return_value])
+/* {{{ proto bool passthru(string command [, int &return_value])
Execute an external program and display raw output */
PHP_FUNCTION(passthru)
{
@@ -485,7 +483,7 @@ PHP_FUNCTION(escapeshellcmd)
if (command_len) {
if (command_len != strlen(command)) {
- php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
+ zend_type_error("Input string contains NULL bytes");
return;
}
RETVAL_STR(php_escape_shell_cmd(command));
@@ -506,17 +504,16 @@ PHP_FUNCTION(escapeshellarg)
Z_PARAM_STRING(argument, argument_len)
ZEND_PARSE_PARAMETERS_END();
- if (argument) {
- if (argument_len != strlen(argument)) {
- php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
- return;
- }
- RETVAL_STR(php_escape_shell_arg(argument));
+ if (argument_len != strlen(argument)) {
+ zend_type_error("Input string contains NULL bytes");
+ return;
}
+
+ RETVAL_STR(php_escape_shell_arg(argument));
}
/* }}} */
-/* {{{ proto string shell_exec(string cmd)
+/* {{{ proto string|false shell_exec(string cmd)
Execute command via shell and return complete output as string */
PHP_FUNCTION(shell_exec)
{