Skip to content

Instantly share code, notes, and snippets.

@jaytaph jaytaph/test.php
Created Jun 1, 2014

Embed
What would you like to do?
<?php
$f = fopen("data.txt", "r");
fread($f, 10);
fread($f, 10);
// Run with: strace -e trace=read php test2.
/*
read(3, "<?php\nclass File {\n \n private $"..., 8192) = 8192
*/
<?php
$f = fopen("data.txt", "r");
stream_set_chunk_size($f, 5);
fread($f, 10);
fread($f, 10);
// Run with: strace -e trace=read php test2.
/*
read(3, "<?php", 5) = 5
read(3, "\nclas", 5) = 5
read(3, "s Fil", 5) = 5
read(3, "e {\n ", 5) = 5
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.