« first day (3788 days earlier)      last day (1142 days later) » 

2:31 AM
Function exec without $output but with $restult_code parameter crashes ・ Reproducible crash ・ #80811
 
 
2 hours later…
4:20 AM
I believe this is the worst example code I have ever encountered in documentation for anything anywhere developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…
specifically the 4th code block of the "Examples using the iteration protocols" section
it uses this in the most horrible way imaginable, pointlessly puts something in a pretend invisible property, has a ternary that is hard to think about, returns object literals so the braces are hard to think about, and has vertical spacing that betrays the pure sadism of whoever put it there
// need to construct a String object explicitly to avoid auto-boxing
const someString = new String('hi');

someString[Symbol.iterator] = function () {
  return {
    // this is the iterator object, returning a single element (the string "bye")
    next: function () {
      return this._first ? {
        value: 'bye',
        done: (this._first = false)
      } : {
        done: true
      }
    },
    _first: true
  };
};
here it is in all it's glory, it's not that big, but boy if I don't hate basically every element of it
even just the assumed knowledge of a comment talking about auto-boxing, a concept entirely unrelated to iteration, let's just throw a bit of batshit crazy expando iteration of a built-in type as the first example
it doesn't even iterate the chars of the string, the potentially practical application of this voodoo
there is absolutely no need for _first, a random extra expando property added on to the interface being documented when it could just have easily (and a lot more sanely) been done a local var in the top level function. Instead, we introduce a whole bunch of potential for unpredictable weirdness around this and release an object into the world with a pointless writable property that we rely on, and may well conflict with someone else's shit code
/me ragequits life
and using the magical _first before it is declared, I have just realised is the main thing that made me have to rearrange that code a lot before I understood it
and that brace layout almost seems deliberately obtuse, the way _first is declared in a desert of closing braces
omg and the inline reassignment as well
it has to be on purpose, no-one writes like that
well, I've nearly achieved a whole screen height of rant so... nn :-P x
 
5:01 AM
sane(r) equivalent of above code here
 
 
3 hours later…
8:23 AM
morns
 
 
6 hours later…
2:26 PM
opcache.cache_id should be PHP_INI_PERDIR ・ opcache ・ #80812
 
2:42 PM
@DaveRandom feeling better? :P
 
3:32 PM
posted on February 20, 2021

