« first day (5101 days earlier)      last day (105 days later) » 

09:35
How is bcmath not subject to the same rounding errors as PHP? Does it use something other than IEEE floating point? 3v4l.org/jmV65
 
2 hours later…
11:42
@QuolonelQuestions the bc in bcmath stands for binary coded (decimal) math
Well floating point is also a form of decimal is it not?
I had to look up what "binary coded" means
Would it not be better if PHP had used this for its floating point implementation instead of IEEE?
Or is there some downside I'm not aware of?
It is slow
It uses strings to handle the arbitrary precision
IEEE floats have hardware support
There is a reason why ML uses half precision (16 bit) floats lol
Makes sense
Also most cases don't need anything more than single/double precision
Now one of the cases where it matters is Civil Engineering and Aerospacial
 
3 hours later…
15:14
There's also the case of currency handling, where rather than arbitrary precision, you want fixed precision, with rounding according to fixed rules at specific steps.
IGP
IGP
16:09
is there a way to make fileinfo recognize semicolon delimited csv files as csv instead of text/plain?
 
1 hour later…
17:21
@IGP fileinfo uses libmagic, which is what the unix file command uses. So it has to be fixed there upstream
@Girgias only half true anymore; internally it does the basic computations more efficiently than just on strings
Morning all
Evening
I've been experimenting with embedded SAPI to build an HTTP server with use of libmicrohttpd but when I run it in terminal and execute request towards HTTP server I get this error
[Thu Oct  3 17:20:38 2024]  Script:  '-'
/usr/src/php-src/Zend/zend_objects.c(210) :  Freeing 0x0000ffff87268000 (152 bytes), script=-
=== Total 1 memory leaks detected ===
I've been struggling with this for a while now and even AI didn't help
Any idea?
I would recommend compiling with the address sanitizer enabled. This will point you to the place that allocated the object. To make that work you'll also have to set the USE_ZEND_ALLOC environment variable to 0
If you can't figure it out I can help you in half an hour or so
17:39
USE_ZEND_ALLOC=0 helped
but how can I compile my code to get rid of env var?
USE_ZEND_ALLOC=0 didn't fix the problem, the problem is simply not reported anymore because now you're using system malloc instead of Zend malloc
it just helps you to figure out what the bug location is when combined with address sanitizer (or Valgrind)
17:52
@brzuchal The server you use seems to be threaded, you need to use ZTS (and setup TSRM) to not cause issues
IGP
IGP
18:20
@nielsdos Yeah, I noticed the only fix I could provide would be using my own magic_database file

« first day (5101 days earlier)      last day (105 days later) »