Grokbase Groups PHP php-doc July 2005
FAQ
From: scott at slerman dot net
Operating system:
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: get_class argument not listed as optional

Description:
------------
The manual lists the function declaration as

string get_class ( object obj )

In fact, the argument is optional. If no argument is given, get_class
returns the name of the class that the current method is defined in
(returning the parent class if the method is called as part of a child
class).

Search Discussions

  • Sean at Jul 21, 2005 at 3:33 am
    ID: 33795
    Updated by: sean@php.net
    Reported By: scott at slerman dot net
    Status: Open
    Bug Type: Documentation problem
    PHP Version: Irrelevant
    New Comment:

    Seems this changed in PHP 5:
    sean@iconoclast:~$ php -r 'class Foo { function bar() { echo
    get_class(); } } Foo::bar();'

    Warning: Wrong parameter count for get_class() in Command line code on
    line 1
    sean@iconoclast:~$ php5 -r 'class Foo { function bar() { echo
    get_class(); } } Foo::bar();'

    I'd guess as part of #9, here:
    http://cvs.php.net/co.php/php-src/README.PHP4-TO-PHP5-THIN-CHANGES

    S


    Previous Comments:
    ------------------------------------------------------------------------

    [2005-07-21 05:12:48] scott at slerman dot net

    Description:
    ------------
    The manual lists the function declaration as

    string get_class ( object obj )

    In fact, the argument is optional. If no argument is given, get_class
    returns the name of the class that the current method is defined in
    (returning the parent class if the method is called as part of a child
    class).



    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=33795&edit=1
  • Vrana at Jul 21, 2005 at 9:00 am
    ID: 33795
    Updated by: vrana@php.net
    Reported By: scott at slerman dot net
    -Status: Open
    +Status: Closed
    Bug Type: Documentation problem
    PHP Version: Irrelevant
    New Comment:

    This bug has been fixed in the documentation's XML sources. Since the
    online and downloadable versions of the documentation need some time
    to get updated, we would like to ask you to be a bit patient.

    Thank you for the report, and for helping us make our documentation
    better.

    "Since PHP 5, obj is optional if called from the object's method."


    Previous Comments:
    ------------------------------------------------------------------------

    [2005-07-21 05:33:18] sean@php.net

    Seems this changed in PHP 5:
    sean@iconoclast:~$ php -r 'class Foo { function bar() { echo
    get_class(); } } Foo::bar();'

    Warning: Wrong parameter count for get_class() in Command line code on
    line 1
    sean@iconoclast:~$ php5 -r 'class Foo { function bar() { echo
    get_class(); } } Foo::bar();'

    I'd guess as part of #9, here:
    http://cvs.php.net/co.php/php-src/README.PHP4-TO-PHP5-THIN-CHANGES

    S

    ------------------------------------------------------------------------

    [2005-07-21 05:12:48] scott at slerman dot net

    Description:
    ------------
    The manual lists the function declaration as

    string get_class ( object obj )

    In fact, the argument is optional. If no argument is given, get_class
    returns the name of the class that the current method is defined in
    (returning the parent class if the method is called as part of a child
    class).



    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=33795&edit=1

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-doc @
categoriesphp
postedJul 21, '05 at 3:12a
activeJul 21, '05 at 9:00a
posts3
users3
websitedoc.php.net

People

Translate

site design / logo © 2018 Grokbase