Ricky shaves his head now. He needed a new pandemic look. (What did you expect?!? All the ink I used to color in Jeff's longer hair had to come from somewhere)

 
4:01 PM
Before I go off and make it myself... anyone know of a middleware setup that supports autowiring at the invoke level?
 
4:28 PM
@MarkR DIC?
 
@Tiffany :O How dare you call me such a thing
 
@MarkR ...dork. dependency injection container?
 
Kinda, but kinda not. I want a middleware that can be created via dependency injection for global dependencies, but also something type-safe for calling the method itself that will autowire from request attributes
 
I'm just wondering if auryn would fit your use-case, but I'm not sure
 
I already have Symfony's DI system hooked up, plus some custom stuff, which works well. But I hate going through $request->attributes
 
4:33 PM
What would be the right process to close my RFC now?
The vote is 20 to 8 but people have raised concerns about the change landing in PHP 8.1
 
Have two weeks passed?
 
2.5 weeks
 
Your RFC is still in a position to pass. If you wish you can leave it open.
Or you can treat it as accepted
 
"Voting started 2021-02-11 and closes 2021-02-28."
 
Close and announce the vote has been accepted as per the voting RFC
If people want to argue against them let them make a coutner RFC and vote on that
I think that's the one thing I learned from the short tag RFC mess
 
4:34 PM
Ok, but I feel like there should be a secondary discussion whether to add it in 8.1 or start with a deprecation phase first
 
If people are that against the voted proposal a counter RFC should be written, discussed and voted upon
 
@MarkR I need to read how symfony's works I guess
 
I'd likely just accept it and invite a counter-proposal to make an adjustment.
 
^
 
Your RFC falls into the category of "dragging people kicking and screaming into the modern world" so it's always going to be contentious.
(hypocrite mode on my part as I use the classic style of error handling and then throw my own exceptions in my wrapper)_
 
4:40 PM
But at least you are doing it consciously.
 
Either way, IMO we have no idea when 9.0 will be coming, could be in 3 years, could be in 6 years.
 
Hey guys, what's up?
Could u help me?
 
Speak, Rudolfo. Don't make us wait
 
Can I send the link of the question?
 
Did you edit it as I told you to?
 
4:45 PM
yep
Oh, you are here too haha
https://stackoverflow.com/questions/66410193/why-does-the-validation-email-returns-an-error-while-registering-it-doesnt?noredirect=1#comment117406134_66410193

Here it is
 
posted on February 27, 2021

Yup. My temporary unemployment turned out to be temporary after all. I've needed to have Jeff return to work for quite some time now. In real life, I've been back since before my latest batch of furlough-related comics. This comic is to get myself back on track with reality. I didn't mention this sooner because: I still don't know how long the job will last I had already written a

 
5:46 PM
Guys, I have multiple strings in an array ["file.tex", "file.pdf", "file.aux", "file.csv"], etc... I want to exclude files containing .tex and .aux. Haven't been using php for a while, any new functions in php 8 or 7.4 that can do it one line? Gotta write the most elegant code ever :)
 
Carrolnjo ・ *General Issues ・ #80813
 
anyone know how to set up phd to render the PHP documentation? the pear command in the readme just gives me an error :(
 
@IMSoP I render it into XHTML
 
how?
 
php ~/php-docs/phd/render.php --docbook ~/php-docs/doc-en/doc-base/.manual.xml --package PHP --format xhtml --output rendered-docs-xhtml
github.com/tiffany-taylor/notes-for-building-php-docs - notes I use for myself, but may be helpful
...I need to remove the bits about SVN
I have a dedicated debian VM for php docs
 
5:54 PM
ah, OK, so is the Pear stuff on this readme not actually needed then? github.com/php/phd/blob/master/README
 
sec, digging through folders, trying to remember where the "phd" folder comes from
I really need to re-clone the git repo
I've never used pear for installation, doc.php.net/tutorial/local-setup.php this is what I followed
 
well, it seems to be doing something now; let's see if it generates something useful :)
yeah, the combination of git and pear did seem very logical
 
I've only had to use git and php
 
will that command re-build the whole manual each time, or does it detect which parts have changed somehow?
or to put it a different way: how many cups of tea/gin will I need while testing my changes? ;)
 
I think it rebuilds each time
TL;DR: hope for kitty ascii art :P
if you get kitty ascii art, it works
 
6:01 PM
heh, ok; thanks for the help :)
 
when I'm on auto-pilot mode, the ascii art helps until my brain wakes up
@Artshellorok one line and elegant don't always mix
one line and clever usually do
clever !== elegant
 
6:23 PM
@Tiffany What do you mean my catch Error of an undefined constant, define it and then goto back above the line is not elegant :p
 
cmb
@Tiffany this is at the end of ./configure, though
@IMSoP rebuilds every time, and may take several minutes
you can pass -p some_id to only render a certain page; works, but isn't great
 
well, I got some HTML, and it showed me I'd missed something out, so it was worth the wait :)
I've been bitten enough times by committing code blind that I try to avoid the temptation
 
6:37 PM
@Girgias just needs recursion
 
@Danack can I reference your error handling draft RFC or not for the @ extension one?
 
7:41 PM
threaded mod_php won't load: No space available for static Thread Local Storage ・ Dynamic loading ・ #80814
 
8:34 PM
I am looking the phpleague/fractal package and the way they use resources. We used their transformers in my last job and I really liked it so I want to use it in a new project.
I am looking at their example, and you instantiate either their "Item" resource or "Collection" resource classes and pass an object (or collection of objects) and a transformer. Like, new Item($books, new BookTransformer());
Naturally I want to extend the Item and Collection resource classes to make specific Item resources that depend on specific transformers, that way I don't have to care about what transformer is being used. eg. BookResource::__(Book $book, BookTransformer $transformer) {}; I would think that the documentation would suggest you do this.
But is that breaking the "composition over inheritance" rule?
I have a bit of a hard time knowing when that rule should come into effect or not
 
@Tiffany nothing will ever make me feel better while that code sample still exists
 
@DaveRandom sounds like you need to raise a PR on the MDN repo then ;)
 
8:52 PM
I am planning to do so, got a couple of days off this wk, but complaining is much more entertaining
 
amen to that :)
I would feel hypocritical, but am finally getting round to a rewrite of the debug_zval_dump manual page, which has been complete nonsense for years
 

« first day (3788 days earlier)      last day (1142 days later) »