I don't have PHP experience, but I have an understanding of the Python standard library.
For your purposes, Python has several methods:
logging module;
Object serialization module which is called pickle. You may write your own wrapper of the pickle module.
If your using var_dump
for testing, Python has its own doctest and unittest modules. It's very simple and fast for design.