#22113 [Opn->Csd]: error in one of your documentation-examples

From: Date: Fri, 07 Feb 2003 20:22:19 +0000
Subject: #22113 [Opn->Csd]: error in one of your documentation-examples
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969351664@lists.php.net to get a copy of this message
ID: 22113 Updated by: philip@php.net Reported By: elmarto@gmx.de -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: linux debian PHP Version: 4.3.0 New Comment: This has been fixed: http://cvs.php.net/cvs.php/phpdoc/en/language/functions.xml It will show up when the manual is next built, thank you for the report :) Previous Comments: ------------------------------------------------------------------------ [2003-02-07 13:33:13] elmarto@gmx.de in your documentation on page http://www.php.net/manual/en/functions.variable-functions.php there is a mistake with the latest example 13.4. it says: <?php class Foo { function Var() { $name = 'Bar'; $this->$name(); // This calls the Bar() method } function Bar() { echo "This is Bar"; } } $foo = new Foo(); $funcname = "Var"; $foo->$varname(); // This calls $foo->Var() ?> The $foo->$varname(); will produce an undefined function error. It has to be $foo->$funcname(); ------------------------------------------------------------------------ [2003-02-07 13:32:01] elmarto@gmx.de in your documentation on page http://www.php.net/manual/en/functions.variable-functions.php there is a mistake with the latest example 13.4. it says: <?php class Foo { function Var() { $name = 'Bar'; $this->$name(); // This calls the Bar() method } function Bar() { echo "This is Bar"; } } $foo = new Foo(); $funcname = "Var"; $foo->$varname(); // This calls $foo->Var() ?> The $foo->$varname(); will produce an undefined function error. It has to be $foo->funcname(); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22113&edit=1

« previous php.doc (#969351664) next »