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-- SPL: SplFileObject::setCsvControl error 002 --CREDITS-- Erwin Poeze <erwin.poeze ..
Decoded Output download
--TEST--
SPL: SplFileObject::setCsvControl error 002
--CREDITS--
Erwin Poeze <erwin.poeze at gmail.com>
--FILE--
<?php
file_put_contents('csv_control_data_error002.csv',
<<<CDATA
'groene appelen'|10
'gele bananen'|20
'rode kersen'|30
CDATA
);
$s = new SplFileObject('csv_control_data_error002.csv');
$s->setFlags(SplFileObject::READ_CSV);
try {
$s->setCsvControl('|', 'two');
} catch (ValueError $e) {
echo $e->getMessage(), "
";
}
?>
--CLEAN--
<?php
unlink('csv_control_data_error002.csv');
?>
--EXPECT--
SplFileObject::setCsvControl(): Argument #2 ($enclosure) must be a single character
Did this file decode correctly?
Original Code
--TEST--
SPL: SplFileObject::setCsvControl error 002
--CREDITS--
Erwin Poeze <erwin.poeze at gmail.com>
--FILE--
<?php
file_put_contents('csv_control_data_error002.csv',
<<<CDATA
'groene appelen'|10
'gele bananen'|20
'rode kersen'|30
CDATA
);
$s = new SplFileObject('csv_control_data_error002.csv');
$s->setFlags(SplFileObject::READ_CSV);
try {
$s->setCsvControl('|', 'two');
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php
unlink('csv_control_data_error002.csv');
?>
--EXPECT--
SplFileObject::setCsvControl(): Argument #2 ($enclosure) must be a single character
Function Calls
file_put_contents | 1 |
Stats
MD5 | a336d1fd8bf0aa39ca130be4c583d000 |
Eval Count | 0 |
Decode Time | 91 ms |