note 85630 added to functions.variable-functions

From: Date: Tue, 09 Sep 2008 19:29:17 +0000
Subject: note 85630 added to functions.variable-functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-144272@lists.php.net to get a copy of this message
To anyone wanting to call function names stored in the object scope: <?php class my_class { public $stored_func = 'explode'; function __construct () { var_dump(call_user_func($this->stored_func, ' ', "str ing")); } } ?> Simply trying to call it like this: $this->stored_func(' ', "str ing"); Won't work because "stored_func" is a member and not a method (quite obviously) ---- Server IP: 117.104.160.194 Probable Submitter: 121.223.25.75 ---- Manual Page -- http://www.php.net/manual/en/functions.variable-functions.php Edit -- https://master.php.net/note/edit/85630 Del: integrated -- https://master.php.net/note/delete/85630/integrated Del: useless -- https://master.php.net/note/delete/85630/useless Del: bad code -- https://master.php.net/note/delete/85630/bad+code Del: spam -- https://master.php.net/note/delete/85630/spam Del: non-english -- https://master.php.net/note/delete/85630/non-english Del: in docs -- https://master.php.net/note/delete/85630/in+docs Del: other reasons-- https://master.php.net/note/delete/85630 Reject -- https://master.php.net/note/reject/85630 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144272) next »