Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Property %s::$%s does not exist

Description

This error happens when the Reflection API fails at getting the description of a non-existent property. The name of the property should be checked before using the getProperty method.

Example

<?php
    $class = new ReflectionClass('ReflectionClass');
    $property = $class->getProperty('unkown');
    var_dump($property);
?>

Literal Examples

  • Property ReflectionClass::$unknown does not exist

Alternatives

  • Check that the property exists before using getProperty.

In previous PHP versions, this error message used to be :ref:property-%s-does-not-exist.