Show newer

Went for a walk today & took a photo of an old rusted car wreck. I'd taken a photo of the same wreck 10 years ago, and thought it would be fun to try again. flickr.com/photos/beryllium/51

PHP Notices poll (or notices in any lang)

Aha. I think what I need to do in order to understand all the fiddly draggy and droppy bullshit bits of XCode+Swift ... is version the project in git and look at the damned diffs.

Anything less precise seems utterly inscrutable.

The hull is actually much cleaner than the photo suggests; I think a lot of the speckledness is from light reflecting off the water, amplified by computer-driven postprocessing settings.

Show thread

Sailboat photo from this weekend: flic.kr/p/2kJgNCV

Not my boat, although it could be for the low, low price of $15,900 CDN.

I want to propose "final abstract class" as a solution to this: it can be extended, and the abstract methods can be added, but nothing more than that can be done. And the extended class has to be final itself.

Show thread

Is there any way to say in an abstract class that any implementing classes cannot add extra methods, only define the abstract ones?

Not ideal, but I discovered a way around this: reading inbound messages from the API and reacting to them locally. Aka, polling. 🤷 I guess it works, for now.

Show thread

Maybe there's a way to do this same thing with array_* functions, but nothing came to mind.

Show thread

I just came up with the most brutal hack to use array_reduce with short functions ... heh.

Since "add to the array" and "return the array" are two operations, I turned them into a single one by using a ternary:

```php
array_reduce(
$items,
fn ($carry, $item) =>
($carry[$item['category']][] = $item)
? $carry
: $carry,
[]
);
```

It eventually came back online; after several further issues with exhausted memory, I finally figured out that `make -j4` was just too taxing for the system (Pi 3 Model B)

Show thread

Me: "I have an idea: I'll compile PHP 8.0.3 on my Raspberry Pi"

Also me: "Now I can't SSH into my Raspberry Pi because, I assume, the CPU melted."

Is it possible to use Twilio functions as the target for an sms number, and make it queue up a list of incoming texts that I can then retrieve in bulk using a computer on my local network, so that I don't have to spin up a server instance?

This fine friday afternoon, I am writing code cheques my monday morning ass won't be able to cash.

There's still an hour left. That's enough time to write some tests for this. Monday Me will appreciate that.

kboyd boosted

We can fly a helicopter on Mars, but can't turn on the lights in Texas because scientists are in charge of Mars, but Republicans are in charge of Texas.

Spent some time yesterday playing with Github Actions. The marketplace seems to make it easy to make headway for newbies such as myself, but handing over control like that is still a bit unnerving.

I found a way to set my ZSH_THEME differently in PHPStorm than in the terminal (because I run the IDE in light mode, like a monster, but the terminal in dark mode as intended)

In .zshrc:
```
if [[ -z "$ZSH_THEME" ]]; then
ZSH_THEME="agnoster"
fi
```

Then in PHPStorm, I can specify a ZSH_THEME environment key to set the theme I want.

... doctrine/dbal. illuminate/database. something else? Raw PDO? I dunno.

Current status: Getting php8.0 & extensions installed via macports. I wonder why php80-imagick doesn't exist ...

Well, Travis still doesn't like PHP 8, even though it has been added to PHP-build. I guess it takes time for all that stuff to percolate through the ecosystem :) Guess that means I'll be intentionally merging with "failing" tests, though.

Show older
PHP Community on Mastodon

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