[PHP-DOC] #22113 [Opn->Csd]: error in one of your documentation-examples From: philip <email protected>
Date: 02/07/03

 ID: 22113
 Updated by: philip <email protected>
 Reported By: elmarto <email protected>
-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 <email protected>

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 <email protected>

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

-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php