« first day (3658 days earlier)      last day (1273 days later) » 
01:00 - 22:0022:00 - 00:00

1:52 AM
@DejanMarjanović funily enough octdec and base_convert already supports that notation
 
 
4 hours later…
6:19 AM
Can't us defined "Fn" ・ Compile Failure ・ #80265
 
6:38 AM
parse_url silently drops invalid port number, inconsistent across platforms ・ *URL Functions ・ #80266
 
 
1 hour later…
7:44 AM
morns
 
o/
 
@Derick huh. Well at least you'd get high viewing figures for that ep, even if they weren't your normal demographic.
 
8:12 AM
@DejanMarjanović it could, r u using it?
 
8:44 AM
I have a ajax function which should perform a post request with a get request as callback, in chrome /Network/XHR the POST request is listeded above the GET request , but in my idle the get request is listet above
who should i believe ?
 
9:23 AM
@Amundsen "in my idle" ?
I suspect the answer to this question is that chrome logs them in the order in which they started, whereas the web server logs them in the order in which they finished
chrome has an active GUI log, whereas the web server is writing a single line of text to a file when the request has completed on the server side
it's quite conceivable that the order of two requests would get reversed in the client and server logs like that
so they are both true, you just have to ask the right question
 
@cmb Would it make sense for me to work on the PHP 8 migration guide in docs?
 
cmb
@NikiC na, I think it's better if you work on the hard stuff (and fixing my screw-ups). If all else fails, I'll do the migration guide on the weekend.
 
And relatedly, @cmb @MateKocsis where do we stand right now regarding synchronization of function signatures in the manual
 
cmb
No real progress; at least, I updated the union type PR, and I think it's okay-ish now, but would like it being reviewed.
 
9:41 AM
@cmb Was just looking at that one, but have zero familiarity with phd
The $types property is a bit odd
 
cmb
@NikiC that is NULL if outside of <type class="union">, and counts the number of already processed <type>s when inside (to not emit | for the first type). Is indeed bit hackish, but it seems to me whole PhD is. :)
 
9:57 AM
@DaveRandom thanks for clariification
 
 
1 hour later…
11:08 AM
Is this a good idea to deal with the new PHP 8 warnings: if ($_POST['id'] ?? null === '123')?
 
11:23 AM
@Dharman Should do that even without the warnings :)
 
In my opinion PHP really should have some kind of exception from these warnings for superglobals. I understand they are great to prevent bugs and typos, but HTML forms are dynamic. Sometimes the field is present and sometimes it is not. Maybe instead of superglobals, have some kind of class that would allow you to fetch a value from the request?
 
cmb
Well, there is ext/filter, but its API is terrible.
 
There are literally hundreds, if not thousands of frameworks out there that wrap a request :) you probably want to look at Symfony\HttpKernel
and exceptions (to a rule) and special cases always come back and kick PHP in the bollocks down the line.
 
@cmb I can either have null for non-existing variable or for wrong value, but not for both. It's super annoying
@MarkR Frameworks are good, but there is no way to just pull it a single class. I can write it myself, but I then have to use it in every new project. Something so simple as "Get the submitted value or null if not present" should be present in PHP.
 
How often is null a legitimate value?
 
11:37 AM
50% of the time
 
So a value can be there, and null, or there, and not null, or not present, and null, is that what your issue is?
 
yes
 
If so what you're looking for is array_key_exists
 
or isset, I know
but that means I need to have a ternary or if additionally
 
isset is unlikely to help if nulls are legitimate values to send
 
11:38 AM
if I also want to validate the type of the value then it starts to get complex
true
 
If you need to validate a bunch of data, personally I use json schema.
 
but, with GET you will not get NULL, you get ''
 
you mean for ?foo ?
 
In URL I can have either index.php?, index.php?id, index.php?id=, or index.php?id=42
If I want to store an integer in database in Nullable column I need to validate that the value is an integer and that anything was submitted at all.
 
Sounds like code smell. If you're checking if an integer has been sent it should be a non-zero length string, just watch out for the ! because of PHP's godawful treatment of "0"
 
11:44 AM
I don't argue my code is smelly, which is why I am fixing it, but I find it very difficult to validate the input.
 
Usually wrappers will have a has() that uses array_key_exists for exactly this purpose
 
I can do this intval($_GET['id']??null)?:null but that looks nasty
 
wrap it then :-)
I usually allow passing a default value in, makes it a lot easier
 
12:23 PM
you know its a bad day when the cat ends up sleeping in a position that just screams "this is all too much for me to bare"
 
How are they doing?
 
😺
Cuddleroll
 
well that one, we discovered, a certain unnamed toddler put a rubber band around his neck. found it just in time, but not before there was an open wound. has healed up very quickly now though.
 
