|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76083 Add an ::interface magic constant similar to ::class
Submitted: 2018-03-12 16:07 UTC Modified: 2018-03-12 16:13 UTC
From: tpenepete at gmail dot com Assigned:
Status: Not a bug Package: PHP Language Specification
PHP Version: 7.2.3 OS: All
Private report: No CVE-ID: None
 [2018-03-12 16:07 UTC] tpenepete at gmail dot com
From manual page:

Test script:
namespace Foo;

interface Bar


class SomeClass implements Bar


Expected result:
use Foo\Bar;
use Foo\SomeClass;

if(isset(class_implements(SomeClass::class)[Bar::interface]))) {
    echo 'Yupee!';
} else {
    echo 'Ugh :(';

Expected output:

Actual result:
Undefined constant


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 16:13 UTC]
-Status: Open +Status: Not a bug
 [2018-03-12 16:13 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

::class works fine with interfaces as well as classes
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 14:01:34 2024 UTC