Skip to content
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

[BUG]: phalcon/Storage/Serializer/Json.zep can't serialize stdClass #16630

Open
pwtitle opened this issue Jul 28, 2024 · 0 comments
Open

[BUG]: phalcon/Storage/Serializer/Json.zep can't serialize stdClass #16630

pwtitle opened this issue Jul 28, 2024 · 0 comments
Labels
bug A bug report status: unverified Unverified

Comments

@pwtitle
Copy link

pwtitle commented Jul 28, 2024

phalcon/Storage/Serializer/Json.zep can't serialize stdClass

        $serializerFactory = new \Phalcon\Storage\SerializerFactory();
        $adapterFactory    = new \Phalcon\Cache\AdapterFactory($serializerFactory);

        $adapter = $adapterFactory->newInstance('redis', [
            'defaultSerializer' => 'Json',
            "host"              => "***",
            'lifetime'          => 7200,
            "auth"              => "****",
        ]);
        $cache = new \Phalcon\Cache\Cache($adapter);

        $who = new \stdClass();
        $who->name = "testName";

        $cache->set("test", $who);  // this line get error: Data for the JSON serializer cannot be of type 'object' without implementing 'JsonSerializable'

Screenshots
123

Details

  • Phalcon version: 5.8.0
  • PHP Version: 8.3.9
@pwtitle pwtitle added bug A bug report status: unverified Unverified labels Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: unverified Unverified
Projects
None yet
Development

No branches or pull requests

1 participant