3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "ryat\0hi"; var_dump($str); $str = addslashes($str); var_dump($str); file_put_contents('/tmp/ryat', $str); var_dump(file_get_contents('/tmp/ryat'));
Output for 5.0.0 - 5.5.24, 5.5.30 - 5.5.34, 5.6.14 - 5.6.20, 5.6.28, hhvm-3.12.0, 7.0.0 - 7.0.3, 7.0.14 - 7.1.0
string(7) "ryathi" string(8) "ryat\0hi" string(8) "ryat\0hi"
Output for 5.5.25 - 5.5.29, 5.5.35 - 5.6.13, 5.6.21, 7.0.4 - 7.0.6
string(7) "ryathi" string(8) "ryat\0hi" Warning: file_put_contents(/tmp/ryat): failed to open stream: Is a directory in /in/J5QLs on line 7 string(0) ""
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.5 - 4.4.9
string(7) "ryathi" string(8) "ryat\0hi" Fatal error: Call to undefined function: file_put_contents() in /in/J5QLs on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.8, 4.3.10 - 4.4.4
string(7) "ryathi" string(8) "ryat\0hi" Fatal error: Call to undefined function: file_put_contents() in /in/J5QLs on line 7
Process exited with code 255.
Output for 4.3.9
string(7) "ryathi" string(8) "ryat\hi" Fatal error: Call to undefined function: file_put_contents() in /in/J5QLs on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(7) "ryathi" string(8) "ryat\0hi" Fatal error: Call to undefined function: file_put_contents() in /in/J5QLs on line 7