Index: sapi/cli/php_cli.c =================================================================== --- sapi/cli/php_cli.c (revision 312931) +++ sapi/cli/php_cli.c (working copy) @@ -128,7 +128,11 @@ "max_execution_time=0\n" "max_input_time=-1\n\0"; +const char STRICT_INI[] = + "display_errors=1\n" + "error_reporting=-1\n\0"; + const opt_struct OPTIONS[] = { {'a', 0, "interactive"}, {'B', 1, "process-begin"}, @@ -153,6 +157,7 @@ {'S', 1, "server"}, {'t', 1, "docroot"}, {'w', 0, "strip"}, + {'W', 0, "strict"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, {'z', 1, "zend-extension"}, @@ -526,6 +531,7 @@ " -s Output HTML syntax highlighted source.\n" " -v Version number\n" " -w Output source with stripped comments and whitespace.\n" + " -W Enable all error reporting levels.\n" " -z Load Zend extension .\n" "\n" " args... Arguments passed to script. Use -- args when first argument\n" @@ -1288,6 +1294,12 @@ } break; } + case 'W': + ini_entries = realloc(ini_entries, ini_entries_len + sizeof(STRICT_INI)); + memcpy(ini_entries + ini_entries_len, STRICT_INI, sizeof(STRICT_INI)); + ini_entries_len += sizeof(STRICT_INI); + + break; #ifndef PHP_CLI_WIN32_NO_CONSOLE case 'S': sapi_module = &cli_server_sapi_module; Index: sapi/cli/tests/023.phpt =================================================================== --- sapi/cli/tests/023.phpt (revision 0) +++ sapi/cli/tests/023.phpt (revision 0) @@ -0,0 +1,20 @@ +--TEST-- +-W option +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(1) "1" +string(2) "-1" +Done