:( poor kitty
 
12:25 PM
and frankly he acts more like a dog than a cat. I've never known a cat to be that affectionate.
his sister is a stereotypical "you need me more than I need you" cat, but loves playing with the aforementioned rubber band wielding toddler - even after he sticks her in sock drawers and upturned boxes.
 
@NikiC @Nikic Can you please answer my questions here github.com/php/php-src/pull/5895#issuecomment-708022094? This is my main problem before trying to extend Cmb's PR :) + Let's decide the previous questions
 
@MateKocsis I saw that, but not sure what the actual question is
 
Morning
 
I'm totally fine with integrating the methodsynopsis generation into gen_stub in PHP-8.0, if that's the question
 
12:42 PM
@Derick I just have to wonder, what happened here: github.com/php/php-src/pull/6324#event-3885112545 ^^
 
1:04 PM
@NikiC The actual question is what to do with the other gen-stub related change (github.com/php/php-src/pull/6289)? it's currently targeted to PHP 8.1, so I'm wondering whether it will be uncomfortable for us if there is such a big difference between gen_stub between 2 versions. Or this problem is not a big deal?
 
@NikiC Pointless sanctimonious comment to tell me how to do things.
 
Can someone tell me what's wrong with this method overloading implementation. It is somehow not working. 3v4l.org/fgJ3t
 
@Exception public -> private
 
@NikiC Basically, the comment was: "// cc @derickr"
 
@Derick Not surprising, given the source :)
 
1:12 PM
@NikiC oh! small miss.. This is the only way with which we can achieve method overloading? Why can't do like what c++ / java does
 
method overloading is an anti-pattern
 
@PeeHaa you around?
 
Why was this implemented? github.com/php/php-src/commit/…
This is not correct. PDO should be consistent and do not throw error
 
@Sara Ah, so you just cloned the entire method definition itself? I guess if it works it works.
 
/shrug
Though my thinking wrt function/fn equivalence would obviate that to a large degree
 
I would have to ponder that further. I can see the appeal, but I can also see the huge inconsistent mess that would make. And there would probably end up being some PSR that dictates when to use which one anyway, which only some people would follow, just out of spite, so it would still be inconsistent. And make grepping for things harder.
The main pro argument being that there's no obvious difference in meaning right now anyway, it's just different situations use different ones. Because.
 
Yeah. Giving too many options can be a bad thing.
See also: Alternative Syntax.
 
2:16 PM
function foo($a, $b):
  print $a;
  return $b * 2;
endfunction;
 
Yeah. GTFO with that bullshirt
 
PHPython!
 
We should deprecate that one, even if we never remove it.
 
It is useful in pure-PHP templates.
 
function foo($a, $b) {
  print $a;
  return $b * 2;
} // function foo;
 
2:17 PM
And basically nowhere else.
 
How does that even WORK reasonably with types?
 
@Crell How is it more useful than this?
 
function foo(): int :
  return 1;
endfunction;
Wait... I'm not finding endfunction, is it actually a thing?
 
It's not.
 
Oh thank God.
 
2:19 PM
Successfully trolled Sara with syntax. My day is complete.
 
I don't have space in my life for remembering all of PHP's syntax missteps
 
We have switch, if, for, foreach, and while that support it.
 
Not foreach?
 
How about adding this syntax:
```
function (): int <<<foo
return 1;
foo;
```
 
And foreach, yeah.
 
2:21 PM
And enddeclare
 
Why would you want to endd an eclare? What's wrong with eclares?
 
If we define "endd an eclare" as eating it, then yes.
 
fn endd_eclare($e) => eat($e);
 
cmb
@Dharman according to the bug report, the behavior depended on emulated prepares; the fix might not be the best; feel free to file a bug report/PR. :)
 
I am in the middle of filing a bug report
 
2:35 PM
@Sara So, um, how did you even make that commit, which GItHub says is not part of any branch anywhere? :-)
 
@Crell push branch, delete branch? :-)
commits are not deleted unless you git-gc them
 
The branch exists in my fork, not php's, but because of how github actually merges forks on the backend, it looks like it's on the originating project's fork.
github.com/sgolemon/php-src/pull/new/crell.short-functions is where it "really lives" if you prefer.
 
Ahh...
So I should be able to add your remote, cherry pick the commit, and push a new branch/PR with that as an alternate option.
 
Oh, and speaking of, that change to method_body on line 935 should be removed, obvs.
Yep
Or download my commit as a patch and apply it. Might be marginally quicker.
Not that any of it is complex.
 
@cmb Gonna attempt to compile a list of functions/methods which will throw a ValueError in PHP 8
 
cmb
2:44 PM
ta
 
PDO throws an exception when using fetchAll on non-select stmt with no emulatio ・ PDO MySQL ・ #80267
 
3:32 PM
@mega6382 Am now
 
4:10 PM
E_LIES
 
