3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $username = 'neon1024'; $query = '{ "query": { "filtered": { "filter": { "nested": { "path": "leagues_users", "query": { "bool": { "must": [ { "match": {"leagues_users.user.username": "' . $username . '"} } ] } } } } } } }'; var_dump(json_decode($query));
based on 6OhM5
Output for 7.0.0 - 7.2.0
object(stdClass)#9 (1) { ["query"]=> object(stdClass)#8 (1) { ["filtered"]=> object(stdClass)#7 (1) { ["filter"]=> object(stdClass)#6 (1) { ["nested"]=> object(stdClass)#1 (2) { ["path"]=> string(13) "leagues_users" ["query"]=> object(stdClass)#5 (1) { ["bool"]=> object(stdClass)#4 (1) { ["must"]=> array(1) { [0]=> object(stdClass)#3 (1) { ["match"]=> object(stdClass)#2 (1) { ["leagues_users.user.username"]=> string(8) "neon1024" } } } } } } } } } }
Output for 5.3.22 - 5.6.28
object(stdClass)#1 (1) { ["query"]=> object(stdClass)#2 (1) { ["filtered"]=> object(stdClass)#3 (1) { ["filter"]=> object(stdClass)#4 (1) { ["nested"]=> object(stdClass)#5 (2) { ["path"]=> string(13) "leagues_users" ["query"]=> object(stdClass)#6 (1) { ["bool"]=> object(stdClass)#7 (1) { ["must"]=> array(1) { [0]=> object(stdClass)#8 (1) { ["match"]=> object(stdClass)#9 (1) { ["leagues_users.user.username"]=> string(8) "neon1024" } } } } } } } } } }