|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-26 04:20 UTC] lbarnaud@php.net
[2014-08-16 15:38 UTC] shabazzk at gmail dot com
[2017-08-28 08:16 UTC] adolph dot bauer2 at gmail dot com
[2017-08-28 08:23 UTC] requinix@php.net
-Assigned To:
+Assigned To: requinix
[2017-08-28 08:23 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Description: ------------ When i regist my own stream class, and use flock($h, LOCK_UN). then steam_lock caled with undefined mode(0x8). php-5.2.6/ext/standard/file.c ---- 321 static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN }; snip... 348 act = flock_values[act - 1] | (operation & 4 ? LOCK_NB : 0); 349 if (php_stream_lock(stream, act)) { Reproduce code: --------------- <?php class StreamTest { function stream_open($path, $mode, $options, &$opened_path) { return true; } function stream_close() { return ; } function stream_lock($mode) { printf( "0x%x\n", $mode ) ; return ; } } stream_register_wrapper("streamtest", "StreamTest"); $handle = fopen( 'streamtest://test', "r" ) ; flock( $handle, LOCK_EX ) ; flock( $handle, LOCK_UN ) ; fclose($handle) ; Expected result: ---------------- 0x2 0x3 Actual result: -------------- 0x2 0x8