mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
d933591674
This allows $obj::class, which gives the same result as get_class($obj). Anything other than an object results in TypeError. RFC: https://wiki.php.net/rfc/class_name_literal_on_object Closes GH-5065.
11 lines
220 B
PHP
11 lines
220 B
PHP
--TEST--
|
|
::class on an expression cannot be used inside constant expressions
|
|
--FILE--
|
|
<?php
|
|
|
|
const A = [0]::class;
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: (expression)::class cannot be used in constant expressions in %s on line %d
|