3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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
Deprecated: Creation of dynamic property TestFilterClass::$filtername is deprecated in /in/EWeCr on line 25 Deprecated: Creation of dynamic property TestFilterClass::$params is deprecated in /in/EWeCr on line 25 [TestFilterClass::filter] hello world hello world

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:
42.94 ms | 402 KiB | 8 Q