3v4l.org

run code in 300+ PHP versions simultaneously
<?php class human{ public $x = null; protected static function t(){ echo "sdffffffff"; } //魔术方法__call /* $method 获得方法名 $arg 获得方法的参数集合 */ public static function __callStatic($method,$arg){ echo '你想调用我不存在的方法',$method,'方法<br/>'; echo '还传了一个参数<br/>'; echo print_r($arg),'<br/>'; $reflect = new ReflectionMethod($this, $method); var_dump($reflect->isPublic()); self::$method(); } } human::t(1,2,3); $li=new human(); $li->t(1,2,3);
Output for git.master, git.master_jit, rfc.property-hooks
你想调用我不存在的方法t方法<br/>还传了一个参数<br/>Array ( [0] => 1 [1] => 2 [2] => 3 ) 1<br/> Fatal error: Uncaught Error: Using $this when not in object context in /in/ETZE0:18 Stack trace: #0 /in/ETZE0(23): human::__callStatic('t', Array) #1 {main} thrown in /in/ETZE0 on line 18
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:
63.62 ms | 401 KiB | 8 Q