Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- SplFileObject::fwrite function - writing with two parameters, length > input stri..

Decoded Output download

--TEST--
SplFileObject::fwrite function - writing with two parameters, length > input string length
--FILE--
<?php
$file = __DIR__.'/SplFileObject_fwrite_variation_002.txt';
if(file_exists($file)) {
    unlink($file);
}
$obj = New SplFileObject($file,'w');
$obj->fwrite('test_write',12);
var_dump(file_get_contents($file));
?>
--CLEAN--
<?php
$file = __DIR__.'/SplFileObject_fwrite_variation_002.txt';
if(file_exists($file)) {
	unlink($file);
}
?>
--EXPECT--
string(10) "test_write"

Did this file decode correctly?

Original Code

--TEST--
SplFileObject::fwrite function - writing with two parameters, length > input string length
--FILE--
<?php
$file = __DIR__.'/SplFileObject_fwrite_variation_002.txt';
if(file_exists($file)) {
    unlink($file);
}
$obj = New SplFileObject($file,'w');
$obj->fwrite('test_write',12);
var_dump(file_get_contents($file));
?>
--CLEAN--
<?php
$file = __DIR__.'/SplFileObject_fwrite_variation_002.txt';
if(file_exists($file)) {
	unlink($file);
}
?>
--EXPECT--
string(10) "test_write"

Function Calls

None

Variables

None

Stats

MD5 d127d3fb9e319bffebee232f07245b32
Eval Count 0
Decode Time 91 ms