Coder Social home page Coder Social logo

jmespath.php's Introduction

JMESPath

JMESPath (pronounced "james path") allows you to declaratively specify how to extract elements from a JSON document.

For example, given this document:

{"foo": {"bar": "baz"}}

The jmespath expression foo.bar will return "baz".

JMESPath also supports:

Referencing elements in a list. Given the data:

{"foo": {"bar": ["one", "two"]}}

The expression: foo.bar[0] will return "one". You can also reference all the items in a list using the * syntax:

{"foo": {"bar": [{"name": "one"}, {"name": "two"}]}}

The expression: foo.bar[*].name will return ["one", "two"]. Negative indexing is also supported (-1 refers to the last element in the list). Given the data above, the expression foo.bar[-1].name will return "two".

The * can also be used for hash types:

{"foo": {"bar": {"name": "one"}, "baz": {"name": "two"}}}

The expression: foo.*.name will return ["one", "two"].

Installation

You can install JMESPath from pypi with:

pip install jmespath

API

The jmespath.py library has two functions that operate on python data structures. You can use search and give it the jmespath expression and the data:

>>> import jmespath
>>> path = jmespath.search('foo.bar', {'foo': {'bar': 'baz'}})
'baz'

Similar to the re module, you can use the compile function to compile the JMESPath expression and use this parsed expression to perform repeated searches:

>>> import jmespath
>>> expression = jmespath.compile('foo.bar')
>>> expression.search({'foo': {'bar': 'baz'}})
'baz'
>>> expression.search({'foo': {'bar': 'other'}})
'other'

This is useful if you're going to use the same jmespath expression to search multiple documents. This avoids having to reparse the JMESPath expression each time you search a new document.

Options

You can provide an instance of jmespath.Options to control how a JMESPath expression is evaluated. The most common scenario for using an Options instance is if you want to have ordered output of your dict keys. To do this you can use either of these options:

>>> import jmespath
>>> jmespath.search('{a: a, b: b}',
...                 mydata,
...                 jmespath.Options(dict_cls=collections.OrderedDict))


>>> import jmespath
>>> parsed = jmespath.compile('{a: a, b: b}')
>>> parsed.search(mydata,
...               jmespath.Options(dict_cls=collections.OrderedDict))

Custom Functions

The JMESPath language has numerous built-in functions, but it is also possible to add your own custom functions. Keep in mind that custom function support in jmespath.py is experimental and the API may change based on feedback.

If you have a custom function that you've found useful, consider submitting it to jmespath.site and propose that it be added to the JMESPath language. You can submit proposals here.

To create custom functions:

  • Create a subclass of jmespath.functions.Functions.
  • Create a method with the name _func_<your function name>.
  • Apply the jmespath.functions.signature decorator that indicates the expected types of the function arguments.
  • Provide an instance of your subclass in a jmespath.Options object.

Below are a few examples:

import jmespath
from jmespath import functions

# 1. Create a subclass of functions.Functions.
#    The function.Functions base class has logic
#    that introspects all of its methods and automatically
#    registers your custom functions in its function table.
class CustomFunctions(functions.Functions):

    # 2 and 3.  Create a function that starts with _func_
    # and decorate it with @signature which indicates its
    # expected types.
    # In this example, we're creating a jmespath function
    # called "unique_letters" that accepts a single argument
    # with an expected type "string".
    @functions.signature({'types': ['string']})
    def _func_unique_letters(self, s):
        # Given a string s, return a sorted
        # string of unique letters: 'ccbbadd' ->  'abcd'
        return ''.join(sorted(set(s)))

    # Here's another example.  This is creating
    # a jmespath function called "my_add" that expects
    # two arguments, both of which should be of type number.
    @functions.signature({'types': ['number']}, {'types': ['number']})
    def _func_my_add(self, x, y):
        return x + y

# 4. Provide an instance of your subclass in a Options object.
options = jmespath.Options(custom_functions=CustomFunctions())

# Provide this value to jmespath.search:
# This will print 3
print(
    jmespath.search(
        'my_add(`1`, `2`)', {}, options=options)
)

# This will print "abcd"
print(
    jmespath.search(
        'foo.bar | unique_letters(@)',
        {'foo': {'bar': 'ccbbadd'}},
        options=options)
)

Again, if you come up with useful functions that you think make sense in the JMESPath language (and make sense to implement in all JMESPath libraries, not just python), please let us know at jmespath.site.

Specification

If you'd like to learn more about the JMESPath language, you can check out the JMESPath tutorial. Also check out the JMESPath examples page for examples of more complex jmespath queries.

The grammar is specified using ABNF, as described in RFC4234. You can find the most up to date grammar for JMESPath here.

You can read the full JMESPath specification here.

Testing

In addition to the unit tests for the jmespath modules, there is a tests/compliance directory that contains .json files with test cases. This allows other implementations to verify they are producing the correct output. Each json file is grouped by feature.

Discuss

Join us on our Gitter channel if you want to chat or if you have any questions.

jmespath.php's People

Contributors

chris53897 avatar flavioheleno avatar grahamcampbell avatar jamesls avatar jeremeamia avatar kawaz avatar mfn avatar morozov avatar mrtnmtth avatar mtdowling avatar nickfan avatar pborreli avatar siwinski avatar whatthejeff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jmespath.php's Issues

Changed behaviour of foo.*.baz

Hi!
It seems to me that this was working:

    $expression = "foo.*.baz";
    $data = [
    'foo' => [
        '0' => ['baz' => 1],
        '1' => ['baz' => 2],
        '2' => ['baz' => 3]
        ]
    ];
    var_dump(JmesPath\search($expression, $data));

But now i got null. Am i using this library wrong or this is an issue?

Syntax error. Unexpected "unknown" token (nud_unknown)

query:

[0::2].name

it works on the website http://jmespath.org/tutorial.html

data:

