NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #2126 most downloaded on Packagist
An MQTT client written in and for PHP.
Last release 6 months ago
28 Mar 2026
Ships fairly regularly
a new release about every 4 months
Some releases are documented
notes for 11 of 29 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
30 releases · first in 2019
Fix deprecation of SplObjectStorage::attach/detach in PHP 8.5 by @dora38 in #223
Full Changelog: v2.3.1...v2.3.2
One column per quarter.
Fix: check for EOF when reading from socket by @Namoshek in #215
Full Changelog: v2.3.0...v2.3.1
Add ping response timeout handling by @Namoshek in #210
Full Changelog: v2.2.0...v2.3.0
Fix: PHP 8.4 - Implicitly nullable parameter declarations deprecated by @StevenFV in #192
Full Changelog: v2.1.0...v2.2.0
Bump sonarsource/sonarcloud-github-action from 2.0.2 to 2.1.0 by @dependabot in #172
Full Changelog: v2.0.0...v2.1.0
Implement delivery of retain flag by @Namoshek in #169
Full Changelog: v1.8.1...v2.0.0
Bump sonarsource/sonarcloud-github-action from 1.8 to 1.9 by @dependabot in #154
Full Changelog: v1.8.0...v1.8.1
Add connected event handler by @UtechtDustin in #152
Full Changelog: v1.7.1...v1.8.0
Fix: Use blocking socket only during publishing if configured by @Namoshek in #141
Add connection setting for blocking mode of socket by @Namoshek in #135
Full Changelog: v1.6.0...v1.7.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Significant improvements to the architecture, API and design of the library have been part of v1.0.0. Upgrading should be rather simple for most users
Significant improvements to the architecture, API and design of the library have been part of v1.0.0.
Upgrading should be rather simple for most users though, since the public API has not changed a lot
and only in places which are not used too frequently.
A lot of effort has been put into this summary to document as many changes as possible. It is impossible to give a guarantee about the completeness of this list though. You should cover your uses of the library with tests yourself as well.
The following summary compares v0.3.0 to v1.0.0.
\PhpMqtt\Client\Contracts\MQTTClient → \PhpMqtt\Client\Contracts\MqttClient\PhpMqtt\Client\MQTTClient → \PhpMqtt\Client\MqttClient\PhpMqtt\Client\Exceptions\MQTTClientException → \PhpMqtt\Client\Exceptions\MqttClientExceptionMQTTClient class to a new interface \PhpMqtt\Client\Contracts\MessageProcessor and the respective implementation for MQTT 3.1, \PhpMqtt\Client\MessageProcessors\Mqtt31MessageProcessor.
MessageProcessor is responsible for parsing and building packages on a byte level.protected properties have been changed to private to ensure they are not manipulated outside the offered scope, which is enforced through getters and setters. This change only affects users which actively inherited their own implementation from the library.$caFile parameter of the MQTTClient constructor as well as the $username and $password parameters of the MQTTClient::connect() method have been moved to the ConnectionSettings class.ConnectionSettings use fluent setters for configuration now (see README).ConnectionSettings`` passed to MQTTClient::connect()are now validated and may not contain invalid configuration. In case of invalid configuration, a\PhpMqtt\Client\Exceptions\ConfigurationInvalidException` is thrown.ConnectionSettings to support more uses cases with secured connections.\PhpMqtt\Client\Exceptions\RepositoryException if an interaction with the repository fails. This should happen with the MemoryRepository only in exceptional situations, but when implementing persisted repositories, this may happen more frequently and should therefore be considered.MQTTClient::connect() method had a parameter called $sendCleanSessionFlag while the MqttClient::connect() method has the same parameter, but called $useCleanSession. The parameters $username and $password have been removed entirely and are now part of the ConnectionSettings.MQTTClient::close() has been renamed to MqttClient::disconnect().$topic of MQTTClient::subscribe() has been renamed to $topicFilter to reflect its meaning (which is a topic, but with wildcards). The $callback parameter can be null now and has null as default.$topic of MQTTClient::unsubscribe() has been renamed to $topicFilter as well.\PhpMqtt\Client\Exceptions\MqttClientException as base. You should ensure your calls to methods of the MqttClient handle the exceptions appropriately.\PhpMqtt\Client\MQTTClient class have been moved to the respective exception classes. This change only affects you if you used these constants to render detailed exception information for your users.\PhpMqtt\Client\Contracts\Repository interface has been changed significantly and summarizing all changes would be quite hard anyway. We therefore encourage you to have a look at the interface again and update your own implementation(s) of it, if you have any.\PhpMqtt\Client\Logger implementation of Psr\Log\LoggerInterface does now decorate the log output with details about the MQTT client (format: MQTT [{host}:{port}] [{clientId}] {message}).localhost:1883 (or the configuration in phpunit.xml is changed instead).MqttClient::isConnected(): returns true if a connection is established (socket opened), and false otherwise.MqttClient::getReceivedBytes(): returns the number of raw bytes received from the broker (this includes meta information and not only message contents).MqttClient::getSentBytes(): returns the number of raw bytes sent to the broker (this includes meta information and not only message contents).No functionality has been removed in this version.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →