« first day (4308 days earlier)      last day (640 days later) » 

JRL
2:50 AM
Does anyone know of a userland "standard exception library"?
sort of like a library that provides a somewhat comprehensive set of exceptions that can be used and perhaps even handlers for them
 
> As of PHP 7.4.0, property definitions can include a Type declarations
/me facepalm at past self
assumign I did that
oh, it wasn't me
can I remove a in that statement... cause it ends up being a signifier for a singular word, but <xref linkend="language.types.declarations" /> will be plural
... or I can just do it and someone can revert my commit if it's unwelcome
different topic, on php.net/get-involved, #3 says "Filing and resolving bug reports at bugs.php.net" ... Github doesn't have an organization-level issue repository, how should this link be revised?
maybe point to php/php-src? but that seems lackluster
 
 
3 hours later…
5:42 AM
has anyone ever encountered an issue where something internal in php is throwing a wobbly and it's just causing methods to bomb out early, without erroring, but breaking return type contracts (yes strict types is enabled at the calling and declaration location)? And more importantly can anyone suggest how I try to find the cause? I've tried strace and nothing obvious stood out so far.
 
 
1 hour later…
6:49 AM
Unable to include __toString on Enum, Why? could be good
 
 
1 hour later…
8:17 AM
so if anyone's curious... I think the above is caused by some combination of Xdebug, and a cache of.. something.
 
@GabrielCaruso have you my email about NEWS file for 8.0.22 ? github.com/php/php-src/commit/…
 
@RemiCollet Thanks for the ping - it's NEWS changes, do I need to recreate the tarballs or only a heads up for Thursday's announcement?
 
@GabrielCaruso RM choice ;) not critical, but may be nicer to have to proper NEWS in the official archive
(also have to move the entry for 840047 in the proper place in PHP-8.0, as the fix was cherry-picked
 
@RemiCollet I'll take care of this one - indeed!
 
8:33 AM
@GabrielCaruso just tell if you plan to recreate the archive of if I can start the build with the current one
@GabrielCaruso oh... the NEWS entry is there... can't see it in the commit... :(
damned github UI
so seems OK with the current one (only date, really not critical)
 
@RemiCollet do you mind if we don't? it's only the day :) otherwise I would create
 
yes, yes, fine with current one
 
cool, thanks!
 
 
5 hours later…
1:50 PM
@Stephen do you have other extensions enabled? If so maybe try turning the other extensions off one-by-one. What you say is plausible but unlikely....and if it's real the combination of which extensions might be interesting.
And if you're running suhosin, well that's the actual problem.
 
2:26 PM
@JRL "perhaps even handlers" - what would a generic exception do? Can you give an example?
 
3:03 PM
That's a funny comment more people should see
 
You can do a joke about how the php haters will emphasise the 'random capabilities of PHP.'
But @MarkR made that observation originally.
/reduce, reuse, recyle.
 
3:19 PM
I'll handle merging of my PRs shortly, thanks for the reviews :-)
 
 
4 hours later…
JRL
7:05 PM
@Danack I'm not sure exactly. I was considering creating a new library that was all around providing a more standardized and planned out way to throw and handle exceptions, but it's pretty vague
Break up exceptions into two broad categories: SystemErrors (the code did something unexpected), and UsageErrors (the code rejects your usage of it for some reason)
broadly i would expect SystemErrors to never be recoverable, and UsageErrors to sometimes be recoverable
the exceptions provide for an error/exception message, a description of the constraint that was violated, and a suggested way to resolve the problem
here's an example of what i mean by those three things: github.com/JordanRL/Fermat/blob/master/src/Samsara/Fermat/Types/…
the argument order in the code is: constraint, suggestion, message
 
7:22 PM
The suggestions do not look like a value-add to me. They are pretty tautological.
More generally all the three parameters say the same thing, just in different words.
@zeriyoshi :wave: You made it! :-)
 
JRL
@TimWolla Well yes, as this is a math library, and math is pretty tautological when it comes to arithmetic
though that may more broadly be true as well
it is certainly helpful with the MissingPackage exception elsewhere in the library
 
Yes, I believe so. If the error message tells you what you must not do, then the fix is … not doing that.
 
@JRL Just compute the gamma function for negative/real number for the factorial /s
 
Hello! but I'm going to bed. goodnight...
 
@zeriyoshi 👋 welcome! Happy you joined us :)
And good night :P
 
 
2 hours later…
JRL
9:59 PM
@Girgias i seriously doubt that anyone here truly understands the effort that has gone into that library, lol. i've actually had to read published compsci academic papers from the 60s, 70s, and 80s just to get a hint on how to implement some of these algorithms without killing performance.
it all sounds so simply until i remind people of the big caveat: it must be arbitrary precision
even if i implement a fast version for the more common scale sizes, i need at least a working implementation for all scale sizes or i can't publish
which strangely is an area of computer science research that almost no one has gone into in the history of computers it seems
the fact that i have all the trig functions, all the inverse trig functions, all the hyperbolic trig functions, an e^x or ln(x) working for abitrary precision was a mountain to climb
and even so, most of the trig functions are painfully slow still because to save my sanity i still have pretty naive taylor series summations for several of them
 
