3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T{ private function random_method(){ echo "random method \n"; } } class A { use T; public function public_method(){ echo "public method\n"; } protected function protected_method(){ echo "protected method\n"; } private function private_method(){ echo "private method\n"; } } class B extends A{ public function random_method(){ echo "random method 2\n"; } public function protected_method(){ echo "protected method 2\n"; } public function private_method(){ echo "private method 2\n"; } public function public_method(){ echo "public method 2\n"; } } $b = new B; $b->protected_method(); $b->private_method(); $b->public_method(); $b->random_method();
Output for git.master, git.master_jit, rfc.property-hooks
protected method 2 private method 2 public method 2 random method 2

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.86 ms | 401 KiB | 8 Q