3v4l.org

run code in 300+ PHP versions simultaneously
<?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; } } stream_filter_register("strtoupper", "strtoupper_filter") or die("Failed to register filter"); define('FD', fopen('/dev/null','rw')); stream_filter_append(FD, "strtoupper");

preferences:
25.9 ms | 410 KiB | 5 Q