How can php reflection get an attribute value prototype?

how can reflection get the prototype name instead of the value.
such as sample code, how do I get the value represented by "CRTINT" instead of CRTINT?
Thank you.

<?php 
echo "
";
define("CRTINT", "1120");
class test{
    public $age1 = CRTINT;
    private $age2 = array(CRTINT);
    protected $age3 = CRTINT * 87;
    protected $age4 = false;
}

$oReflectionClass = new ReflectionClass("test");
$props = array();
$allprops = $oReflectionClass->getDefaultProperties();
$getProperties = $oReflectionClass->getProperties();
foreach($getProperties AS $ps){
    $binds = array();
    $binds["getval"] = var_export($allprops[$ps->name],true);
    $props[$ps->name] = $binds;
}
print_r($props);
Php
Dec.28,2021

http://cn.php.net/manual/zh/m.

I wonder if this first rule is consistent with your situation


there is no way to get it.

in a class, you actually assign the value of a constant to a variable, and there is no constant information

.

you can use

get_defined_constants(true)['user']

get the user-defined constant and then judge based on the value

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3566a-2acd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3566a-2acd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?