Why Doctrine Cache do not save raw php arrays?

I am using Doctrine Cache for my project and I am using it's PhpFileCache driver. https://github.com/doctrine/cache/blob/1.10.x/lib/Doctrine/Common/Cache/PhpFileCache.php
and I can't understand why it is not saving any of my data just in raw php array? instead it is save all of them like a serialised data with function to unserialise them. https://github.com/doctrine/cache/blob/1.10.x/lib/Doctrine/Common/Cache/PhpFileCache.php#L87-L93
if (is_object($data) && method_exists($data, '__set_state')) {
$value = var_export($value, true);
$code = sprintf('<?php return %s;', $value);
} else {
$value = var_export(serialize($value), true);
$code = sprintf('<?php return unserialize(%s);', $value);
}
I see. That there is some additional check here and all my data don't pass this condition for some reason, but if I will just leave this code:
$value = var_export($value, true);
$code = sprintf('<?php return %s;', $value);
it will save a raw php arrays in cache from all of my data and it is works.
Why this is happens? Why this condition do not works for me?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: gd library extension not available with this php installation.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.