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

PHP Catchable fatal error #174

Open
voidabhi opened this issue Feb 10, 2016 · 3 comments
Open

PHP Catchable fatal error #174

voidabhi opened this issue Feb 10, 2016 · 3 comments
Assignees
Labels

Comments

@voidabhi
Copy link

PHP Catchable fatal error:  Object of class stdClass could not be converted to string in path/to/project/vendor/voryx/thruway/src/Thruway/CallResult.php on line 39
@RafaelKa
Copy link

@voidabhi: Hmmm, i think there is to few informations. Could you please make some more references about context for this error? Maybe providing small code snippets, etc.

@voidabhi
Copy link
Author

@RafaelKa : the error is in the line where i am printing result (\Thruway\CallResult) object

        function ($res) {
            echo "Result: {$res}\n";
        }

In CallResult.php i noticed toString function is assuming the response from server a numerically indexed array

So i fixed the issue by sending array instead of dictionary from server

So instead of sending : (Not Working)

        {
            "ok": true
        }

I am sending now : (Working)

       [{
            "ok": true
       }]

@mbonneau mbonneau added the bug label Feb 15, 2016
@mbonneau
Copy link
Member

This is a bug - we should not assume "set" means "able to be converted to string":

return isset($this[0]) ? (string)$this[0] : "";

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

No branches or pull requests

4 participants