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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: raix at intermedia dot dk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sun Dec 22 02:01:28 2024 UTC