Hướng dẫn php get class location
(PHP 4, PHP 5, PHP 7, PHP 8) get_class — Returns the name of the class of an object Descriptionget_class(object Parametersobject The tested object. This parameter may be omitted when inside a class.
Return Values Returns the name of the class of which If If the Errors/Exceptions If get_class() is called
with anything other than an object, TypeError is raised. Prior to PHP 8.0.0, an If get_class() is called with no arguments from outside a class, Error is raised. Prior to PHP 8.0.0, an Changelog
ExamplesExample #1 Using get_class()
The above example will output: Its name is foo My name is foo Example #2 Using get_class() in superclass
foo extends bar { The above example will output: string(3) "foo" string(3) "bar" Example #3 Using get_class() with namespaced classes
Baz { The above example will output: See Also
jjanak at webperfection dot net ¶ 7 years ago
Dispatcher {} dave at shax dot com ¶ 8 years ago
mail dot temc at gmail dot com ¶ 10 years ago
Bar extends Foo {
ovidiu.bute [at] gmail.com ¶ 12 years ago
emmanuel dot antico at gmail dot com ¶ 9 years ago
macnimble at gmail dot com ¶ 10 years ago
Nanhe Kumar ¶ 8 years ago
Anonymous ¶ 14 years ago
Edward ¶ 14 years ago
RQuadling at GMail dot com ¶ 7 years ago
Baz davidsch ¶ 1 year ago
getInstance(): ACFBlock { Anonymous ¶ 8 years ago
foo extends \system\libs\controller { Hayley Watson ¶ 5 years ago
dense ¶ 5 years ago
var23rav at gmail dot com ¶ 8 years ago
Aaron ¶ 12 years ago
ozana at omdesign dot cz ¶ 10 years ago
Foo {
Michael Richey ¶ 10 years ago
Exception("Unknown backtrace method type");
me at nwhiting dot com ¶ 11 years ago
function get_class_name($object = null) dodgie74 at NOSPAM dot yahoo dot NOSPAM dot co dot uk ¶ 15 years ago
classDisplayName() bramus at bram dot us ¶ 15 years ago
yicheng zero-four at gmail dot com ¶ 15 years ago
luke at liveoakinteractive dot com ¶ 15 years ago
retrieve_class() { benjaminhill at gmail dot com ¶ 16 years ago
refrozen dot com ¶ 17 years ago
andregs at NOSPAM dot gmail dot NOSPAM dot com ¶ 14 years ago
Child extends Singleton Frederik Krautwald ¶ 15 years ago
__construct() {} mightye at gmail dot com ¶ 15 years ago
__construct(){} janci ¶ 15 years ago
getInstance()
MagicalTux at FF.ST ¶ 18 years ago
dave dot zap at gmail dot com ¶ 14 years ago
XyQrTw ¶ 5 years ago
MyClass {
danbettles at yahoo dot co dot uk ¶ 13 years ago
__construct() { Edward ¶ 14 years ago
Lanselot ¶ 13 years ago
kiril (AT) aternus networks ¶ 4 years ago
|