I coded a php class to represent a query-result. On an incoming query I cast it to an array, convert it to JSON (per json_encode) and return it to the user.
Now I want to define a class intern “debug” attribute, which souldn’t be in the output – how can I hide attributes on casting a class to an array?
Declare it
privateorprotected.Result:
NB. Requires PHP 5, see Visibility in the PHP manual.