php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6948 $this->func="myfunc"; $this->func("hello");
Submitted: 2000-09-29 18:18 UTC Modified: 2000-10-05 17:51 UTC
From: raix at intermedia dot dk Assigned:
Status: Closed Package: Class/Object related
PHP Version: 4.0.0 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 - 37 = ?
Subscribe to this entry?

 
 [2000-09-29 18:18 UTC] raix at intermedia dot dk
//I have a variable-function in my class.
class myclass {
  var $func="myfunc";
  function test() {
    $this->func("hello"); //This doesn't work!!

    //This is to be done to make it work:
    $temp=$this->func;
    $temp("hello");
    //This is to silly, I consider this a bug..
    //If it ain't it sould be implementet in the todo.
  }
}
//This sould work no mather the setup.
//I've compiled php with mysql,sybase, shmem

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-05 17:51 UTC] stas@php.net
Yes this is how it works. use $this->$func().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 05:01:29 2024 UTC