3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class strtoupper_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = strtoupper($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } define('FD', fopen('/dev/null','rw')); stream_filter_append(FD, "strtoupper_filter");
Output for 5.1.5 - 5.6.28, 7.0.0 - 7.1.0
Warning: stream_filter_append(): unable to locate filter "strtoupper_filter" in /in/0SvoK on line 16
Output for hhvm-3.12.0
Warning: Constants may only evaluate to scalar values in /in/0SvoK on line 15 Notice: Use of undefined constant FD - assumed 'FD' in /in/0SvoK on line 16 Warning: stream_filter_append() expects parameter 1 to be resource, string given in /in/0SvoK on line 16
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.1.4
Warning: stream_filter_append(): unable to create or locate filter "strtoupper_filter" in /in/0SvoK on line 16
Output for 4.3.2 - 4.4.9
Fatal error: Class strtoupper_filter: Cannot inherit from undefined class php_user_filter in /in/0SvoK on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class strtoupper_filter: Cannot inherit from undefined class php_user_filter in /in/0SvoK on line 3