php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33795 get_class argument not listed as optional
Submitted: 2005-07-21 05:12 UTC Modified: 2005-07-21 11:00 UTC
From: scott at slerman dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: scott at slerman dot net
New email:
PHP Version: OS:

 

 [2005-07-21 05:12 UTC] 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).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-21 05:33 UTC] 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 11:00 UTC] vrana@php.net
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."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 07:01:30 2024 UTC