3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait PersonPL{ public function sayHello($name){ echo 'Witaj, nazywam się '.$name; } public function whereFrom($country){ echo 'Jestem z '.$country; } } trait PersonENG{ public function sayHello($name){ echo 'Hi, my name is '.$name; } public function whereFrom($country){ echo 'I am form '.$country; } } class TestA{ use PersonPL, PersonENG{ PersonPL::sayHello insteadof PersonENG; PersonPL::whereFrom insteadof PersonENG; PersonENG::sayHello as sayHelloENG; PersonENG::whereFrom as whereFromENG; } } $objectA = new TestA(); $objectA->sayHello("Anna"); $objectA->whereFrom("Polski"); $objectA->sayHelloENG("Anna"); $objectA->whereFromENG("Poland");
Output for rfc.property-hooks, git.master, git.master_jit
Witaj, nazywam się AnnaJestem z PolskiHi, my name is AnnaI am form Poland

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:
38.47 ms | 1505 KiB | 4 Q