3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP class COMMENT { public function prepare($data) { $data['body'] = COMMENT::prepareBody($data['body']); } public function prepareBody($body) { call_user_func(array('self', 'prepareBody_cb')); } public static function prepareBody_cb($match) { return 'ok'; } } class COMMENTS { function addComment($data) { $x = COMMENT::prepareBody($data); } } class ACTION { function ietsMetComment() { $post = array ('body' => 'a'); $c = new COMMENTS(); $c->addComment($post); } } function selector() { $x = new ACTION; $x->ietsMetComment(); } error_reporting(E_ALL); ini_set('display_errors', 'on'); selector();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Non-static method COMMENT::prepareBody() cannot be called statically in /in/XsVCg:24 Stack trace: #0 /in/XsVCg(34): COMMENTS->addComment(Array) #1 /in/XsVCg(42): ACTION->ietsMetComment() #2 /in/XsVCg(49): selector() #3 {main} thrown in /in/XsVCg on line 24
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:
42.97 ms | 401 KiB | 8 Q