3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $private_bar = 'private'; protected $protected_bar = 'protected'; public $public_bar = 'public'; public static $static_bar = 'static'; private function private_echo() { echo $this->private_bar; } protected function protected_echo() { echo $this->protected_bar; } public function public_echo() { echo $this->public_bar; } // public static function static_echo() // { // echo $this->static_bar; // } } $myfoo = new foo(); // $myfoo->static_echo(); $myfoo->public_echo(); // $myfoo->protected_echo(); //$myfoo->private_bar = 'new private bar'; //$myfoo->private_echo(); $myfoo::static_echo(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
public Fatal error: Uncaught Error: Call to undefined method foo::static_echo() in /in/bAnWm:36 Stack trace: #0 {main} thrown in /in/bAnWm on line 36
Process exited with code 255.

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