@PeeHaa is there any storage system for the new async bot? like there was in the old jeeves?
 
The core has a simple key value storage
 
hmm, ok, thanks
ok, so for the requestJson method in the Http\Client, do I need to create my own implementation of JsonSchema?
 
I love how you say that as if that's a thing you could just sit down and do :-P
 
@mega6382 What response are you trying to validate?
 
4:22 PM
A simple json response from an http request.
@DaveRandom its an abstract class, I can't use it directly, that is why I was wondering.
 
@mega6382 Yeah. Just pop a json schema with some validation in your own class
 
thanks
 
4:40 PM
@mega6382 no I mean it sounds like you are actually going to write a JsonSchema impl rather than just plugging in a package
:-P
 
hahaha,lol, no way
 
@DaveRandom tbf json schema packages in php are kinda bad :(
 
I am aware
I wrote some of one once, remember? :-P
quite a lot of some of one, actually
I think I had every single aspect of path resolution working properly
 
Their versioning is also pretty crap :(
It's pretty much a bit of a clusterfuck
 
@PeeHaa I have created a pull request on the dad-jokes plugin for the new async-bot, is you could please review it and tag it with "hacktoberfest" too. I will also create another pull request on this repo with unit tests and the functionality for adding custom jokes.
going afk for 30 minutes
 
4:50 PM
@mega6382 Sure thing!
Let me read about what exactly I need to slap onto the repo + issues so we are doing everything right
 
 
1 hour later…
5:52 PM
slaps the roof of repo meme
 
This bad boy can fit so many PRs
 
6:23 PM
jellow
@mega6382 did you fix your PC?
 
nope, not yet. And tragically the only place I could have gotten the ram from just went into flames: thenews.com.pk/print/…
 
F
 
yeah
 
You could at least play Among Us and Fall guys
I wanna play them because they seem so fun
 
@mega6382 what's a 'godown' ?
 
6:29 PM
no idea, probably meant to say "godam" which means "warehouse"
because that's what it had warehouses and shops
 
What do you mean only place to get RAM from?
 
@DejanMarjanović Well it was a central market for all sorts of electronics in my city, the local online shops are terrible, ebay and amazon don't operate here. Other local shops only have stuff that sells often, so in essence this was the only decent place to get it.
 
can't your order online?
 
nope, like I said most of the major online stores(amazon etc) don't operate here. And Aliexpress is charging shipping that is double the cost.
I think that I will just wait a couple of months and get a new system, that might be best.
 
Things we take for granted :S
 
6:47 PM
Hello guys,
I am implementing validation for google play receipts in php using
https://github.com/aporat/store-receipt-validator
But after generating the service account json file, I got error
`{ "error": { "code": 401, "message": "The current user has insufficient permissions to perform the requested operation.", "errors": [ { "message": "The current user has insufficient permissions to perform the requested operation.", "domain": "androidpublisher", "reason": "permissionDenied" } ] } }`
 
I can send it to you in a suspicious envelope, not sure if it will reach destination.
 
@DejanMarjanović This place was quite a significant landmark and I am sure that the government and the owners will try their best to get it back to how it was(maybe even better, all that insurance money) as soon as possible, so its just a temporary set back, and since no one was hurt, it is not that big a tragedy really.
 
I mean RAM not the entire shopping mall just to be clear.
 
the silver lining is you get be more productive
 
@DejanMarjanović hahaha, yes, I know :p
@samayo how so?
 
6:55 PM
less gaming == productivity
for me at least that's the case
 
No, that just means I am more active on mobile games :p
 
@samayo What do you mean productivity? I'm still paid the same.
 
lol i meant after work
 
I play during work hours because drinking is bad m'kay.
 
i need your job :)
 
7:09 PM
What would be a good name for a class that generates data and returns in the form of an array?
It feels weird to call it a Factory
 
ClassThatGeneratesDataAndReturnsArray
 
Why didn't I think of this?
 
Because you are not smarter than me
 
What about Emitter?
 
@Dharman ArrayDataGenerator::generateDataAsArray() :D
@Dharman What about Yielder?
 
7:13 PM
To clarify it will generate data in one go. Generators create iterators, right?
 
->toArray()?
I have no idea, I'm just confusing you.
@samayo Isn't that the standard when working from home? :P
 
What is wrong with naming it by the data it generates? like BooksTitleGenerator()?
 
I suppose that is a good name
 
@DejanMarjanović Don't give me ideas :)
 
Mental health #1.
 
7:19 PM
Ok, I will go with MeetingGenerator::generateMeeting() Does it sound good?
 
Maybe getMeeting(), too much generate in there.
 
@Dharman not sure if it sounds good, but it doesn't bad
 
It's readable and simple which is good start
 
@DejanMarjanović or just get() since the class name is descriptive enough.
 
or maybe create()
 
7:21 PM
or maybe init() and then get()
 
I wouldn't, as whether it's generated or read from DB or whatever shouldn't make a difference. I am for getMeeting().
 
create and generate are kinda different though, your should put generate somewhere and @mega6382's idea is good about avoiding redundant words
I don't like reading codes with convoluted and over-engineered names. I swear some people like write that way
those edgy and hipster developers are making code reading worse
 
7:55 PM
@PeeHaa what, you mean re-inventing xsd in a format with much weaker semantics doesn't work out well? surely not.
 
@DaveRandom JSON IS ZE GREATEST THING EVAH
 
Just use XML, people. Please. It's really fine, it won't kill you and it does work. You can spare those extra bytes of bandwidth if it means that your data makes sense and stuff works.
 
WAIT
\
VALIDATION!?
Yeah what you said
XML is just fine. XML over SOAP it still poop though
CSV over SOAP is the worst
 
no no no
CSV, PHP serialize()d, then sent over SOAP, is the worst
 
Wait waaait
wait
 
7:58 PM
inorite
 
Is that a thing that actually happeneded?
 
search the chat history, you can find the day it happened
I can work out the rough date hang on
some time in 2014 it would have been
 
eew... that indeed is on another level of shite
 
Dec 12 '13 at 13:25, by DaveRandom
Firstly: SOAP. Secondly, not actually SOAP, you send it SOAP messages, it responds with SOAP messages that contain a single field... which contains serialize()d data.
quite what one would do if you didn't happen to be using PHP on the client side, I'm not certain
bloody hell nearly 7 years ago
this room must be coming up on a decade by now
we should definitely have a cake
omfg we missed it :-/ it was like a week ago
 
:(
Why didn't you come in sooner?
Now its feelings are hurt
 
8:03 PM
I am the least organised person on earth (except @JoeWatkins), if you are relying on me for birthday tracking we're all fucked
I will make a #11 cake this weekend
Happy 10th Birthday Room 11!! (2020-10-15)
23
Oct 15 '10 at 7:49, by pestaa
I hope we'll be able to exchange a couple of PHP-specific ideas here. :)
 
They grow up sooo fast ;-(
 
@DaveRandom well you still managed to catch it, even if a weeks later
 
@DaveRandom Born in hate, grew up with love
Word of the first page is hate.
 
@DaveRandom ironic how the guy that started it hasn't been in chat in nearly a decade
 
I think I remember seeing pestaa once or twice, in the before times, in the long long ago
 
8:10 PM
so @salathe has been here since day one, very cool
 
Salad is old guard.
 
Uncle @Gordon also has a message on page 1
 
well of course, someone as ancient as him would have been there
 
8:44 PM
Will DOMDocument ever support HTML5?
 
9:00 PM
to settle an argument, please could a native Dutch speaker give me your translation of this? "Maak kennis met Google Drive: één plek voor al je bestanden"
@PeeHaa ^ <3
 
Meet Google Drive: One place for all your files
 
thanks
 
Any time
 
someone has been insisting that "bestanden" is "work", and surely that is something like the german "arbeit"?
also, what is "kennis", out of interest?
 
work is werk
 
9:02 PM
oh huh
 
kennis is knowledge
 
"Make knowledge with Google Drive" literally then?
 
In this case it is meet
maak kennis = meet
 
yeh "make knowledge with" does make sense for "meet" in an abstract kind of way
"get to know" might be a closer literal translation
 
Yeah it's sometimes hard to translate Dutch -> English as it may make a bit of sense almost in a stupid way :D
 
9:06 PM
well it shares that property with German to a large degree, which is a language I vaguely understand. Basically your language is broadly logical(ish) and mine is fucking retarded.
 
9:19 PM
Assuming that HTML 5 is still not supported (still throws errors for me in PHP 8) I wrote this answer: stackoverflow.com/a/64471875/1839439 Is this correct?
 
@DaveRandom yeah
@Dharman Doesn't that kill all error reporting instead of just silencing it?
 
@Dharman I think it could do with a bigger "This is disabling warnings you might care about" disclaimer, but unfortunately yes :-/
@PeeHaa in that particular case I don't think there's a functional difference
 
@PeeHaa Yes, it does but that's the point.
 
Also in my experience working with html parsing you need to do that anyway because html is stupid
 
s/stupid/not sgml/
 
9:21 PM
The accepted answer suggests to handle them manually, but if you want to silence them completely then this is the way
 
that's the mistake that libxml makes with html, pretending it is a well structured language
the "correct" thing to do would be to handle them manually, the practical thing to do is to make error reporting binary (parses/doesn't parse)
imho
ymmv
etc etc
 
9:36 PM
@DaveRandom all html has its canonical representation independent of how broken it looks
 
01:00 - 22:0022:00 - 00:00

« first day (3658 days earlier)      last day (1273 days later) »