Skip to content
New issue

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

Bug when setting timeout > 999 seconds #129

Open
BarthDELUY opened this issue Oct 17, 2018 · 1 comment
Open

Bug when setting timeout > 999 seconds #129

BarthDELUY opened this issue Oct 17, 2018 · 1 comment

Comments

@BarthDELUY
Copy link

Hi,

In phpnats/src/Nats/Connection.php line 180, you use the function "number_format" without the optional parameters.

number_format(3600, 3) outputs "3,600.000", so the timeout is set to 3 seconds instead of 1 hour.

Code should be

number_format($timeout, 3, '.', ''); //http://php.net/manual/en/function.number-format.php
This outputs the desired result: 3600.000

ameliabradley added a commit to Salucro/phpnats that referenced this issue Nov 19, 2018
@ameliabradley
Copy link

ameliabradley commented Nov 19, 2018

I've also encountered this issue. Manifested itself as:

at HandleExceptions->handleError(8, 'A non well formed numeric value encountered', '.../Connection.php', 255, array('address' => 'tcp://nats:4222', 'timeout' => '3,600.000', 'errno' => 0, 'errstr' => '', 'fp' => resource, 'seconds' => 3.0))
in Connection.php line 255

Submitted a PR to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants