ReflectionType::__toString

(PHP 7, PHP 8)

ReflectionType::__toStringTo string

Açıklama

publicReflectionType::__toString(): string

Gets the parameter type name.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns the type of the parameter.

Sürüm Bilgisi

Sürüm: Açıklama
8.0.0ReflectionType::__toString() has been undeprecated.
7.1.0ReflectionType::__toString() has been deprecated.

Örnekler

Örnek 1 ReflectionType::__toString() example

<?php
function someFunction(string $param) {}

$reflectionFunc = new ReflectionFunction('someFunction');
$reflectionParam = $reflectionFunc->getParameters()[0];

echo
$reflectionParam->getType();

Yukarıdaki örnek şuna benzer bir çıktı üretir:

string

Ayrıca Bakınız

To Top