- error_reporting: documentation ( source)
- htmlspecialchars: documentation ( source)
<?php
error_reporting(0);
$File = new SplFileObject(__FILE__);
echo 'SplFileObject::__toString(): ', (string) htmlspecialchars($File), PHP_EOL;
echo 'SplFileInfo::__toString(): ', (string) htmlspecialchars($File->getFileInfo()), PHP_EOL;
echo PHP_EOL;
echo "Now let's loop through the file:", PHP_EOL, PHP_EOL;
foreach ($File as $line)
{
echo htmlspecialchars($line), PHP_EOL;
}