3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Defining __construct and filter makes filter a normal method class Filter { // PHP 4/5: E_STRICT "Redefining already defined constructor" // PHP 7: No error is raised // PHP 8: No error is raised function filter($a) { echo "In Filter::filter method\n"; } // This raises the E_STRICT in PHP 4/5 function __construct() { echo "In Filter constructor\n"; } } $f = new Filter(); $f->filter(3);
Output for git.master, git.master_jit, rfc.property-hooks
In Filter constructor In Filter::filter method

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:
56.32 ms | 401 KiB | 8 Q