var_dump of a File object

Permalink
it is possible to use var_dump() on a file object ? (File::getByID())
i get a huge output whith thousands of line that cause a max_memory error.



thanks

retinasnc
 
ramonleenders replied on at Permalink Reply
ramonleenders
Surely possible, but your system can't handle it. Why you need to dump it in the first place? If you want to know if it's a real file, check it against its class or if it's an object?
retinasnc replied on at Permalink Reply
retinasnc
thank you for your answer and sorry for my late response, i had a strange behaviour with that object, i get "not object" error even i was sure the object exist.
now i think it is solved.
i'm not sure but i think the problem was due to multiple instance of the block in the same page, so in some way the file object i was debugging where overwritten by other blocks.

thank you
ebmudcom replied on at Permalink Reply
ebmudcom
<?php
$file = \File::getByID(420);
var_dump_safe($file);
retinasnc replied on at Permalink Reply
retinasnc
thank for your answer, i didn't know about var_dump_safe(), you helped me a lot,