Skip to content

Commit f639125

Browse files
committed
Fix review comments
1 parent e4b7108 commit f639125

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ext/spl/spl_directory.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,10 +2053,9 @@ PHP_METHOD(SplFileObject, __construct)
20532053
RETURN_THROWS();
20542054
}
20552055

2056-
// TODO This should probably take a copy:
2057-
// intern->file_name = zend_string_copy(file_name);
2058-
intern->file_name = file_name;
20592056
intern->u.file.open_mode = zend_string_copy(open_mode);
2057+
/* file_name and zcontext are copied by spl_filesystem_file_open() */
2058+
intern->file_name = file_name;
20602059
intern->u.file.zcontext = stream_context;
20612060

20622061
/* spl_filesystem_file_open() can generate E_WARNINGs which we want to promote to exceptions */
@@ -2098,7 +2097,7 @@ PHP_METHOD(SplTempFileObject, __construct)
20982097

20992098
/* Prevent reinitialization of Object */
21002099
if (intern->u.file.stream) {
2101-
zend_throw_error(NULL, "cannot call constructor twice");
2100+
zend_throw_error(NULL, "Cannot call constructor twice");
21022101
RETURN_THROWS();
21032102
}
21042103

ext/spl/tests/gh16477-2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ $obj->__debugInfo();
1515
?>
1616
DONE
1717
--EXPECT--
18-
Error: cannot call constructor twice
18+
Error: Cannot call constructor twice
1919
DONE

0 commit comments

Comments
 (0)