File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ PHP_MSHUTDOWN_FUNCTION(file) /* {{{ */
184184static inline bool php_is_valid_flock_flag (zend_long s ) {
185185 const zend_long sb = s & ~PHP_LOCK_NB ;
186186 return (sb == PHP_LOCK_UN || sb == PHP_LOCK_SH ||
187- sb == PHP_LOCK_EX || s == -1 );
187+ sb == PHP_LOCK_EX );
188188}
189189
190190PHPAPI void php_flock_common (php_stream * stream , zend_long operation ,
Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ var_dump($would);
3131var_dump (flock ($ fp , LOCK_UN , $ would ));
3232var_dump ($ would );
3333
34- var_dump (flock ($ fp , -1 ));
34+ try {
35+ var_dump (flock ($ fp , -1 ));
36+ } catch (\ValueError $ e ) {
37+ echo $ e ->getMessage () . \PHP_EOL ;
38+ }
3539
3640try {
3741 var_dump (flock ($ fp , 0 ));
@@ -59,5 +63,5 @@ bool(true)
5963int(0)
6064bool(true)
6165int(0)
62- bool(true)
66+ flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
6367flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN
You can’t perform that action at this time.
0 commit comments