mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-29 22:46:22 +00:00
21 lines
344 B
Markdown
21 lines
344 B
Markdown
|
---
|
||
|
id: e344631b-61fc-4110-abab-e610ce460854
|
||
|
title: PHP Class Name Literal
|
||
|
---
|
||
|
|
||
|
# Description
|
||
|
|
||
|
Introduced in [PHP 8.0](20201109133834-php_8_0), class name literals[^1]
|
||
|
is a new alternative to `get_class()`
|
||
|
|
||
|
# Syntax
|
||
|
|
||
|
``` php
|
||
|
$foo = new Foo();
|
||
|
var_dump($foo:class)
|
||
|
```
|
||
|
|
||
|
# Footnotes
|
||
|
|
||
|
[^1]: <https://wiki.php.net/rfc/class_name_literal_on_object>
|