« first day (4361 days earlier)      last day (578 days later) » 

JRL
5:47 AM
i have questions about architecture if anyone is in the mood to chat. basically, i have a system of traits for one of my libraries that is becoming somewhat unmanageable, but removing the traits seems equally unmanageable. im curious how anyone else woudl handle it.
 
 
4 hours later…
9:21 AM
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php/$1 [L] when i use in apache2 it works fine but if run on nginx it not working
 
JRL
because that's an apache rewrite rule?
does nginx use the same rewrite rules? i didn't think it did.
 
@JRL how to rewrite on nginx rule ?
 
JRL
no idea. i'd have to google it.
 
10:12 AM
@JRL Unmanageable how?
 
JRL
@OlleHärstedt I'm using traits exactly how i said they shouldnt be used on list, as a patch for multiple inheritance
this library is actually what made me come around to that opinion
it's really messing with the static analysis though
 
 
3 hours later…
1:30 PM
@JRL Phpstan/Psalm can't handle traits?
 
@JRL link to the code? I don't (generally) talk about code design without seeing what exactly someone is trying to do, as there can be so many subtle tradeoffs.
 
1:51 PM
Morhens
 
2:38 PM
Morning
 
 
1 hour later…
4:07 PM
How to tell someone has never worked on a large system:
 
4:45 PM
How can i simultaneously run multiple while(true) with Fiber (or swoole) ?
 
Read the swoole docs or use an Fiber supported async library
It also may depend on what you are doing inside your loop
 
I'm calling a external api service forever
(long pulling)
 
How are you doing that?
 
this: 3v4l.org/jCh8S but for multiple bots
 
Start either here openswoole.com/docs, or here amphp.org or here reactphp.org
I feel like your questions boils down to "how to write async code in PHP", which most likely nobody wants to write your code for you :P
 
5:00 PM
Alternate solution: Set up actual webhooks so you don't need to long-poll
 
5:12 PM
That sounds like a much simpler solution :)
 
5:23 PM
We have cronjobs that run every 5 sec to check a message queue
Works fine so far
 
 
2 hours later…
7:38 PM
Argument #1 ($t) must be of type ArrayAccess, array given,
Sad :(
use int|string as thing;
Another sad
```
use ArrayAccess as tuple;

function foo(tuple $t): void
{
}

foo([1, "asd"]);
```
 
JRL
8:10 PM
@Danack it's my Fermat library. It's kind of a bear to understand, which is why I didn't want to dump it on people straight away. github.com/JordanRL/Fermat
the linked documentation actually has a really good overview of the architecture and reasoning
in the "concepts" heading under "getting started"
im currently writing my own base conversion provider for it so i can ditch one of the dependencies
 
 
2 hours later…
10:32 PM
Which notation would you prefer when transpiling PHP to C:
to use unit-types to differ between "arrays", like foo(array|tuple $t), or foo(array|vector $v)
or to use docblocks?
 
11:24 PM
What sort algorithm does sort(), usort(), ksort(), etc. use internally? Is it quicksort or something else?
 
JRL
11:38 PM
pretty sure its quicksort
ive read it somewhere i think...
 
@Crell it appears to be a quicksort - heap.space/xref/PHP-8.2/Zend/zend_sort.c?r=f07fbfb8#248
 
JRL
im bumping the min version for Fermat with the next release to 8.1. enums are too good.
 
That's what I expected, thanks!
 

« first day (4361 days earlier)      last day (578 days later) »