[
  {
    "postId": 1,
    "id": 1,
    "name": "id labore ex et quam laborum",
    "email": "[email protected]",
    "body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium"
  },
  {
    "postId": 1,
    "id": 2,
    "name": "quo vero reiciendis velit similique earum",
    "email": "[email protected]",
    "body": "est natus enim nihil est dolore omnis voluptatem numquam\net omnis occaecati quod ullam at\nvoluptatem error expedita pariatur\nnihil sint nostrum voluptatem reiciendis et"
  },
  {
    "postId": 1,
    "id": 3,
    "name": "odio adipisci rerum aut animi",
    "email": "[email protected]",
    "body": "quia molestiae reprehenderit quasi aspernatur\naut expedita occaecati aliquam eveniet laudantium\nomnis quibusdam delectus saepe quia accusamus maiores nam est\ncum et ducimus et vero voluptates excepturi deleniti ratione"
  }
]

exception:

JmesPath\SyntaxErrorException: Syntax error at character 1
[0::2].name
 ^
Unexpected "unknown" token (nud_unknown). Expected one of the following tokens: "identifier", "quoted_identifier", "current", "literal", "expref", "not", "lparen", "lbrace", "flatten", "filter", "star", "lbracket" in ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(464,8)
Stack trace:
#0 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(512,12): Parser->syntax($msg)
#1 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(96,8): Parser->__call($method, $args)
#2 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(451,12): Parser->expr($rbp)
#3 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(196,12): Parser->parseMultiSelectList()
#4 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(96,8): Parser->nud_lbracket()
#5 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Parser.php(78,8): Parser->expr($rbp)
#6 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/AstRuntime.php(41,12): Parser->parse($expression)
#7 ~/Projects/Project/test/vendor/mtdowling/jmespath.php/src/Env.php(30,8): AstRuntime->__invoke($expression, $data)
#8 ~/Projects/Project/test/src/Spider/Spider.php(806,8): Env::search($expression, $data)
#9 ~/Projects/Project/test/src/Spider/Spider.php(612,12): Spider->fetchSingleFieldJMESPath($selector, $content, $request, $response)
#10 ~/Projects/Project/test/src/Spider/Spider.php(890,20): Spider->fetchSingleField($type, $selector, $content, $request, $response)
#11 ~/Projects/Project/test/src/Spider/Spider.php(412,12): Spider->fetchFields($fields, $content, $request, $response, $recursive)
#12 : Spider->processResponse($response)
#13 : ExecutionContext::RunInternal($executionContext, $callback, $state)
#14 : Task->ExecuteWithThreadLocal($currentTaskSlot)
#15 : Task->ExecuteEntry()
#16 : ThreadPoolWorkQueue::Dispatch()

Parser accepts non-compliant jmespath expressions

Specifically, arbitrary expressions are allowed after an index-expression

$ echo '""' | bin/jp.php 'a[*]b'

Expression
==========

a[*]b

Tokens
======

  0  T_IDENTIFIER   "a"
  1  T_LBRACKET     "["
  2  T_STAR         "*"
  3  T_RBRACKET     "]"
  4  T_IDENTIFIER   "b"

AST
========

{
    "type": "projection",
    "from": "array",
    "children": [
        {
            "type": "field",
            "key": "a"
        },
        {
            "type": "field",
            "key": "b"
        }
    ]
}

Data
====

""


Result
======

null

Time
====

Lexer time:     0.167847 ms
Parse time:     0.074863 ms
Interpret time: 0.016928 ms
Total time:     0.091791 ms

Additional examples:

a[*]abs(@)
a[*]b[*]c[*]
a[*]{b:c}

It appears that this problem applies to any type of list projection:

a[]b
a[?b==c]d

No such a file on composer install or update

Whenever I try to install any composer dependency - in this case league/flysystem-aws-s3-v3 - which has a dependency your package I get the following error

`Warning: Uncaught ErrorException: require(C:\wamp64\www\laravel\vendor\composer/../mtdowling/jmespath.php/src/JmesPath.php): failed to open stream: No such file or directory in C:\wamp64\www\laravel\vendor\composer\autoload_real.php:66
Stack trace:
#0 C:\wamp64\www\laravel\vendor\composer\autoload_real.php(66): Composer\Util\ErrorHandler::handle(2, 'require(C:\wamp...', 'C:\wamp64\www\m...', 66, Array)
#1 C:\wamp64\www\laravel\vendor\composer\autoload_real.php(66): require()
#2 C:\wamp64\www\laravel\vendor\composer\autoload_real.php(56): composerRequire77f420fae914154a4be36e9c5d235a14('b067bc7112e384b...', 'C:\wamp64\www\m...')
#3 C:\wamp64\www\laravel\vendor\autoload.php(7): ComposerAutoloaderInit77f420fae914154a4be36e9c5d235a14::getLoader()
#4 C:\wamp64\www\laravel\vendor\kylekatarnls\update-helper\src\UpdateHelper\UpdateHelper.php(137): include_once('C:\wamp64\www\m...')
#5 C:\wamp64\www\laravel\vendor\kylekatarnls\update-helper\src\UpdateHelper\ComposerPlugin.php(35): UpdateHelper\UpdateHelper::check(Object(Composer\Script\Even in C:\wamp64\www\laravel\vendor\composer\autoload_real.php on line 66

Fatal error: composerRequire77f420fae914154a4be36e9c5d235a14(): Failed opening required 'C:\wamp64\www\laravel\vendor\composer/../mtdowling/jmespath.php/src/JmesPath.php' (include_path='.;C:\php\pear') in C:\wamp64\www\laravel\vendor\composer\autoload_real.php on line 66
`

PHP 7.2 compatibility issues with `make perf`

