Skip to content

Conversation

@pulzarraider
Copy link

This fix Uncaught TypeError: factorial(): Return value must be of type int, float returned. If the $nparameter in factorial() is bigger than 20, it will cause type error because PHP converts int to float.

Demonstration: https://onlinephp.io/c/3bbad

@calvinalkan
Copy link

Can confirm this

@Xon
Copy link
Contributor

Xon commented May 31, 2022

Do you have a sample of what input is triggering this?

@pulzarraider
Copy link
Author

pulzarraider commented Jun 6, 2022

@Xon no. Passwords in our logs are anonymized so I can't give you the input value that triggered this error. But it is very rare.

@alexkuusk
Copy link

Password: 123 12345 654321 abcdef gfedcb kuulilennuteetunneliluuk dog fghij mnopq 66666 1010101 loop

@tomsommer
Copy link

tomsommer commented Dec 29, 2022

Isn't this caused by the changes in 1.3.1? Is it same problem in 1.3.0?

Also, why not just say the function can return a float, as a solution?

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

Successfully merging this pull request may close these issues.

5 participants