Skip to content

How can “round” return a float?

PHP float type is IEEE-754 binary64. The number 59.95 cannot be stored precisely in binary. In IEEE-754 binary64 the representation of 59.95 should be 59.9500000000000028421709430404007434844970703125. However, when I do It returns 59.95. How is that possible? Also the function round claims to return the roun…

OpenApi for php doesn’t render enum values correctly

I am building some documentation using OpenApi and Swagger, but I am unable to test it because of a js error. I want to define a parameter that will accept specific values so I added enum in the schema attribute. I am defining the orderBy parameter in a GET request like this When the documentation is generate…

laravel feature tests with locales

I am new to Laravel and I am having an issue to write a test function that asserts that the HTTP response of my welcome page is 200 knowing that I have EN and FR locales defined, meaning that the test should test both localhost:8000/en and localhost:8000/fr. This is my exampletest.php: I don’t like writ…