3v4l.org

run code in 300+ PHP versions simultaneously
<?php class query_parser { function __construct($query_string) { print $query_string; } $filter = "this is where we would have the filter information"; } $qp = new query_parser('filter={age_group:[1,2,3]}'); echo $qp->$filter; ?>
Output for 5.4.0 - 5.4.28, 5.5.0 - 5.5.12
Parse error: syntax error, unexpected '$filter' (T_VARIABLE), expecting function (T_FUNCTION) in /in/dfiAi on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/dfiAi on line 7
Process exited with code 255.

preferences:
204.28 ms | 1386 KiB | 78 Q