Skip to content

Commit e506f01

Browse files
committed
Added example of range operator
1 parent 0675b56 commit e506f01

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

components/expression_language/syntax.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,26 @@ Numeric Operators
244244

245245
* ``..`` (range)
246246

247+
For example::
248+
249+
class User
250+
{
251+
public $age;
252+
}
253+
254+
$user = new User();
255+
$user->age = 34;
256+
257+
$language->evaluate(
258+
'user.age in 18..45',
259+
array(
260+
'user' => $user,
261+
)
262+
);
263+
264+
This will evaluate to ``true``, because ``user.age`` is in the range from
265+
``18`` till ``45``
266+
247267
Ternary Operators
248268
~~~~~~~~~~~~~~~~~
249269

0 commit comments

Comments
 (0)