<commit_before>--TEST--
ReflectionClass::getName()
--FILE--
<?php
require 'vendor/autoload.php';
use BetterReflection\Reflector\ClassReflector;
use BetterReflection\SourceLocator\SingleFileSourceLocator;
$reflector = new ClassReflector(new SingleFileSourceLocator(__FILE__));

class TrickClass {
	function __toString() {
		//Return the name of another class
		return "Exception";
	}
}


$r3 = $reflector->reflect('TrickClass');

var_dump($r3->getName());

?> 
--EXPECTF--
string(10) "TrickClass"<commit_msg>Use simple default reflection in ReflectionClass_getName_basic.phpt<commit_after>--TEST--
ReflectionClass::getName()
--FILE--
<?php require 'vendor/autoload.php';
class TrickClass {
	function __toString() {
		//Return the name of another class
		return "Exception";
	}
}

$r1 = \BetterReflection\Reflection\ReflectionClass::createFromName('stdClass');

$myInstance = new stdClass;
$r2 = \BetterReflection\Reflection\ReflectionObject::createFromInstance($myInstance);

$r3 = \BetterReflection\Reflection\ReflectionClass::createFromName('TrickClass');

var_dump($r1->getName(), $r2->getName(), $r3->getName());

?> 
--EXPECTF--
string(8) "stdClass"
string(8) "stdClass"
string(10) "TrickClass"
{'fraction_non_alphanumeric': 0.15358931552587646, 'fraction_numerical': 0.011686143572621035, 'mean_word_length': 6.310975609756097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7383370', 'n_tokens_mistral': 390, 'n_tokens_neox': 384, 'n_words': 73}