1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/spl/tests/SplFileObject_fflush_basic_001.phpt
Nikita Popov 902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00

40 lines
748 B
PHP

--TEST--
SplFileObject::fflush function - basic test
--FILE--
<?php
/*
* test a successful flush
*/
$obj = New SplFileObject(__DIR__.'/SplFileObject_testinput.csv');
var_dump($obj->fflush());
/*
* test a unsuccessful flush
*/
//create a basic stream class
class VariableStream {
public $position;
public $varname;
public $context;
function stream_open($path, $mode, $options, &$opened_path)
{
return true;
}
function url_stat() {
}
}
stream_wrapper_register("SPLtest", "VariableStream");
$ftruncate_test = "";
//end creating stream
//open an SplFileObject using the above test stream
$obj = New SplFileObject("SPLtest://ftruncate_test");
var_dump($obj->fflush());
?>
--EXPECT--
bool(true)
bool(false)