3v4l.org

run code in 300+ PHP versions simultaneously
<?php fclose(STDIN); fclose(STDOUT); fclose(STDERR); $STDIN = fopen('/dev/null', 'r'); $STDOUT = fopen('php://output', 'wb'); $STDERR = fopen('/dev/null', 'wb'); class TestFilterClass { function filter($in, $out) { while (true) { $bucket = stream_bucket_make_writeable($in); if (is_object($bucket)) { $bucket->data = sprintf('[%s] %s', __METHOD__, $bucket->data); stream_bucket_append($out, $bucket); } break; } return PSFS_PASS_ON; } } if (stream_filter_register('TestFilter', 'TestFilterClass')) { $handle = stream_filter_append(STDOUT, 'TestFilter'); if (is_resource($handle)) { fwrite(STDOUT, 'hello world' . PHP_EOL); // ok echo 'hello world' . PHP_EOL; // nope stream_filter_remove($handle); } }
Output for git.master, git.master_jit, rfc.property-hooks

Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
72.86 ms | 401 KiB | 8 Q