Skip to content

[PHP 8.0.1 + memcached-3.1.5] Cannot use int as default value for parameter $with_cas of type bool in ProxyManager #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ruudk opened this issue Jan 29, 2021 · 9 comments

Comments

@ruudk
Copy link
Contributor

ruudk commented Jan 29, 2021

I'm using Memcached in a Symfony application together with LazyLoading. This uses https://github.com/Ocramius/ProxyManager to generate stubs like this:

class Memcached_f82f04b extends \Memcached implements \ProxyManager\Proxy\VirtualProxyInterface
{
    /**
     * @var \Memcached|null wrapped object, if the proxy is initialized
     */
    private $valueHolderd5e48 = null;

    /**
     * @var \Closure|null initializer responsible for generating the wrapped object
     */
    private $initializerb9143 = null;

    /**
     * @var bool[] map of public properties of the parent class
     */
    private static $publicProperties198ff = [
        
    ];

    public function getDelayed(array $keys, $with_cas = null, $value_cb = null)
    {
        $this->initializerb9143 && ($this->initializerb9143->__invoke($valueHolderd5e48, $this, 'getDelayed', array('keys' => $keys, 'with_cas' => $with_cas, 'value_cb' => $value_cb), $this->initializerb9143) || 1) && $this->valueHolderd5e48 = $valueHolderd5e48;

        return $this->valueHolderd5e48->getDelayed($keys, $with_cas, $value_cb);
    }

    public function getDelayedByKey($server_key, array $keys, $with_cas = null, $value_cb = null)
    {
        $this->initializerb9143 && ($this->initializerb9143->__invoke($valueHolderd5e48, $this, 'getDelayedByKey', array('server_key' => $server_key, 'keys' => $keys, 'with_cas' => $with_cas, 'value_cb' => $value_cb), $this->initializerb9143) || 1) && $this->valueHolderd5e48 = $valueHolderd5e48;

        return $this->valueHolderd5e48->getDelayedByKey($server_key, $keys, $with_cas, $value_cb);
    }

Somehow it's not able to correctly read the internals of the Memcached classes as it trips with this error:

PHP Fatal error:  Cannot use int as default value for parameter $with_cas of type bool in /home/runner/work/Website/Website/var/cache/test/ContainerDOLs3wx/KernelTestDebugContainer.php on line 122395

Could it be that this has something todo with stubs that are not yet released?

v3.1.5...master

If so, could a new tagged release solve it? 🙏

@ruudk
Copy link
Contributor Author

ruudk commented Jan 29, 2021

😅 I was under the impression that PHP 8 was already supported as everything else on my CI was just working fine 😅 but it seems that it's not yet done #466

@sodabrew
Copy link
Contributor

Just needs a release, the master branch is ready to go with PHP 8. Thanks for your patience until I get the release posted!

@ruudk
Copy link
Contributor Author

ruudk commented Jan 29, 2021

It would be so great if the master branch could be published as an alpha on PECL. Then it's easier to test this on CI and find issues that could impact final release. 🙏

@bbaga
Copy link

bbaga commented Apr 12, 2021

Hello, do you have an ETA on the next release? We've been building the package manually from master for PHP 8, but it isn't ideal.

@ruudk
Copy link
Contributor Author

ruudk commented Apr 16, 2021

@sodabrew Is there a way to sponsor you ?

@notdefine
Copy link

@sodabrew Is there a way to sponsor you ?

Do you have a Patron account?

@bbaga
Copy link

bbaga commented Sep 21, 2021

Bump

@jkbmaj
Copy link

jkbmaj commented Feb 21, 2022

+1

@GrahamCampbell
Copy link
Contributor

3.2.0RC2 is now available on pecl for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants