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($data, 0, 20)); }
based on 2IaA8
Output for 7.0.0 - 7.2.0
Warning: fputs() expects parameter 1 to be resource, null given in /in/RtJrZ on line 2 Notice: Undefined variable: data in /in/RtJrZ on line 4 Fatal error: Uncaught RuntimeException: Unable to write data: in /in/RtJrZ:4 Stack trace: #0 {main} thrown in /in/RtJrZ 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/RtJrZ on line 2 Notice: Undefined variable: data in /in/RtJrZ on line 4 Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to write data: ' in /in/RtJrZ:4 Stack trace: #0 {main} thrown in /in/RtJrZ on line 4
Process exited with code 255.