1. Go to this page and download the library: Download nette/safe-stream library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nette / safe-stream example snippets
$s = str_repeat('Long String', 10000);
$counter = 1000;
while ($counter--) {
file_put_contents('file', $s); // write it
$readed = file_get_contents('file'); // read it
if ($s !== $readed) { // check it
echo 'strings are different!';
}
}