« first day (4024 days earlier)      last day (907 days later) » 

12:27 AM
@bwoebi *ap-pear-antly
 
 
1 hour later…
1:39 AM
ftw apt install php-pear on debian. Also pear/pecl delenda est.
s/ftw/ftr/
 
 
7 hours later…
8:24 AM
@Danack heh
 
Is it reasonable to use DTOs (as just POPO) as a basic way to map API request body data? I.e. on POST you send "firstName" and "age" etc the DTO has properties/getters for those values. From what I've read I can use these to implement swagger too to auto create documentation for required request data
I tried it and it seems fair, but I'm finding that large data sets (lots of request info) mean lots of properties. This makes the DTOs unwieldy especially when passing in all data to create the object. I thought about splitting into multiple DTOs so eg all user info (name, age, etc) then address, then other stuff, but this feels urky.
any thoughts?
 
9:30 AM
@James well, what representation are you currently using, that makes it not-so-unwieldy?
 
9:56 AM
I'm not this is a new API server I'm setting up.
I read I can use DTO/POPO to map swagger too so thought this was a good overall approach
 
ThW
10:10 AM
@James Regarding "large datasets" I would suggest reading about database normalization. For the Swagger/OpenAPI part, I am usually writing the spec and generate docs/clients/servers from it.
 
10:29 AM
this isn't database it's API request data. Which can sometimes be a lot (and not necessarily directly related to a DB at all)
I guess I could split the objects and have one object that implements the separate ones. gah over-engineered always seems to be my problem :D
 
11:20 AM
@James Just use json schema validations compose require swaggest/json-schema . More info json-schema.org
 
Does anyone know if it's possible to edit a comment you posted on PHP.net manual?
 
I don't think you can
 
@LucasBustamante admins can
But generally it's not worth it
 
And can I delete my comment and post again? (It's currently in the process of "propagation of mirrors", so that's why I'm asking)
 
What's the comment
Now I'm curious
 
11:27 AM
It's a comment on SplFileObject::fgets, which had it's behavior changed substantially on PHP 8.0.1
After a seek
So it was just a reminder note about that.
 
If that's the case it should be part of the docs, not a comment
 
However, you can replace $file->fgets() with $file->current(); $file->next();, which is consistent across all PHP versions
fgets: https://3v4l.org/aNfns
current + next: https://3v4l.org/bRApo
 
That seems like an ok comment
Why do you want to delete it
 
I forgot to include the $file->current(); $file->next(); alternative xP
 
also, Hey Peter o/
Add a second comment NOTE: I forgot to include
 
11:31 AM
o/
 
It's not like you posted:

"you can replace $file->fgets() with $file->current(); $file->next();"
(l like em ticc af)
 
@ln-s interesting thanks!
 
I actively use it, it works
tip: Save your schemas in different files to be able to reuse them
(removed, changed my mind)
 
@PeeHaa

> If that's the case it should be part of the docs, not a comment

I'll leave this to your discretion, but I agree this might go into the `SplFileObject::seek()` documentation. I've posted it as a comment in fgets() because that's where people will most likely encounter the difference, even though the root of the issue lies in the different behavior of seek.
As you can see, I'm kinda dyslexical and always edit everything I post :)
 
xD
Maybe you just rush it, proof read it before posting it, I used to do that too
@LucasBustamante You are from? Brasil?
 
11:46 AM
Yeah. Don't judge me. haha
 
Why should I judge you ?
< <
It was just a question out of sheer curiosity
 
Just kidding man, yeah, I live in Brazil. In a small town called Lagoa Santa, Minas Gerais
 
Far from the ocean, shame
 
I think the same every day
7h trip to the nearest beach
I'v been wanting to move to a beach city for a while. The problem is that all my family and my wife's family live around here
I see in your profile that you're in Argentina? I've heard the inflation is bad there right now
 
12:35 PM
Even though $file->current(); $file->next(); works, $file->next(); $file->current(); is not consistent 3v4l.org/s4ZKA
 
 
2 hours later…
2:21 PM
@LucasBustamante huh, weird 3v4l.org/EgFbU
 
There's a very simple explanation for that behavior: Because SPL.
 
SPL bad?

Or just the way the SplFileObject iterates?
 
Ugh, I can't announce the release, because I don't have my keys on me :-/
 
2:37 PM
@Derick do you want me to take care of php-web update ?
 
@RemiCollet That'd be awesome. I can still do the email though, as I have that prepared.
 
@Derick ok, I go for it
 
Apr 25 '15 at 1:58, by Danack
@Worf I'm not going to say that drugs are bad, I'm just going to say that some of the SPL was designed when people were discovering Mescaline, and that the results were bad.
 
here's the fix :p 3v4l.org/PtASh ( yes, current() needs to be called before and after next() for some reason )
 
2:48 PM
@RemiCollet Cheers, I've just sent the emails.
Got to run again too.
 
3:02 PM
I'm doing something insane, refactoring ext/dba
 
/me sings insane in the brain
 
3:24 PM
@Ekin wheeeeeee tiktok tiktok tiktok tiktok wheeeeeee
 
I need to write a method that maps a state's cities based on FIPS code, pulled from a database table. For other similar helper methods, I use an array property, check to see if the property isn't set, and pull values from the database and assign the numeric code as array index, and string value as array value. However, the table I'm about to pull values from has over 1000 records, I'm not sure if that would cause any problems to store persistently in memory.
object's lifecycle isn't too long, but I'd like to avoid scalability problems, if possible
 
It's unlikely, 1000 records is a small amount of memory
 
@Tiffany I guess it depends on the size of each item of the array, and your estimated max memory? Also, you could either use it as a stdClass, or just make sure to pass the array around as a reference to avoid copy-on-write duplicating it
 
3:40 PM
size of each item is maybe max 25-30 characters
 
I'd start to worry once the array reaches 1M items :)
 
cheers
phpstorm preventing bugs before runtime, I was assigning values to the wrong property... "property is only ever read, never written"
 
You using php inspections ?
That's a neat plugin
 
I do use php inspections, but this was phpstorm that caught it
 
4:31 PM
Anyone has any tips on credit card fraud detection
 
Only that it's very hard, and maybe look for a third party service
 
yeah, trying to look for that 3rd party of trust
perhaps you know about one ?
 
I don't off the top of my head, I've never done it myself, I only know of the difficulty because of webinars we've produced where it's been discussed.
 
5:04 PM
Which PHP XML API sucks the least? Go!
 
@Crell github.com/veewee/xml
 
 
1 hour later…
6:19 PM
Am I correct to interpret that when KCachegrind tells me on the bottom "Total Memory_(bytes) Cost: 545 229 688" it means that the request allocated/unallocated a total of 545 MB of memory during it's execution?
 
 
1 hour later…
7:47 PM
Morning o/
 
@SaifEddinGmati I meant which native API. :-)
 
@Crell preg_match
 
That's a terrifying thought.
 
8:15 PM
linkedin.com down for anyone else ?
 
@Crell if the file isn't excessively large, use XML Reader, expand on a node, instantiate an XPath object. If the file is like over 50 MB, XML Reader generally... though you may be able to expand on a child node
 
Right now I'm looking more at generating an XML string than reading it.
 
ah. There's XML Writer, but I don't have much experience with it. I've generally used DOM Document
 
....sprintf?
 
For reading, xml_parser() is the most usable option I've found, and have worked with it before. But for writing...
DomDocument seems to only let you create new elements from the original DomDocument element. That is... somewhat complicated to do in my use case. (Recursively generating the XML, so I don't always have the root element. So I'd have to find some way to pass that through to each recursion.)
 
8:21 PM
->ownerDocument
but I digress
 
Ooo! I didn't see that there. That would be nicer indeed. :-)
 
I had to do some weird magic to copy the value of an attribute, create a node, replace the node of the original attribute with the new node, and with the attribute value
 
That's right, you've been doing a lot of XML madness lately.
 
some domain-specific terms but obfuscated most of it
 
That's closer to what I need to do here. Thanks!
 
8:27 PM
$oRelationElement->parentNode has to be like that, $oRedactedNode->parentNode won't work
it's been a few weeks since I've worked with XML, last data import was SQL, and working on another SQL import... with a strong contender for "worst database ever"
 
Database or database schema?
 
....both
granted, I think the encoding has managed to stay consistent.
 
@Crell Twig? :P
 
Is not native. :-)
 
Are we talking about HTML parsing or XML parsing
 
8:38 PM
Ok, then <foobar><?= htmlspecialchars($foo) ?></foobar> :D
 
@Crell You are creating docs or parsing them
 
At the moment, creating, although in this case I would end up doing both.
 
for HTML parsing I can suggest gumbo
I've used it once when doing a C crawler, it's great
also a PHP extension is available
 
In entirely unrelated news, this seems like a bug, no?: 3v4l.org/qjb7B
If I remove the named args, it works fine.
 
Eh maybe native functions don't support named args but only user land functions ?
just like array_* whatever doesn't accepts iterable
:D
 
8:44 PM
No, they definitely support named args in general. array_fill() was the example used in the RFC.
Is PHPStorm's stub file out of date then? It lists it as arr1 as and $_ as separate arguments.
 
NVM, you can 3v4l.org/WKYXk
 
Ah, so it is out of date, just in a different way. :-)
It seems they haven't updated from the stub repository in a long time, though. There's a bunch of fixes there around reflection they still haven't gotten.
 
I am trying to update some mysqli stubs there now
It's true that their stubs are lagging behind
I feel like the father changing the lightbulb from malcolm in the middle
I can't remember what PR I was working on but I am fixing PHP manual now
 
LOL. Yep, I have shaved that yak.
 
9:31 PM
@cmb I don't understand why MSVC is refusing to compile with my changes to DBA :( seems to be a linker issue? ci.appveyor.com/project/php/php-src/builds/41254388/job/…
 
mdb_env_set_mapsize
mdb_env_set_map_size
 
bleh
Will teach me about using search and replace too much
 
10:26 PM
who's Will?
 
One of my mates :p
 
cool, and whose will?
 
It's Will's will
 
trying to come up with something around "hoo swill" but it's not coming
 
10:54 PM
What will Will will with his will?
 
11:26 PM
he's really into 90s pop rap, I know he's really into Smith and .i.am
 

« first day (4024 days earlier)      last day (907 days later) »