* otherwise it will get opened and added to the included_files list in zend_execute_scripts
*/
if (primary_file->filename &&
- (primary_file->filename[0] != '-' || primary_file->filename[1] != 0) &&
+ strcmp("php://stdin", primary_file->filename) &&
primary_file->opened_path == NULL &&
primary_file->type != ZEND_HANDLE_FILENAME
) {
file_handle.filename = SG(request_info).path_translated;
file_handle.handle.fp = NULL;
} else {
- file_handle.filename = "-";
+ file_handle.filename = "php://stdin";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
}
--EXPECTF--
string(25) "No input file specified.
"
-string(31) "No syntax errors detected in -
+string(41) "No syntax errors detected in php://stdin
"
===DONE===
/* here but this would make things only more complicated. And it */
/* is consitent with the way -R works where the stdin file handle*/
/* is also accessible. */
- file_handle.filename = "-";
+ file_handle.filename = "php://stdin";
file_handle.handle.fp = stdin;
}
file_handle.type = ZEND_HANDLE_FP;
PG(during_request_startup) = 0;
switch (behavior) {
case PHP_MODE_STANDARD:
- if (strcmp(file_handle.filename, "-")) {
+ if (strcmp(file_handle.filename, "php://stdin")) {
cli_register_file_handles();
}
PHP %d.%d.%d%s(cli) (built: %s)%s
Array
(
- [0] => -
+ [0] => php://stdin
[1] => foo
[2] => bar
[3] => baz