Download the PHP package profideo-ci/expression-language without Composer
On this page you can find all versions of the php package profideo-ci/expression-language. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download profideo-ci/expression-language
More information about profideo-ci/expression-language
Files in profideo-ci/expression-language
Download profideo-ci/expression-language
More information about profideo-ci/expression-language
Files in profideo-ci/expression-language
Vendor profideo-ci
Package expression-language
Short Description Symfony ExpressionLanguage Component
License MIT
Homepage https://symfony.com
Package expression-language
Short Description Symfony ExpressionLanguage Component
License MIT
Homepage https://symfony.com
Please rate this library. Is it a good library?
Informations about the package expression-language
ExpressionLanguage Component
The ExpressionLanguage component provides an engine that can compile and evaluate expressions:
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
$language = new ExpressionLanguage();
echo $language->evaluate('1 + foo', array('foo' => 2));
// would output 3
echo $language->compile('1 + foo', array('foo'));
// would output (1 + $foo)
By default, the engine implements simple math and logic functions, method calls, property accesses, and array accesses.
You can extend your DSL with functions:
$compiler = function ($arg) {
return sprintf('strtoupper(%s)', $arg);
};
$evaluator = function (array $variables, $value) {
return strtoupper($value);
};
$language->register('upper', $compiler, $evaluator);
echo $language->evaluate('"foo" ~ upper(foo)', array('foo' => 'bar'));
// would output fooBAR
echo $language->compile('"foo" ~ upper(foo)');
// would output ("foo" . strtoupper($foo))
Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/ExpressionLanguage/
$ composer.phar install --dev
$ phpunit
All versions of expression-language with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.9
The package profideo-ci/expression-language contains the following files
Loading the files please wait ....