Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Plamen M

    (@plamenm)

    Hello @edouble74 ,

    Thank you for your reminder of the previous topics. After your initial report, our developers analyzed the reported issue. It is found it to be a corner case scenario which does not at all hinder the regular functionality of the plugin. However, if you do have a specific real site use case scenario, please provide step-by-step instructions for its recreation and we will gladly look into it further.

    Despite of this, I pinged our developers once again with your report here.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Hey @edouble74,

    Reviewed your findings. In support of SiteGround, what impact are your findings having on the performance of the plugin? Can you provide specific examples? It would help a lot.

    Thank you!

    Thread Starter midwestE

    (@edouble74)

    Specifically we have a plugin that uses the cache to store an array of the results of a process. When it is retrieved, since it is an empty array, the wp-object-cache.php get method incorrectly returns false. Because the subsequent function is strongly typed, the subsequent functions expecting an array will fatal error.

    function strong_type_function(array $array) {
    // do work
    }
    function another_function(): array {
    $should_be_array = wp_cache_get(‘my_array_items’);
    $result = strong_type_function($should_be_array);
    return $result;
    }

    // will fatal error
    wp_cache_set(‘my_array_items’, []);
    another_function();

    The above would fatal error because the get method returns false instead of the stored empty array. I’m sure you can imagine there are many other scenarios where returning a boolean when storing other types can be very problematic.

    Why would the cache not return exactly what was stored in all cases?

    • This reply was modified 6 months, 3 weeks ago by midwestE.
    • This reply was modified 6 months, 3 weeks ago by midwestE.

    Hi @edouble74,

    If you don’t mind sharing, what plugin are you using to store the array(s)?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Broken memcache dropin returns false for any value that evaluates empty($val)’ is closed to new replies.