Using APCu in phpunit

I have some tests using the apcu extension:

For some reason apcu_fetch always return false.

am I missing something here? I can’t put that simple test to work.

I’m using:

  • php 5.6.17

  • xdebug 2.33

  • phpunit 5.7.20

  • apcu 4.0.11 (enabled)

    ubuntu@box661:~/circuit-breaker$ php -a
    Interactive shell

    php > $myVar = 40;
    php > apcu_store(‘my-key’, $myVar);
    php > var_dump(apcu_fetch(‘my-key’));
    php >

Thank you in advance.

If you are from Google search: you need apc.enable_cli=‘on’ in php.ini

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.