Skip to content

Condition using __CLASS__ magic constant in trait #3019

@szepeviktor

Description

@szepeviktor

Bug report

This line of code in a trait produces errors:

  • in Layout class: "condition is always true"
  • in other classes: "condition is always false"

vinkla/extended-acf#53 (comment)

Code snippet that reproduces the problem

$key = __CLASS__ === 'WordPlate\Acf\Fields\Layout' ? 'display' : 'layout';

Expected output

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions