Total tests: 244
Tests passing/ignored: 109
Tests failing: 135

That means I'm 45% done porting this hobby project. It's nice having tests. (Some are unit tests, some are functional / webtestcase tests)

Running psalm on a codebase ... 89% done (thousands of files) and it's been stuck on a single file for about ten minutes. Must be a monster file. And this is with 8 threads.

Note: When implementing "offsetGet", it is vitally important that your method should have a "return" statement.

Ask me how I know.

Well, so far porting to Symfony is going faster than rolling my own microframework, but it's not one iota less frustrating. And I'm anticipating many headaches down the road, due to the app being ported working in ways that are orthogonal to how SF likes to do things.

But it needs to be done. Otherwise the code can't be upgraded at all.

Lessons:

1. Remember to write tests

2. Tests will lie to you if you're not careful

3. Code can look correct yet still be silently wrong

4. Silently-wrong code can be live for months or years with no one noticing

5. Computers were a mistake. I need a sailboat and a long break from everything.

Show thread

Peak "how did this ever work" today in PHP land. I was debugging a method that was improperly returning an empty array. Dig into the code ... and found that it was hard-coded to do so.

But oh! Polymorphism meant a subclass had a non-empty-returning implementation.

Yet that was still improperly returning an empty array.

Ultimately, the very innermost method was returning an array with the wrong schema, which caused subsequent lookups to be blank.

A one-line fix got it working.

Answer: array_udiff() plus the spaceship operator.

Show thread
kboyd boosted

While digging through this obvious scam, I did manage to learn that OSM already has this. It's called "KartaView" (though as one point also had the more reasonable sounding name "OpenStreetView") wiki.openstreetmap.org/wiki/Ka

Support OpenStreetMaps, do not support those sketch AF looking clowns with a crypto-mining-dash-cam.

Show thread

Apparently array_diff doesn't like to compare arrays of arrays. Hmm. Wonder what I should be using instead.

... and while the internal jax library might be able to support cpu-bound rendering using the 'iree' variant rather than the 'cuda' one, it's refusing to install jaxlib, so I can't even try that out ...

Show thread

Drat. Tried playing with Dall-E Mini in a local docker/colima instance, and found out that it doesn't support Apple Silicon.

Went on a bit of a domain purchasing spree yesterday, but in a wonderful twist on that old saw, I also actually built and shipped a webpage on one of them:

sailingcoops.com - a directory of cooperative and nonprofit sailing organizations.

No, I think I won't be adding that to my domain cart.

Soon, the birbsite will introduce Twitter Paper™️, a daily printed digest of the best tweets from the people you follow.

You can read your TP and then upcycle it at your leisure.

Just when I thought I was starting to understand the depths of weirdness to which the world can sink ...

wat.

Current status: Wondering if I'll have to ditch a database droplet on DigitalOcean and switch to a database cluster ... a 200% price increase - if it can even handle the same workload, otherwise I'd have to go to the larger cluster sizes (6x and 12x the current cost, respectively, for the larger sizes)

Hobby projects can get expensive, it seems.

Today I realized a few minutes too late that using the php array index of "wat" is a bad idea when my goal was to demo an approach to using getters.

kboyd boosted
Show older
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.