mirror of
https://github.com/php/php-src.git
synced 2025-01-18 17:54:05 +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
208 B
PHP
11 lines
208 B
PHP
--TEST--
|
|
An error should be generated when using ::class on a constant evaluated expression
|
|
--FILE--
|
|
<?php
|
|
|
|
(1+1)::class;
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use ::class on value of type int in %s on line %d
|