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
When emitting a map of data that uses non-sequential numerical indexes, e.g.:
$data = [ "3" => "foo", "7" => "bar" ]; $emitter = new SocketIO\Emitter(); $emitter->emit('event', $data);
The data is serialized, emitted, and received as an array, e.g.:
{ "0": "foo", "1": "bar" }
The only way around this right now is to add a non-numerical key into the map, e.g.:
$data = [ "3" => "foo", "7" => "bar", "hack" => true ]; $emitter->emit('event', $data);
The reason this is happening is because in this file (https://github.com/rase-/socket.io-php-emitter/blob/master/src/msgpack_pack.php#L79) starting at line 79, the code is converting the data to an array if all keys in the data are ints, regardless of if the keys are sequential or not.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When emitting a map of data that uses non-sequential numerical indexes, e.g.:
The data is serialized, emitted, and received as an array, e.g.:
The only way around this right now is to add a non-numerical key into the map, e.g.:
The reason this is happening is because in this file (https://github.com/rase-/socket.io-php-emitter/blob/master/src/msgpack_pack.php#L79) starting at line 79, the code is converting the data to an array if all keys in the data are ints, regardless of if the keys are sequential or not.
The text was updated successfully, but these errors were encountered: