ReflectionClass::getFileName

(PHP 5, PHP 7, PHP 8)

ReflectionClass::getFileNameObtém o nome do arquivo no qual a classe foi definida

Descrição

public ReflectionClass::getFileName(): string|false

Obtém o nome do arquivo no qual a classe foi definida.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Retorna o nome do arquivo no qual a classe foi definida. Se a classe estiver definida no núcleo do PHP ou em uma extensão do PHP, false é retornado.

Veja Também

adicione uma nota

Notas Enviadas por Usuários (em inglês) 2 notes

up
2
robot at znframework dot com
7 years ago
<?php

$a
= new \ReflectionClass('ZN\Database\InternalDB');

var_dump($a->getFileName());

// Output: C:\xampp7\htdocs\develop\Internal\Database\DB\InternalDB.php
up
1
me at yeganemehr dot net
10 months ago
Please note that returned value from this function is actually realpath of the file and if your file is symlink, target of the link will return.
To Top