We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74a194f commit eeec8f2Copy full SHA for eeec8f2
1 file changed
src/Connection.php
@@ -146,8 +146,15 @@ private function parseAddress($address)
146
}
147
148
if ($this->unix) {
149
- // unknown addresses should not return a NULL-byte string
150
- if ($address === "\x00") {
+ // remove trailing colon from address for HHVM < 3.19: https://3v4l.org/5C1lo
+ // note that techncially ":" is a valid address, so keep this in place otherwise
151
+ if (substr($address, -1) === ':' && defined('HHVM_VERSION_ID') && HHVM_VERSION_ID < 31900) {
152
+ $address = (string)substr($address, 0, -1);
153
+ }
154
+
155
+ // work around unknown addresses should return null value: https://3v4l.org/5C1lo
156
+ // PHP uses "\0" string and HHVM uses empty string (colon removed above)
157
+ if ($address === "\x00" || $address === '') {
158
return null;
159
160
0 commit comments