bolha.us is one of the many independent Mastodon servers you can use to participate in the fediverse.
We're a Brazilian IT Community. We love IT/DevOps/Cloud, but we also love to talk about life, the universe, and more. | Nós somos uma comunidade de TI Brasileira, gostamos de Dev/DevOps/Cloud e mais!

Server stats:

252
active users

#php

108 posts91 participants15 posts today

floss.social/@servo/1142632664 I don't have any stake in @servo, but I very much agree with @delan against the use of AI.

Already having need to deal with multiple people using AI to comment on #PHP doc issues to just regurgitate nonsense that confuses the author or said issue by trying to be "helpful" is a recurring thing that wastes my time and makes me angry.

FLOSS.socialServo (@servo@floss.social)Thanks to those who attended March's TSC meeting yesterday. The minutes are now available on GitHub: https://github.com/servo/project/blob/main/governance/tsc/tsc-2025-03-31.md

In my public PHP libraries, I've taken to using `strspn()` to determine whether a string has allowed characters, e.g.:

```
strspn($string, CHARS) === strlen($string)
```

I can't remember why I started doing this, and I haven't run the benchmarks, but this might be more performant than using regular expressions. Does anyone already know if that's the case?

There's no `mb_strspn()`, so what would you use if you were trying to avoid regex and needed to match multibyte characters.

#ampache is now using the new #discogs #php library which has been extracted from the code into it's own library.

The goal is to keep it simple for data retrieval and it will hopefully be usable for others in their own #dev work.

Check it out here
github.com/ampache/php-discogs

Simple PHP Discogs API client. Export from ampache/ampache code - ampache/php-discogs-api
GitHubGitHub - ampache/php-discogs-api: Simple PHP Discogs API client. Export from ampache/ampache codeSimple PHP Discogs API client. Export from ampache/ampache code - ampache/php-discogs-api

#PHP operations on #mysqli are a treat. They return either the expected object, or a true/false boolean.

Connection fails? Boolean. Succeeds? Connection object. Preparing an #SQL statement fails? Boolean. Succeeds? Statement object. Binding parameters to prepared statement fails? Boolean. Succeeds? Boolean. Executing the statement fails? Boolean. Succeeds? Boolean as well, or an associative array, depending on intent.

And thanks.