{"record":{"id":"579183607bd6a801","repo":"phalcon/cphalcon","slug":"your-passed-parameter-does-not-have-the-same-class","errorCode":null,"errorMessage":"Your passed parameter does not have the same class as the parameter in defined function when checking if {roleName} can {access} {componentName}. Class passed: {passedClass} , Class in defined function: {expectedClass}.","messagePattern":"Your passed parameter does not have the same class as the parameter in defined function when checking if (.+?) can (.+?) (.+?)\\. Class passed: (.+?) , Class in defined function: (.+?)\\.","errorType":"exception","errorClass":"Phalcon\\Acl\\Exceptions\\ParameterTypeMismatch","httpStatus":null,"severity":"error","filePath":"phalcon/Acl/Adapter/Memory.zep","lineNumber":1034,"sourceCode":"                    reflectionClass->isInstance(componentObject) &&\n                    !hasComponent\n                ) {\n                    let hasComponent            = true,\n                        parametersForFunction[] = componentObject;\n                    let userParametersSizeShouldBe--;\n\n                    continue;\n                }\n\n                /**\n                 * This is some user defined class, check if his parameter\n                 * is instance of it\n                 */\n                if unlikely (isset(parameters[parameterToCheck]) &&\n                    is_object(parameters[parameterToCheck]) &&\n                    !reflectionClass->isInstance(parameters[parameterToCheck])\n                ) {\n                    throw new ParameterTypeMismatch(\n                        \"Your passed parameter does not have the \" .\n                        \"same class as the parameter in defined function \" .\n                        \"when checking if \" . roleName . \" can \" . access .\n                        \" \" . componentName . \". Class passed: \" .\n                        get_class(parameters[parameterToCheck]) .\n                        \" , Class in defined function: \" .\n                        reflectionClass->getName() . \".\"\n                    );\n                }\n            }\n\n            if isset parameters[parameterToCheck] {\n                /**\n                 * We can't check type of ReflectionParameter in PHP 5.x so\n                 * we just add it as it is\n                 */\n                let parametersForFunction[] = parameters[parameterToCheck];\n            }","sourceCodeStart":1016,"sourceCodeEnd":1052,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Acl/Adapter/Memory.zep#L1016-L1052","documentation":"After reading a reply line, BeanstalkConnection compares it against beanstalkd protocol error responses; 'UNKNOWN_COMMAND' means the server did not recognize the command verb the client sent. Phalcon's client speaks the beanstalkd 1.2 protocol subset, so this appears with servers implementing a different protocol version, a non-beanstalkd service on that port, or a desynced stream where a previous reply is misread as the command response.","triggerScenarios":"Connecting to a service that is not beanstalkd or a pre-1.2 fork missing commands the client uses; reading from a connection desynced by an earlier timeout/aborted read; proxies that rewrite the text protocol.","commonSituations":"Port 11300 pointing at another text-protocol service (typo'd port); exotic beanstalkd forks in legacy stacks; state corruption after network errors on persistent connections.","solutions":["Confirm the target is real beanstalkd 1.2+: printf \"stats\\r\\n\" | nc <host> 11300 should return a stats body.","Recreate the connection (disconnect then connect) — desynced streams produce bogus replies.","Upgrade or replace the server with a standard beanstalkd build.","Double-check host/port configuration for typos that point at a different service."],"exampleFix":"// before\n$connection = new BeanstalkConnection('127.0.0.1', 11300); // another service on 11300\n\n// after\n// verify the endpoint speaks the beanstalk 1.2 protocol:\n// $ printf \"stats\\r\\n\" | nc 127.0.0.1 11300\n$connection = new BeanstalkConnection('127.0.0.1', 11300);\ntry {\n    $connection->connect();\n} catch (\\Phalcon\\Queue\\Exceptions\\Exception $e) {\n    $connection->disconnect(); // drop desynced state\n    $connection->connect();\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    $stats = $connection->getTubeStats($tube);\n} catch (\\Phalcon\\Queue\\Exceptions\\Exception $e) {\n    if (in_array($e->getMessage(), ['UNKNOWN_COMMAND', 'BAD_FORMAT'], true)) {\n        $connection->disconnect();\n        $connection->connect(); // reset possibly desynced protocol state\n        $stats = $connection->getTubeStats($tube);\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Smoke-test the endpoint with printf \"stats\\r\\n\" | nc host 11300 when first wiring a server.","Pin a standard beanstalkd 1.2+ image/version in your infrastructure.","After any stream error, recreate the connection instead of reusing it."],"tags":["queue","beanstalk","protocol","server-error"],"backgroundTag":"protocol-mismatch","analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}