We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HI,
I would like to retrieve the variable $argv[1] but I can't.
<?php require __DIR__ . '/vendor/autoload.php'; \Ratchet\Client\connect('wss://echo.websocket.org:443')->then(function($conn) { $conn->on('message', function($msg) use ($conn) { echo "Received: {$msg}\n"; $conn->close(); }); $conn->send($argv[1]); }, function ($e) { echo "Could not connect: {$e->getMessage()}\n"; });
The text was updated successfully, but these errors were encountered:
Hi,
You need to pass $argv from the parent context to the anonymous function context like you did with $conn :
\Ratchet\Client\connect('wss://echo.websocket.org:443')->then(function($conn) use($argv) {
Sorry, something went wrong.
Thank you very much, it works :)
No branches or pull requests
HI,
I would like to retrieve the variable $argv[1] but I can't.
The text was updated successfully, but these errors were encountered: