ReflectionProperty
PHP Manual

ReflectionProperty::getDocComment

(PHP 5 >= 5.1.0, PHP 7)

ReflectionProperty::getDocCommentRécupère le commentaire d'une propriété

Description

public string ReflectionProperty::getDocComment ( void )

Récupère un commentaire d'une propriété.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Le commentaire de la propriété.

Exemples

Exemple #1 ReflectionProperty::getDocComment() example

<?php
class Str
{
    
/**
     * @var int  The length of the string
     */
    
public $length 5;
}

$prop = new ReflectionProperty('Str''length');

var_dump($prop->getDocComment());

?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

string(53) "/**
     * @var int  The length of the string
     */"

Voir aussi


ReflectionProperty
PHP Manual