3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fp = fopen('/tmp/test.txt', 'a+'); fwrite($fp, 'foo'); echo ftell($fp) ."\n"; fseek($fp, 0); echo ftell($fp) ."\n"; fwrite($fp, 'bar'); echo ftell($fp) ."\n"; echo fread($fp, 3) ."\n"; fseek($fp, 0); echo fread($fp, 6) ."\n";
based on mvTmZ
Output for 5.3.20 - 5.5.24, 5.6.11, 5.6.28, 7.0.20 - 7.2.0
3 0 3 foobar
Output for 5.5.25 - 5.6.10, 5.6.12 - 5.6.21, 7.0.0 - 7.0.6
3 0 3 woohoo