3v4l.org

run code in 300+ PHP versions simultaneously
<?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) ;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.21, 7.4.0 - 7.4.9, 8.0.0alpha1 - beta1
0x2 0x3