$ php --version
PHP 7.2.0 (cli) (built: Dec  3 2017 21:46:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.2.0, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.6.0alpha1, Copyright (c) 2002-2017, by Derick Rethans

On a fresh clone of the repo, I installed the Composer dependencies and ran make perf.

$ make perf
php bin/perf.php
time: 00.0269ms name: single_expression
time: 00.0510ms name: single_dot_expression
time: 00.0758ms name: double_dot_expression
time: 00.0989ms name: dot_no_match
time: 00.2432ms name: deep_nesting_10
time: 01.1330ms name: deep_nesting_50
time: 01.1511ms name: deep_nesting_50_pipe
time: 01.3411ms name: deep_nesting_50_index
PHP Fatal error:  Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /Library/WebServer/Documents/jmespath.php/src/Parser.php:105
Stack trace:
#0 /Library/WebServer/Documents/jmespath.php/src/Parser.php(97): JmesPath\Parser->nud_identifier()
#1 /Library/WebServer/Documents/jmespath.php/src/Parser.php(351): JmesPath\Parser->expr(20)
#2 /Library/WebServer/Documents/jmespath.php/src/Parser.php(336): JmesPath\Parser->parseDot(20)
#3 /Library/WebServer/Documents/jmespath.php/src/Parser.php(393): JmesPath\Parser->parseProjection(20)
#4 /Library/WebServer/Documents/jmespath.php/src/Parser.php(213): JmesPath\Parser->parseWildcardArray(Array)
#5 /Library/WebServer/Documents/jmespath.php/src/Parser.php(99): JmesPath\Parser->led_lbracket(Array)
#6 /Library/WebServer/Documents/jmespath.php/src/Parser.php(351): JmesPath\Parser->expr(20)
#7 /Library/WebServer/Documents/jmespath.php/src/Parser.php(336): JmesPath\Parser->parseDot(20)
#8 /Library/WebServer/Documents/jmespath.php/src/Parser.php(393): JmesPath\Parser-> in /Library/WebServer/Documents/jmespath.php/src/Parser.php on line 105

Fatal error: Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /Library/WebServer/Documents/jmespath.php/src/Parser.php on line 105

Error: Maximum function nesting level of '256' reached, aborting! in /Library/WebServer/Documents/jmespath.php/src/Parser.php on line 105

Call Stack:
    0.0005     411992   1. {main}() /Library/WebServer/Documents/jmespath.php/bin/perf.php:0
    0.5385     972688   2. runSuite() /Library/WebServer/Documents/jmespath.php/bin/perf.php:12
    0.5387     976424   3. runCase() /Library/WebServer/Documents/jmespath.php/bin/perf.php:26
    0.5387     976816   4. JmesPath\AstRuntime->__invoke() /Library/WebServer/Documents/jmespath.php/bin/perf.php:40
    0.5387     976816   5. JmesPath\Parser->parse() /Library/WebServer/Documents/jmespath.php/src/AstRuntime.php:42
    0.5407    1222536   6. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:79
    0.5407    1222912   7. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5408    1222912   8. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5408    1223936   9. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5408    1223936  10. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5408    1223936  11. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5408    1224312  12. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5408    1224312  13. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5408    1225064  14. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5408    1225064  15. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5408    1225064  16. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5408    1225440  17. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5408    1225440  18. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5408    1226192  19. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5408    1226192  20. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5408    1226192  21. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5408    1226568  22. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5408    1226568  23. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5408    1227320  24. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5408    1227320  25. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5408    1227320  26. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5408    1227696  27. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5408    1227696  28. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5408    1228448  29. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5408    1228448  30. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5408    1228448  31. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5409    1228824  32. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5409    1228824  33. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5409    1229576  34. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5409    1229576  35. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5409    1229576  36. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5409    1229952  37. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5409    1229952  38. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5409    1230704  39. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5409    1230704  40. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5409    1230704  41. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5409    1231080  42. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5409    1231080  43. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5409    1231832  44. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5409    1231832  45. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5409    1231832  46. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5409    1232208  47. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5409    1232208  48. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5409    1232960  49. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5409    1232960  50. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5409    1232960  51. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5409    1233336  52. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5409    1233336  53. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5409    1234088  54. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5409    1234088  55. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5409    1234088  56. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5409    1234464  57. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5409    1234464  58. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5410    1235216  59. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5410    1235216  60. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5410    1235216  61. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5410    1235592  62. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5410    1235592  63. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5410    1236344  64. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5410    1236344  65. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5410    1236344  66. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5410    1236720  67. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5410    1236720  68. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5410    1237472  69. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5410    1237472  70. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5410    1237472  71. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5410    1237848  72. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5410    1237848  73. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5410    1238600  74. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5410    1238600  75. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5410    1238600  76. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5410    1238976  77. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5410    1238976  78. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5410    1239728  79. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5410    1239728  80. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5410    1239728  81. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5410    1240104  82. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5411    1240104  83. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5411    1240856  84. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5411    1240856  85. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5411    1240856  86. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5411    1241232  87. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5411    1241232  88. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5411    1241984  89. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5411    1241984  90. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5411    1241984  91. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5411    1242360  92. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5411    1242360  93. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5411    1243112  94. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5411    1243112  95. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5411    1243112  96. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5411    1243488  97. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5411    1243488  98. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5411    1244240  99. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5411    1244240 100. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5411    1244240 101. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5411    1244616 102. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5411    1244616 103. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5411    1245368 104. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5411    1245368 105. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5411    1245368 106. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5412    1245744 107. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5412    1245744 108. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5412    1246496 109. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5412    1246496 110. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5412    1246496 111. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5412    1246872 112. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5412    1246872 113. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5412    1247624 114. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5412    1247624 115. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5412    1247624 116. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5412    1248000 117. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5412    1248000 118. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5412    1248752 119. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5412    1248752 120. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5412    1248752 121. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5412    1249128 122. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5412    1249128 123. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5412    1249880 124. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5412    1249880 125. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5412    1249880 126. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5412    1250256 127. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5412    1250256 128. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5413    1251008 129. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5413    1251008 130. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5413    1251008 131. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5413    1251384 132. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5413    1251384 133. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5413    1252136 134. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5413    1252136 135. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5413    1252136 136. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5413    1252512 137. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5413    1252512 138. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5413    1253264 139. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5413    1253264 140. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5413    1253264 141. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5413    1253640 142. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5413    1253640 143. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5413    1254392 144. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5413    1254392 145. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5413    1254392 146. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5413    1254768 147. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5413    1254768 148. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5413    1255520 149. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5413    1255520 150. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5413    1255520 151. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5413    1255896 152. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5413    1255896 153. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5414    1256648 154. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5414    1256648 155. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5414    1256648 156. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5414    1257024 157. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5414    1257024 158. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5414    1257776 159. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5414    1257776 160. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5414    1257776 161. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5414    1258152 162. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5414    1258152 163. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5414    1258904 164. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5414    1258904 165. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5414    1258904 166. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5414    1259280 167. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5414    1259280 168. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5414    1260032 169. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5414    1260032 170. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5414    1260032 171. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5414    1260408 172. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5414    1260408 173. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5415    1261160 174. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5415    1261160 175. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5415    1261160 176. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5415    1261536 177. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5415    1261536 178. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5415    1262288 179. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5415    1262288 180. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5415    1262288 181. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5415    1262664 182. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5415    1262664 183. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5415    1263416 184. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5415    1263416 185. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5415    1263416 186. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5415    1263792 187. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5415    1263792 188. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5415    1264544 189. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5415    1264544 190. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5415    1264544 191. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5415    1264920 192. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5415    1264920 193. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5415    1265672 194. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5416    1265672 195. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5416    1265672 196. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5416    1266048 197. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5416    1266048 198. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5416    1266800 199. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5416    1266800 200. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5416    1266800 201. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5416    1267176 202. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5416    1267176 203. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5416    1267928 204. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5416    1267928 205. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5416    1267928 206. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5416    1268304 207. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5416    1268304 208. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5416    1269056 209. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5416    1269056 210. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5416    1269056 211. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5416    1269432 212. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5416    1269432 213. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5416    1270184 214. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5416    1270184 215. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5416    1270184 216. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5416    1270560 217. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5417    1270560 218. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5417    1271312 219. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5417    1271312 220. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5417    1271312 221. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5417    1271688 222. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5417    1271688 223. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5417    1272440 224. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5417    1272440 225. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5417    1272440 226. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5417    1272816 227. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5417    1272816 228. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5417    1273568 229. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5417    1273568 230. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5417    1273568 231. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5417    1273944 232. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5417    1273944 233. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5417    1274696 234. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5417    1274696 235. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5417    1274696 236. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5417    1275072 237. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5417    1275072 238. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5417    1275824 239. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5417    1275824 240. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5417    1275824 241. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5418    1276200 242. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5418    1276200 243. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5418    1276952 244. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5418    1276952 245. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5418    1276952 246. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5418    1277328 247. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5418    1277328 248. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5418    1278080 249. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5418    1278080 250. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5418    1278080 251. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351
    0.5418    1278456 252. JmesPath\Parser->led_lbracket() /Library/WebServer/Documents/jmespath.php/src/Parser.php:99
    0.5418    1278456 253. JmesPath\Parser->parseWildcardArray() /Library/WebServer/Documents/jmespath.php/src/Parser.php:213
    0.5418    1279208 254. JmesPath\Parser->parseProjection() /Library/WebServer/Documents/jmespath.php/src/Parser.php:393
    0.5418    1279208 255. JmesPath\Parser->parseDot() /Library/WebServer/Documents/jmespath.php/src/Parser.php:336
    0.5418    1279208 256. JmesPath\Parser->expr() /Library/WebServer/Documents/jmespath.php/src/Parser.php:351

make: *** [perf] Error 255

Allow filter by object

hi. Does it support to travers object? when data is loaded with json serializer for example, the result data set if fully loaded object.

Expression tokenizes incorrectly on EC2.

This has taken me hours to debug. I've not found the problem due to not being able to xdebug the remote env, but here we go:

I have an expression which is being tokenized incorrectly on EC2 for reasons which i can't figure out. for what i can see php versions and extensions are mostly identical.

I've come to this conclusion by switching to the compiler runtime and comparing the generated cache file.

See the following gist for the two generated files.
https://gist.github.com/bendavies/2d3d9e3c7b5d0b925259

incorrect.php is generated on ec2.

The line to note is number 23.
Notice how the value is incorrect in incorrect.php

I know this a terrible bug report with no information that lets you reproduce the bug.
Please let me know what you need.

Many thanks in advance.

P.S
Oh, and the jmespath.php testsuite passes just fine on the ec2 server.

Support for "and expressions" in filters

I had a few issues with the Ruby jmespath implementation (see jmespath/jmespath.rb#13) so I thought I'd see what the behaviour here was.

My main problem was that and expressions in filters didn't work and that seems to be the case for the PHP implementation too.

/*
 Should return null, instead fails with
Syntax error at character 6
[?foo && bar]
      ^
Expected a closing rbracket for the filter
*/
JMESPath\search('[?foo && bar]', (object) []);

/* On the off chance it's a problem parsing unary filters in combination with and expressions I tried
this, but same problem
Syntax error at character 15
[?foo == `bar` && bar == `blarg`]
               ^
Expected a closing rbracket for the filter
*/
JMESPath\search('[?foo == `bar` && bar == `blarg`]', (object) []);

Unlike the ruby implementation, or expressions do work as expected. There is some weirdness with string matching (variables delimited by single quotes and double quotes parse, but single quotes matches correct and double quotes don't match at all; it appears in the current spec that single quotes are fine but double quotes should probably be a parse error. The current spec also doesn't seem to accept backtick delimited strings, but the PHP lib does while the Ruby one doesn't) but otherwise it just seems that and expressions aren't supported.

If support for this hasn't been implemented yet (although the spec is from July '14, I can't see when it was accepted, and I notice that the JS version has only recently added support in jmespath/jmespath.js#9) it would be useful to have a section indicating as yet unsupported features like this.

Retrieving first result from a filter

Filter expressions return an array of results, but is it possible to get the first result from a filter expression?

$data = json_decode('{"foo": [{"a": 1, "b": 1}, {"a": 2, "b": 2}]}', true);
$results = JmesPath\search('foo[?a==`1`].b', $data);

$results will contain an array of the results. i.e.

array (
  0 => 1,
)

but I only want 1.

i was thinking something like

'foo[?a==`1`][0].b'

but that doesn't work.

If this is not currently possible in the current spec, i think it would be a good addition.

Thanks

Composer install shows warning this package has an issue.

This package is a dependency for aws-sdk-php, suddenly I'm getting a message during composer installs.

Skipped installation of bin bin/jp.php for package mtdowling/jmespath.php: file not found in package

Not sure really why this is happening right now, and it doesn't really seem to cause any issues with our project, just thought you might want to know.

Composer error

Running composer require mtdowling/jmespath.php I get the following error:

Package operations: 1 install, 0 updates, 0 removals
  - Installing mtdowling/jmespath.php (2.6.0): Extracting archive
    Install of mtdowling/jmespath.php failed

Installation failed, reverting ./composer.json to its original content.

  [ErrorException]                                                                                                                  
  file_get_contents(/home/vagrant/code/vendor/mtdowling/jmespath.php/bin/jp.php): Failed to open stream: No such file or directory 

I don't know what I can do. It seems a package issue. Anyone have the same problem?

  • PHP 8.0.1

Parse error for "[[*],*]"

Using commit 06e9805:

$ echo '""' | php bin/jp.php '[[*],*]'
Expression
==========

[[*],*]

Tokens
======

  0  T_LBRACKET     "["
  1  T_LBRACKET     "["
  2  T_STAR         "*"
  3  T_RBRACKET     "]"
  4  T_COMMA        ","
  5  T_STAR         "*"
  6  T_RBRACKET     "]"

PHP Fatal error:  Uncaught exception 'JmesPath\SyntaxErrorException' with message 'Syntax error at character 1
[[*],*]
 ^
Expected T_NUMBER or T_STAR or T_COLON or T_IDENTIFIER or T_LITERAL or T_FUNCTION or T_FILTER; found T_LBRACKET "["' in jmespath.php/src/TokenStream.php:64
Stack trace:
#0 jmespath.php/src/Parser.php(345): JmesPath\TokenStream->next(Array)
#1 jmespath.php/src/Parser.php(98): JmesPath\Parser->parse_T_LBRACKET(NULL)
#2 jmespath.php/src/Parser.php(83): JmesPath\Parser->parseExpression()
#3 jmespath.php/src/Runtime/AbstractRuntime.php(93): JmesPath\Parser->parse('[[*],*]')
#4 jmespath.php/src/Runtime/DefaultRuntime.php(66): JmesPath\Runtime\AbstractRuntime->printDebugAst(Resource id #2, '[[*],*]')
#5 jmespath.php/bin/jp.php(91): JmesPath\Runtime\DefaultRuntime->debug('[[*],*]', '')
#6 {main}
  thrown in jmespath.php/src/TokenStream.php on line 64

Fatal error: Uncaught exception 'JmesPath\SyntaxErrorException' with message 'Syntax error at character 1
[[*],*]
 ^
Expected T_NUMBER or T_STAR or T_COLON or T_IDENTIFIER or T_LITERAL or T_FUNCTION or T_FILTER; found T_LBRACKET "["' in jmespath.php/src/TokenStream.php:64
Stack trace:
#0 jmespath.php/src/Parser.php(345): JmesPath\TokenStream->next(Array)
#1 jmespath.php/src/Parser.php(98): JmesPath\Parser->parse_T_LBRACKET(NULL)
#2 jmespath.php/src/Parser.php(83): JmesPath\Parser->parseExpression()
#3 jmespath.php/src/Runtime/AbstractRuntime.php(93): JmesPath\Parser->parse('[[*],*]')
#4 jmespath.php/src/Runtime/DefaultRuntime.php(66): JmesPath\Runtime\AbstractRuntime->printDebugAst(Resource id #2, '[[*],*]')
#5 jmespath.php/bin/jp.php(91): JmesPath\Runtime\DefaultRuntime->debug('[[*],*]', '')
#6 {main}
  thrown in jmespath.php/src/TokenStream.php on line 64

A multi-select-list can be:

multi-select-list = "[" ( expression *( "," expression ) "]"

And [*] and * and valid expressions.

Syntax errors with hypens in object key

I get the following exception:

JmesPath\SyntaxErrorException : Syntax error at character 23
data.relationships.flow-actions.data[].id
                       ^
Did not reach the end of the token stream

With a JSON document like:

{
  "data": {
    "type": "flows",
    "id": "e365203f-b386-4ff0-903e-4c5d275a6988",
    "attributes": {
      "name": "Patient Intake",
      "details": "Intake of a new Dialysis patient.",
      "updated_at": "2020-01-07T16:53:25.174226+00:00",
      "created_at": "2020-01-07T16:53:25.169026+00:00"
    },
    "relationships": {
      "flow-actions": {
        "links": {
          "related": "http://localhost:8080/flows/e365203f-b386-4ff0-903e-4c5d275a6988/flow-actions"
        },
        "data": [
          {
            "type": "flow-actions",
            "id": "6a7f3aae-6bb3-4b80-af4c-cdeb209503d0"
          }
        ]
      }
    },
    "links": {
      "self": "http://localhost:8080/flows/e365203f-b386-4ff0-903e-4c5d275a6988"
    }
  }
}

The same expression works correctly with the http://jmespath.org/ demo on the home page.

Failing test on Debian

Hi,

The latest 2.2.0 version fails one of its tests on Debian (that uses the jsonc implementation instead of the embedded one from PHP because of a licensing issue):

$ phpunit tests/LexerTest.php
PHPUnit 4.2.6 by Sebastian Bergmann.

Configuration read from /home/taffit/debian/php-jmespath/phpunit.xml.dist

.............................F.

Time: 87 ms, Memory: 3.75Mb

There was 1 failure:

1) JmesPath\Tests\LexerTest::testTokenizesJsonNumbers
Failed asserting that 2014 matches expected '2014-12'.

/home/taffit/debian/php-jmespath/tests/LexerTest.php:79

FAILURES!                              
Tests: 31, Assertions: 43, Failures: 1.

Running this same test against the previous 2.1.0 version works without any issue.

Regards

David

Catchable fatal error when parsing '*||*|*|*'

Looks like it parses properly but generates an error when calling the TreeInterpreter:

$ echo '""' | php bin/jp.php '*||*|*|*'
...
Data
====

""

PHP Catchable fatal error:  Argument 1 passed to JmesPath\Tree\TreeInterpreter::dispatch() must be of the type array, null given, called in jmespath.php/src/Tree/TreeInterpreter.php on line 135 and defined in jmespath.php/src/Tree/TreeInterpreter.php on line 33

Catchable fatal error: Argument 1 passed to JmesPath\Tree\TreeInterpreter::dispatch() must be of the type array, null given, called in jmespath.php/src/Tree/TreeInterpreter.php on line 135 and defined in jmespath.php/src/Tree/TreeInterpreter.php on line 33

Unexpected empty array returned on expression rather than NULL

I just wanted to confirm / point out that I am receiving back a value from the below method that is different from the code comments:

\JmesPath\Env::search($expression, $data);

https://github.com/jmespath/jmespath.php/blob/master/src/Env.php#L25

The document block states that I should @return mixed Returns the matching data or null receive matching data or null but I have found that when I utilise this with object or list projection like:

included[?type=='paragraph--basic_text'] as long as the included array exists in the JSON, it will return an empty array rather than a NULL value.

Can I confirm that this is the expected behaviour?

Checking the tutorial website I get the same result in different versions of jmespath.

Thank you very much for the package. I am utilising it in integration testing to evaluate json responses which is incredibly useful.

Implement boolean strict option in search flow

Current Situation

Currently, when using the JMES search package in PHP, if the provided expression does not match any elements inside the array, the result is returned as null.

Problem

As a developer, this poses an issue because receiving a null value does not provide sufficient information to determine whether the null value is due to the absence of the expression in the data or if the corresponding value in the array is intentionally null.

Desired Situation

It would be beneficial to have a boolean strict option available in the JMES search package. This option would allow developers to indicate that if an expression does not exist in the current data, an exception should be thrown instead of returning a null value. By receiving an exception, developers can easily identify the source of the issue and distinguish between the absence of the expression and intentionally null values in the array.

Expected Benefits

  • Improved Error Handling: The exception will provide clear information about the source of the issue, allowing for easier debugging and error resolution.
  • Accurate Null Value Detection: Developers can differentiate between the absence of an expression and intentional null values in the array, enabling better decision-making based on the search results.

Implementing this boolean strict option will enhance the usability and reliability of the JMES search package in PHP for developers, providing a more informative and predictable search experience.

Modify object

It would be a great feature to be able to modify the data.

Version of jmespath that returns by reference

I had the need to edit fields within a large array, and I patched up a version of the TreeInterpreter to pass and return everything by reference to enable things. The patch is the obvious additions of &s, and rewriting the ternary operators to use standard ifs.

Would you be interested in this upstream. Its a small patchset, but i'm guessing it would need to be a new engine because the reference version should be slightly slower.

Invalid autoload.php path in jp.php

When using composer, jp.php gets installed in vendor/bin directory.
The following path of autoload.php is wrong

require __DIR__ . '/../vendor/autoload.php';

The correct require statement should be:

require __DIR__ . '/../autoload.php';

This implementation of JMESPath fails greater-than-or-equals comparison

For the expression

[? class == `primary` && effective_date >= `2024-03-01` ]

with the following JSON:

[
  {
    "id": 1,
    "class": "primary",
    "effective_date": "2024-06-01"
  },
  {
    "id": 2,
    "class": "secondary",
    "effective_date": "2024-01-01"
  },
  {
    "id": 3,
    "class": "primary",
    "effective_date": "2024-03-01"
  }
]

There should be exactly one match (id: 3).

With the JMESPath debugger on https://jmespath.org/ this works as expected, but with this package the result is null.

Custom functions?

Hi Michael,

Do you have a suggestion on how to cleanly add custom functions?

I understand I can extend FnDispatcher, but to make the runtimes use that new dispatcher I had to copy and alter the JmesPath\Env code, as well as CompilerRuntime too.

Anyway, I really feel ignorant here, I should be doing it the hard way...

Thanks for you time, and sorry to add this as an Issue here.

Congratulations for your great work on Guzzle, AWS 3 and transducers.

Combined syntax compliance

We currently fail on the following upstream compliance tests:

  {
    "comment": "Combined syntax",
    "given": [],
    "cases": [
        {
          "expression": "*||*|*|*",
          "result": null
        },
        {
          "expression": "*[]||[*]",
          "result": []
        },
        {
          "expression": "[*.*]",
          "result": [null]
        }
    ]
  }

The first and last case are incorrect, but we handle the middle case correctly at the moment.

Edge Case: SyntaxErrorException throws ValueError in PHP 8

In the SyntaxErrorException.php the message formatting code (lines 19 and 20 to be more precise), uses str_repeat with $token['pos'] for its $times parameter, which will position the arrow (^) in the exception message, working as an indicator of the invalid symbol in the expression that was evaluated as path (as seen below).

php > (new JmesPath\Parser(new JmesPath\Lexer()))->parse(';');
PHP Warning:  Uncaught JmesPath\SyntaxErrorException: Syntax error at character 0
;
^
Unexpected "unknown" token (nud_unknown). Expected one of the following tokens: "identifier", "quoted_identifier", "current", "literal", "expref", "not", "lparen", "lbrace", "flatten", "filter", "star", "lbracket" in /Users/flavio/Documents/open-source/jmespath.php/src/Parser.php:466
Stack trace:
#0 /Users/flavio/Documents/open-source/jmespath.php/src/Parser.php(515): JmesPath\Parser->syntax('Unexpected "unk...')
#1 /Users/flavio/Documents/open-source/jmespath.php/src/Parser.php(97): JmesPath\Parser->__call('nud_unknown', Array)
#2 /Users/flavio/Documents/open-source/jmespath.php/src/Parser.php(79): JmesPath\Parser->expr()
#3 php shell code(1): JmesPath\Parser->parse(';')
#4 {main}
  thrown in /Users/flavio/Documents/open-source/jmespath.php/src/Parser.php on line 466

That works fine as long as the expression is successfully parsed and therefore assigns a positive value for $token['pos'], but I found out that for some invalid expressions (say an equal sign, for whatever reason), $token['pos'] gets assigned -1 from start and as the parsing fails before assigning a different value to it, it will be kept a negative value, thus being used like that in str_repeat.

From the PHP Manual, we can see what $time works for and its restrictions as follows:

times

Number of time the string string should be repeated.
times has to be greater than or equal to 0. If the times is set to 0, the function will return an empty string.

Note that although not being documented, passing a negative value for $time leads str_repeat to return NULL instead of an empty string and to also emit a Warning (PHP 7) or throw a ValueError (PHP 8):

// php 7
php > var_dump(str_repeat(' ', -1));
PHP Warning:  str_repeat(): Second argument has to be greater than or equal to 0 in php shell code on line 1

Warning: str_repeat(): Second argument has to be greater than or equal to 0 in php shell code on line 1
NULL
// php 8
php > var_dump(str_repeat(' ', -1));
PHP Warning:  Uncaught ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 in php shell code:1
Stack trace:
#0 php shell code(1): str_repeat(' ', -1)
#1 {main}
  thrown in php shell code on line 1

Warning: Uncaught ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 in php shell code:1
Stack trace:
#0 php shell code(1): str_repeat(' ', -1)
#1 {main}
  thrown in php shell code on line 1

This is, IMO, an edge case for both the Parser and SyntaxErrorException that most library users will not be facing in regular usage, but worth fixing.

Double quotes around literal values not rejected but do not match.

The literal expressions and raw string literals sections of the specification permit literals to be delimited by backticks or single quotes, but jmespath.php is partially allowing double quotes as well; no parse error is returned, but matching doesn't take place. This behaviour is possibly confusing for users that incorrectly try to use double quotes; a parse error, ideally indicating that they should use single quotes or backticks, would be more informative.

// Expected: parse error
// Actual: []
JMESPath\search('[?foo == "bar"]', [['foo' => 'bar']])

Env.php is missing in src folder

Env.php file in src directory is missing when downloaded from composer for version 2.4

Packages which requires Jmespath package may break unexpectedly if not fixed.

"Undefined index: T_NUMBER" when parsing "*.[0]"

Just synced with the latest master (f471739) and I get the following error printed in an infinite loop when I try to parse *.[0]:

$ echo '""' | bin/jp.php '*.[0]'
Notice: Undefined index: T_NUMBER in jmespath.php/src/Parser.php on line 93
PHP Notice:  Undefined index: T_NUMBER in jmespath.php/src/Parser.php on line 93

Cannot redeclare JmesPath\search()

I see that you fixed this issue in master. Could you please Git TAG it?

The AWS SDK depends on your library and it is buggy for us right because of this bug.
If you tag it we should be able to get this fix when updating their SDK

That is the dependency AWS SDK is using:
"mtdowling/jmespath.php": "~2.2"

That would greatly help!
Thank you

Tag release

Hi Michael,

Great looking library!
Any chance of tagging a release (even if it's not stable yet)?
I just want to speed composer up a bit.

Thanks

Zero returning null result

When a key is zero integer/string the result is null. See examples below.

\JmesPath\Env::search('data.*.id', [
    'data' => [
        0 => [
            'id' => 7
        ],
    ],
]); // null

\JmesPath\Env::search('data.*.id', [
    'data' => [
        '0' => [
            'id' => 7
        ],
    ],
]); // null

\JmesPath\Env::search('data.*.id', [
    'data' => [
        1 => [
            'id' => 7
        ],
    ],
]); // [7]

\JmesPath\Env::search('data.*.id', [
    'data' => [
        '1' => [
            'id' => 7
        ],
    ],
]); // [7]

Unexpected result parsing slice syntax

It looks like the parseArrayIndexExpression does not validate the colons must be between numbers, which results in the last number before the rbracket being used as the value for an index node:

$ echo '[0,1,2,3,4,5,6,7,8,9]' | php bin/jp.php "[2 4 5 6 7]"
Expression
==========

[2 4 5 6 7]

Tokens
======

  0  lbracket       "["
  1  number         2
  3  number         4
  5  number         5
  7  number         6
  9  number         7
 10  rbracket       "]"
 11  eof            null

AST
========

{
    "type": "index",
    "index": 7
}

Data
====

[
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
]


Result
======

7

Time
====

Lexer time:     0.224113 ms
Parse time:     0.100851 ms
Interpret time: 0.016928 ms
Total time:     0.117779 ms

aws/aws-sdk-php issues due to this file

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for mtdowling/jmespath.php (locked at 2.4.0) -> satisfiable by mtdowling/jmespath.php[2.4.0].
- aws/aws-sdk-php 3.135.0 requires mtdowling/jmespath.php ^2.5 -> satisfiable by mtdowling/jmespath.php[2.5.0].
- aws/aws-sdk-php 3.135.1 requires mtdowling/jmespath.php ^2.5 -> satisfiable by mtdowling/jmespath.php[2.5.0].
- Conclusion: don't install mtdowling/jmespath.php 2.5.0
- Installation request for aws/aws-sdk-php ^3.135 -> satisfiable by aws/aws-sdk-php[3.135.0, 3.135.1].

PHP 7.2 compatibility issues with PHPUnit

$ php --version
PHP 7.2.0 (cli) (built: Dec  3 2017 21:46:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.2.0, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.6.0alpha1, Copyright (c) 2002-2017, by Derick Rethans

On a fresh clone of the repo, I installed the Composer dependencies and ran make test.

$ make test
vendor/bin/phpunit
PHP Deprecated:  The each() function is deprecated. This message will be suppressed on further calls in /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/Util/Getopt.php on line 38
PHP Stack trace:
PHP   1. {main}() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/phpunit:52
PHP   3. PHPUnit_TextUI_Command->run() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/TextUI/Command.php:100
PHP   4. PHPUnit_TextUI_Command->handleArguments() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/TextUI/Command.php:111
PHP   5. PHPUnit_Util_Getopt::getopt() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/TextUI/Command.php:240
PHP   6. each() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/Util/Getopt.php:38

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/Util/Getopt.php on line 38

Call Stack:
    0.0004     407152   1. {main}() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/phpunit:0
    0.0037     768528   2. PHPUnit_TextUI_Command::main() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/phpunit:52
    0.0038     768640   3. PHPUnit_TextUI_Command->run() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/TextUI/Command.php:100
    0.0038     768640   4. PHPUnit_TextUI_Command->handleArguments() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/TextUI/Command.php:111
    0.0040     797136   5. PHPUnit_Util_Getopt::getopt() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/TextUI/Command.php:240
    0.0041     797560   6. each() /Library/WebServer/Documents/jmespath.php/vendor/phpunit/phpunit/src/Util/Getopt.php:38

PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

.............................................................   61 / 3511 (  1%)
.............................................................  122 / 3511 (  3%)
.............................................................  183 / 3511 (  5%)
.............................................................  244 / 3511 (  6%)
.............................................................  305 / 3511 (  8%)
.............................................................  366 / 3511 ( 10%)
.............................................................  427 / 3511 ( 12%)
.............................................................  488 / 3511 ( 13%)
.............................................................  549 / 3511 ( 15%)
.............................................................  610 / 3511 ( 17%)
.............................................................  671 / 3511 ( 19%)
.............................................................  732 / 3511 ( 20%)
.............................................................  793 / 3511 ( 22%)
.............................................................  854 / 3511 ( 24%)
.............................................................  915 / 3511 ( 26%)
.............................................................  976 / 3511 ( 27%)
............................................................. 1037 / 3511 ( 29%)
............................................................. 1098 / 3511 ( 31%)
............................................................. 1159 / 3511 ( 33%)
............................................................. 1220 / 3511 ( 34%)
............................................................. 1281 / 3511 ( 36%)
............................................................. 1342 / 3511 ( 38%)
............................................................. 1403 / 3511 ( 39%)
............................................................. 1464 / 3511 ( 41%)
............................................................. 1525 / 3511 ( 43%)
............................................................. 1586 / 3511 ( 45%)
............................................................. 1647 / 3511 ( 46%)
............................................................. 1708 / 3511 ( 48%)
............................................................. 1769 / 3511 ( 50%)
............................................................. 1830 / 3511 ( 52%)
............................................................. 1891 / 3511 ( 53%)
............................................................. 1952 / 3511 ( 55%)
............................................................. 2013 / 3511 ( 57%)
............................................................. 2074 / 3511 ( 59%)
............................................................. 2135 / 3511 ( 60%)
............................................................. 2196 / 3511 ( 62%)
............................................................. 2257 / 3511 ( 64%)
............................................................. 2318 / 3511 ( 66%)
............................................................. 2379 / 3511 ( 67%)
............................................................. 2440 / 3511 ( 69%)
............................................................. 2501 / 3511 ( 71%)
............................................................. 2562 / 3511 ( 72%)
............................................................. 2623 / 3511 ( 74%)
............................................................. 2684 / 3511 ( 76%)
............................................................. 2745 / 3511 ( 78%)
............................................................. 2806 / 3511 ( 79%)
............................................................. 2867 / 3511 ( 81%)
............................................................. 2928 / 3511 ( 83%)
............................................................. 2989 / 3511 ( 85%)
............................................................. 3050 / 3511 ( 86%)
............................................................. 3111 / 3511 ( 88%)
............................................................. 3172 / 3511 ( 90%)
............................................................. 3233 / 3511 ( 92%)
............................................................. 3294 / 3511 ( 93%)
............................................................. 3355 / 3511 ( 95%)
............................................................. 3416 / 3511 ( 97%)
............................................................. 3477 / 3511 ( 99%)
..................................

Time: 4.62 seconds, Memory: 18.00MB

OK (3511 tests, 3544 assertions)

The version of PHPUnit included is too old, and uses functions which were deprecated in PHP 7.2. Updating to a currently-supported version of PHPUnit should resolve these issues.

security issue

Dear

After I scan the library, I found that

on file: perf.php 18

function runSuite($file)
{
$contents = file_get_contents($file);
$json = json_decode($contents, true);
$total = 0;
foreach ($json as $suite) {
foreach ($suite['cases'] as $case) {
$total += runCase(
$suite['given'],
$case['expression'],
$case['name']
);
}
}
return $total;
}

External Control of File Name or Path

can you explain to me if that is a risk?

thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.