1--TEST-- 2SplFileObject::fflush function - basic test 3--FILE-- 4<?php 5/* 6 * test a successful flush 7*/ 8$obj = New SplFileObject(__DIR__.'/SplFileObject_testinput.csv'); 9var_dump($obj->fflush()); 10 11/* 12 * test a unsuccessful flush 13*/ 14//create a basic stream class 15class VariableStream { 16 var $position; 17 var $varname; 18 19 function stream_open($path, $mode, $options, &$opened_path) 20 { 21 return true; 22 } 23 24 function url_stat() { 25 } 26} 27stream_wrapper_register("SPLtest", "VariableStream"); 28$ftruncate_test = ""; 29//end creating stream 30 31//open an SplFileObject using the above test stream 32$obj = New SplFileObject("SPLtest://ftruncate_test"); 33var_dump($obj->fflush()); 34 35?> 36--EXPECT-- 37bool(true) 38bool(false) 39