laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.78k stars 296 forks source link

A non-numeric value encountered #242

Closed tmdevlet closed 3 years ago

tmdevlet commented 3 years ago

Description:

When script runs long time (f.e. 5s)

A non-numeric value encountered

at vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php:211 207▕ return $elapsed 0.001; 208▕ } 209▕ 210▕ if (Str::endsWith($elapsed, 's')) { ➜ 211▕ return $elapsed 1000000; 212▕ } 213▕ 214▕ return $elapsed * 1000; 215▕ }

  +31 vendor frames 

32 artisan:37

Steps To Reproduce:

Call any router (/api/long_api/) witch runs long time (f.e. 5s)

Possible fix:

at vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php:211

line: 213 if (Str::endsWith($elapsed, 's')) { return substr($elapsed, 0, -1) * 1000; }

nunomaduro commented 3 years ago

Already fixed here: 7e55e9b. We will be tagging a new version soon.