3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $result = fputs(null, 'test'); if ($result === FALSE) { throw new \RuntimeException('Unable to write data: ' . substr('test', 0, 20)); }
based on RtJrZ
Output for 7.0.0 - 7.2.0
Warning: fputs() expects parameter 1 to be resource, null given in /in/hFZIn on line 2 Fatal error: Uncaught RuntimeException: Unable to write data: test in /in/hFZIn:4 Stack trace: #0 {main} thrown in /in/hFZIn on line 4
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Warning: fputs() expects parameter 1 to be resource, null given in /in/hFZIn on line 2 Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to write data: test' in /in/hFZIn:4 Stack trace: #0 {main} thrown in /in/hFZIn on line 4
Process exited with code 255.