3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait first_trait { function first_function() { echo "From First Trait\n"; } } trait second_trait { use first_trait { first_trait::first_function as second_function; } function first_function() { echo "From Second Trait\n"; } } class first_class { use second_trait; } $obj = new first_class(); $obj->first_function(); $obj->second_function();
Output for git.master, git.master_jit, rfc.property-hooks
From Second Trait From First Trait

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