Data::interpret

Posted on November 17, 2016

Interpret data to value

Example usage

echo Data::interpret('i`am value');

// i`am value

echo Data::interpret(function() { return 5*5; });

// 25

function someFunc() {
    return 'Some function';
}

echo Data::interpret('someFunc');

// Some function

define('SOME_CONSTANT', 'some constant value');

echo Data::interpret('{{ SOME_CONSTANT }}');

// some constant value

class SomeClass
{
    public static function someFunc()
    {
        return 'function from class';
    }
}

echo Data::interpret('{{ SomeClass::someFunc }}');

// function from class

Parameters

mixed $value

Return Value

mixed

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *