@cabbey@phpc.social avatar

cabbey

@cabbey@phpc.social

sourcerer @ SmugMug, photo geek, dad, licensed rocket scientist (L2 w/ NAR and Tripoli).

This is MY stream of consciousness. I don’t speak for my employer, club, or hobby.

Fiscally conservative, socially liberal; he/him

This profile is from a federated server and may be incomplete. Browse more on the original instance.

cabbey, to ubuntu
@cabbey@phpc.social avatar

Anyone know how long it usually is between a release going GA and do-release-upgrade seeing it? Seems odd that I could download and burn the iso and do an upgrade with that, but can't do it from within the system yet.

cabbey,
@cabbey@phpc.social avatar

@Crell yeah, just trying to get a feel for how long the stagger is. But also meh… it’s not a lot of data, and it’s CDN’d pretty hard.

cabbey, to php
@cabbey@phpc.social avatar

ok brain trust.... say you wanted to automate some code changes. Simple stuff like "find all the instance methods that call self::staticFoo() and change them to call $this->foo() instead"... what static analysis tool would be the first one you would reach for to do that? Before anyone says "a grep and perl pies pipeline" note that static methods that call self::staticFoo() must remain as is. Next up would be "find all the places ->info['foo'] is read and replace it with ->getInfoFoo()."

afilina, to random
@afilina@phpc.social avatar

Shout out to league/csv for continuing to be an awesome library. It's intuitive, a breath of fresh air after a long week of fighting every single tool. This one doesn't fight you. It just helps you without getting in the way.

cabbey,
@cabbey@phpc.social avatar

@afilina oooh! I didn't know this package existed. I think pretty much every package from The League I've used has fit this description though, so that's a good sign. Sadly, after looking at it's docs, it doesn't even attempt to solve the biggest problem I think @kboyd and I see with writing csv files... managing the column positions when you have variable data. :(

cabbey,
@cabbey@phpc.social avatar

@afilina @kboyd say you have 50 columns... say 40 of them are populated in every row, but the other 10 you get some random subset (depending on what the other values maybe, you may have 10 of them or you may have 3 of them or somewhere between.) Then say you have another 6 or so columns that get added for certain customers but not for others.
It would be awesome if you could give it a header array and then pass in a hash for the row and have it populate just the ones that are set.

cabbey,
@cabbey@phpc.social avatar

@kboyd @afilina or a patch to add it if they're open to it.

cabbey,
@cabbey@phpc.social avatar

@afilina @kboyd ahh... I must have misunderstood what formatters could do... I thought they were processed cell by cell. If they get the whole record then yeah, that would probably work.

andrewfeeney, to php
@andrewfeeney@phpc.social avatar

and folks, what do you make of this?

https://youtu.be/kQdRT2odUIk

cabbey,
@cabbey@phpc.social avatar

@valorin @bobmagicii @j3j5 eh, I dunno... this was my first exposure to him as well and frankly the fact that he called utf-8 "the encoding for English" basically put me into "lol, no." mode and closed the tab,. Thank you @andrewfeeney for the direct CVE link.

cabbey,
@cabbey@phpc.social avatar

@valorin @mergy @bobmagicii @andrewfeeney distros should be able to just land a new, patched, module. The only reason there are manual steps here is the attempt to work around the fixed binary not being available. #ubuntu for example seems to have already dropped a fix: https://ubuntu.com/security/notices/USN-6737-1

cabbey,
@cabbey@phpc.social avatar

@bobmagicii oh yeah, there's certainly something to be said for being able to just ssh into a box, boot the encoding out of the support list and rebuild the iconv catalogs. :)

cabbey,
@cabbey@phpc.social avatar

@andrewfeeney @arnan @valorin @mergy we don’t know yet.

But assumed worst case: there is some magic string that if they can get your web server to spit it out, in that encoding, can be used to dump anything php has access to… or run any arbitrary assembly… as your php user.

There are probably a dozen lesser degrees too.

Disclaimer: I’m not a security researcher either… it’s been 20+ years since I sat down and crawled through any code looking for malicious ways to abuse it.

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

Making my traditional stop at Cracker Barrell

cabbey,
@cabbey@phpc.social avatar

@grmpyprogrammer ooh, they still exist? All the ones out here closed last year.

cabbey, to php
@cabbey@phpc.social avatar

Does anyone have a better way to write the conditional calls to foo at lines 5-9 of this code? https://3v4l.org/fqCvv The goal is to have the default argument for bar trigger the default argument for foo, but they're different defaults (since one is nullable and the other isn't), and bar should not need to know what foo's default is. (obviously in my real code it's a much more complex signature, and separate classes.)

cabbey,
@cabbey@phpc.social avatar

@Girgias not sure I follow how that would help?

cabbey,
@cabbey@phpc.social avatar

@Girgias ooh, yeah. I thought you meant down a level in foo. That's easy enough to determine if the flag is null that I don't think this is helpful. Also I'll note that in the real code, due to multiple named optional parameters it's a bit more complex: https://3v4l.org/PfBe4

cabbey,
@cabbey@phpc.social avatar

@Crell honestly mostly trying to avoid having two copies of the call to foo() in an if/else with different argument lists. (way more obvious why in the real case with more params to foo.)
It really boils down to "this library allows you to specify an old format version and defaults to it's current one, which is an internal detail." vs "this function lets you specify the version of the object you're dealing with, in case you need to use an old object from storage"

cabbey,
@cabbey@phpc.social avatar

@Girgias yeah, certain Obj-C library programmers really love that trick too. I recall an entire library for doing graphics that had functions like drawLine() which took 100 named variables, because you could specify points with x/y coords or with angle (as degrees or radians) and distance, or with a data class called a Point, then the other end could be specified with all sorts of different approaches including both absolute and relative offset from the start. Ugh. So glad #php doesn't do that!

cabbey,
@cabbey@phpc.social avatar

@Crell I was a Java developer for several years, I still cringe every time I resort to using reflection (all in tests, never in production code!) because of the memories of just how painful the performance penalties were back then.

I just started the PR with the "assemble an array and spread it" approach. I suspect it won't be received with torches and pitchforks.

cabbey,
@cabbey@phpc.social avatar

@ramsey @gmazzap yeah, as I discussed with crell in another branch of the thread the root issue was avoiding two calls to foo in a conditional with a long argument list. The solution I put into PR Friday assembles an argument array, conditionally adds the one discussed here then calls foo(…$args);

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

I had foolishly assumed that Dubai’s airport was landlocked in a desert and was stunned to see pictures of the flooding

cabbey,
@cabbey@phpc.social avatar

@kboyd @grmpyprogrammer @janl yeah, having been born and raised in the desert this doesn't surprise me at all. We used to laugh our asses off at the folks from down by the coast that would come up and buy land, then bulldoze the gullies flat and start to build houses on them. Then the first gully-washer of the season would come ripping through in the later winter/early spring and they'd be shocked that over night there's a 30' tall trench cutting through the property.

kevbob, to random
@kevbob@xoxo.zone avatar

Today a realtor asked me if we were moving to Vegas because we were Knights fans. Told her until a couple weeks ago I didn't know what they were, and I thought the logo that I saw all over town was from a local right wing militia.

cabbey,
@cabbey@phpc.social avatar

@kevbob ROFL. I’m curious how they took that.

blindcoder, to php
@blindcoder@toot.berlin avatar

Just spent TWO HOURS debugging PHP code because I relied on my IDE and github Copilot which both didn't catch the bug in the code below:

<?php
if (array_key_exists("error", $response){
$return_value = [];
}
?>

Error message was: PHP Parse error: syntax error, unexpected token ";" in <file> on line 3

Yes, it's on me, but I'm supposed to test this tech for my employer and results are not looking favorably.

Edit: added proper line number for my example

cabbey,
@cabbey@phpc.social avatar

@michael @Sdfendor I reduced the frequency of this to basically zero by disabling a bunch of built in plugins for stuff I don’t use. Laravel and symphony and behat and like 10 other things. Haven’t had any hiccups since.

alda, (edited ) to random
@alda@topspicy.social avatar

PHP double precision floats for financial calculations — yes or no?

cabbey,
@cabbey@phpc.social avatar

@alda I kinda want to know where the dozen or so folks that voted yes work, so I know where to avoid doing business.

kevbob, to random
@kevbob@xoxo.zone avatar

Love posting something for free on NextDoor. Immediate response: "You still have this?" Me, within a few minutes. "Yes! I just posted, but you are welcome to arrange to come by, please let me know pretty soon."
🦗 🦗🦗🦗🦗

Wash, rinse, repeat with the next few people. Then I yank the listing, tired of time wasters.

cabbey,
@cabbey@phpc.social avatar

@kevbob ugh. I have a list of things queued up to sell off cheap. Crap like that is part of why I keep adding to that list and not selling anything. :(

kboyd, to random
@kboyd@phpc.social avatar

Confession time:

I haven't seen the movie Idiocracy, and at this point I'm too afraid that it will make more sense than reality does.

cabbey,
@cabbey@phpc.social avatar

@kboyd it’s worth the watch. Even if it has somewhat moved from satire to documentary.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Leos
  • ethstaker
  • magazineikmin
  • everett
  • Durango
  • hgfsjryuu7
  • Youngstown
  • slotface
  • ngwrru68w68
  • thenastyranch
  • rosin
  • PowerRangers
  • kavyap
  • DreamBathrooms
  • anitta
  • mdbf
  • InstantRegret
  • osvaldo12
  • vwfavf
  • tacticalgear
  • cubers
  • khanakhh
  • cisconetworking
  • modclub
  • GTA5RPClips
  • tester
  • normalnudes
  • provamag3
  • All magazines