Fixed TypeError of addcslashes() in heartbeat example
@@ -24,7 +24,7 @@ while (true) {
if ($length === 0) {
break;
}
- echo "No.{$client->getFd()} say: \"" . addcslashes($buffer, "\r\n") . '"' . PHP_EOL;
+ echo "No.{$client->getFd()} say: \"" . addcslashes($buffer->toString(), "\r\n") . '"' . PHP_EOL;
$client->send($buffer, $length);
}
echo "No.{$client->getFd()} closed" . PHP_EOL;