I can imagine
 
JRL
most fo the faster arbitrary precision algorithms require knowing pi to at least the number of digits that you want accuracy
 
Low key if you want such a number you could just use a symbolic solver like Matimatica
 
JRL
but... that same algorithm is how you calculate pi
 
:')
So hard code pi I suppose
 
JRL
10:05 PM
i have
to 100 digits
which is what it uses for scales smaller
thats almost all use cases
even things like measuring the size of a galaxy in milimeters would still work within that
re: matematica, i didn't want this library to truly depend on anything being installed except the required version of the PHP
 
Obviously I was talking that if someone want's to know the result of an integral, they should probably use a symbolic math language than a standard programming language lol
 
JRL
ah yeah
and true
but my sisyphean task i have chosen for myself is helping PHP handle the majority of these usecases that computer applications actually use natively
heh
i really need to clean that library up and finish the complex numbers part of the library
 
10:21 PM
> I'm at the provably correct maths library.
> I'm at the semantically precise definition of English.
> I'm at the combination provably correct maths library + semantically precise definition of English chatroom.
 
JRL
i put a lot of development of that library on hold while i worked on php-src contributions for RFCs a year ago
oh i forgot about that
lol
"what if they request an arbitrary precision number outside of PHP_INT_MAX or PHP_INT_MIN that they also want to be crytographically secure"
that was an annoying question to face
 
@JRL I can imagine several reasons for wanting this, but I'm not sure I understand why you do. Regardless of why you want it though...maybe instead of defining the exceptions/hierarchy, start by defining at least the constraints and suggestions as specific types, and then see where they are used. Naming things is really hard, and then even when you've named it, that doesn't mean someone else will grok the name.
 
JRL
10:36 PM
good advice, and one of the reasons i wanted to see if someone had already done it :)
wow, i really, really carefully commented the RandomProvider
 
No.....I have pretty strong feelings that such a thing shouldn't exist, both as exceptions should be not shared across libraries/modules (as it makes catching specific exceptions harder) but also because people will re-use them inappropriately as they will choose one that is "close enough".
And also as names of exceptions are based on English, and English is not to be trusted:
 
DGF
11:11 PM
I'm having some doubts while implementing the MessageInterface:

- In https://www.php-fig.org/psr/psr-7/#31-psrhttpmessagemessageinterface in the `getHeaderLine` signature they say https://paste.debian.net/1249141/.

What do they mean by: "For such headers, use getHeader() instead
* and supply your own delimiter when concatenating."?

Right now I'm using `return implode(', ', $this->getHeader($name))`, Why not use a different delimiter from the get go instead of a comma and then sometimes use a different delimiter, sounds weird
 
@DGF I don't know. If I wanted to know, I'd probably go read the details in github.com/laminas/laminas-diactoros Or maybe I'd just use that library and save having to write my own.
 
DGF
Also, I'm reading this part of the Header specification rfc-editor.org/rfc/rfc7230#section-3.2 and just wanted to confirm if it's possible to use a universal regex for all the header name or values? (not asking how to implement). Thanks
@Danack I had a look at the Guzzle one github.com/guzzle/psr7/blob/… and it seems they ignore that part
and the one that you linked seems that also ignores
Which is kinda weird since there are header values with commas
 
oh......
> Not all header values may be appropriately represented using comma concatenation.
that bit...
 
DGF
How do you quote in here?
> teste
oh..
yeaht this part:

>NOTE: Not all header values may be appropriately represented using
comma concatenation. For such headers, use getHeader() instead
> and supply your own delimiter when concatenating.
fk
 
> For example, the Content-Type field value only allows commas inside quoted strings, which can be reliably parsed even when multiple values are present. The Location field value provides a counter-example that should not be emulated: because URIs can include commas, it is not possible to reliably distinguish between a single value that includes a comma from two values.
Because you need to program the special cases yourself...
from rfc-editor.org/rfc/rfc9110.html - and I am not used to reading RFCs in anything other than a mono space font.
 
DGF
11:32 PM
I understand that some header values can include commas but why not recommend a different delimiter besides commas when returning the values as strings? So that all returning strings have the same delimiter
 
@DGF that question is probably equivalent to "why didn't they design it perfectly from the start", when they had no idea how people were going to be using it.
And that's the same group of people who put up with a typo for quite a while - en.wikipedia.org/wiki/HTTP_referer
 
DGF
I mean... They know that header values can have commas. I could provide to implode a different char or multiple chars like you can do in Content-Type boundary (which I discover today that's a thing)
But yeah, I get it
 

« first day (4308 days earlier)      last day (640 days later) »