@timwolla@phpc.social avatar

timwolla

@timwolla@phpc.social

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

heiglandreas, to random
@heiglandreas@phpc.social avatar

That's a new one: Unable to create an Email from an instance of "Symfony\Component\Mime\Message" as the body is too complex.

🙈 😱

timwolla,
@timwolla@phpc.social avatar

@heiglandreas @symfony I don't use Symfony’s mailer, but:

> The transport mechanism should not have anything to do with that!

Some transport mechanisms require doing special stuff. I encountered that myself with PHP’s mail function, which will parse the recipient headers from the RFC 5322 message for use in the envelope, instead of allowing an explicit specification.

This makes it impossible to send a multi-recipient email that is customized for each recipient (e.g. to use different headers).

beberlei, to random
@beberlei@phpc.social avatar

Together with my new co-author @timwolla we are restarting the discussion on the #[\Deprecated] attribute RFC.

See https://wiki.php.net/rfc/deprecated_attribute and thread on internals ML.

timwolla,
@timwolla@phpc.social avatar

@alessandrolai @beberlei

Personally I prefer such questions being asked on the mailing list, so that all the relevant information can be collected in a centralized location for everyone to see.

As for the question itself: It would probably be possible, but semantics would likely be pretty questionable: What should ReflectionFunctionAbstract::isDeprecated() return? How should static analysis tools interpret the attribute? Would they need to execute arbitrary complex code?

zeriyoshi, to random Japanese
@zeriyoshi@phpc.social avatar

My back pain for some time was due to ossification of the posterior longitudinal ligament (OPLL). I am having surgery the day after tomorrow. I may not be able to respond for a while.

timwolla,
@timwolla@phpc.social avatar

@zeriyoshi Best of luck that the surgery helps! 🤞

heiglandreas, to random
@heiglandreas@phpc.social avatar

TIL: It is a stupid idea to name a docker network "host". Especially when it is using the "host" driver....

🤦‍♂️

If you are curious now: DO NOT TRY THIS AT HOME!

failed to create network project_host: Error response from daemon: only one instance of "host" network is allowed

But also

"Error response from daemon: host is a pre-defined network and cannot be removed

I might have to reinstall docker now...

🙈

timwolla,
@timwolla@phpc.social avatar

@heiglandreas Doesn't the first error message say that you attempted to call it project_host? 🤔

timwolla,
@timwolla@phpc.social avatar

@heiglandreas Docker uses the name you give it. Do you mean Docker Compose?

beberlei, to random
@beberlei@phpc.social avatar

How can I achieve a 94% performance boost? In this particular case, by an optimization in the DOM extension. Thanks @nielsdos
Read more about this performance fix in my latest blog post.

https://tideways.com/profiler/blog/measuring-the-dom-namespace-reconciliation-performance-fix?utm_medium=social&utm_source=twitter&utm_campaign=measuring-the-dom-namespace-reconciliation-performance-fix

timwolla,
@timwolla@phpc.social avatar

@Crell @nielsdos @beberlei No. Looking at the code it's a single-linked list. To insert at the end you need to traverse it in full. Effectively:

$item = $listStart;
while ($item->next !== null) {
$item = $item->next;
}
assert($item->next === null);
$item->next = $newItem;

Reindexing is not a thing for linked lists, because they don't have an index.

timwolla,
@timwolla@phpc.social avatar

@Crell @nielsdos @beberlei With the fix roughly doing:

$item = $listStart;
$newItem->next = $item->next;
$item->next = $newItem;

avoiding the loop.

pwaring, to php
@pwaring@fosstodon.org avatar

Was pondering how to write a C implementation of a PHP function (explode - converts a string into an array of strings based on a separator string). It took a while before I remembered that PHP itself is written in C, therefore a C implementation exists of all PHP standard library functions.

(I will still write my own, because it's a useful learning experience)

#c

timwolla,
@timwolla@phpc.social avatar

@ramsey @pwaring Pointer arithmetic is not something special for a C algorithm and most certainly doesn’t deserve an explicit mention. It’s like saying a plumber uses a wrench to fix your sink 😜

heiglandreas, to random
@heiglandreas@phpc.social avatar

I am having fun creating an office 365 account.... 🤣

At least in Safari I get further than in Firefox... 🤦‍♂️

A screenshot just saying "Konto erstellen". Nothing else. It looks like the system and firefox do not get along very well....

timwolla,
@timwolla@phpc.social avatar

@heiglandreas Microsoft / Outlook is notoriously bad with regard to the blocklisting and unblocking.

I had good success with Hetzner's tutorial: https://docs.hetzner.com/de/robot/dedicated-server/troubleshooting/microsoft-blacklist/.

timwolla,
@timwolla@phpc.social avatar

@heiglandreas Local IP address as in your home IP address? That's likely on quite a few policy blocklists, unless you have a business contract (and possibly even then).

Crell, to php
@Crell@phpc.social avatar

Let's be controversial: In modern , you should never type-hint an array.

https://peakd.com/php/@crell/php-never-type-hint-on-arrays

timwolla,
@timwolla@phpc.social avatar

@Crell You also shouldn't call it “hint”, no matter if it's an array or something else 😜 (unless you're dealing with PHPDoc, i.e. lies).

Girgias, to php
@Girgias@phpc.social avatar

So trying out my custom domain to send emails to the internals list and it falls in the spam folder in GMail, which is confusing :|

Anyway, new RFC: https://wiki.php.net/rfc/http-last-response-headers

timwolla,
@timwolla@phpc.social avatar

@Girgias You've configured a DMARC record with a quarantine policy. The list breaks any DKIM signatures (due to the Subject and Body modification) and without listing the ML server in a SPF record the emails won't be authenticated and thus quarantined according to the stated preferences.

I believe that the ML performs DMARC mangling for p=reject, alternatively use p=none as your DMARC policy.

timwolla,
@timwolla@phpc.social avatar

@Girgias @saki Yes. The list should stop modifying the email contents and then the original DKIM signature would remain valid. Alternatively it would need to perform DMARC mangling for p=quarantine, but that's the worse solution.

timwolla,
@timwolla@phpc.social avatar

@saki @Girgias That's what the list-id header that the list adds is for. It's a much more reliable solution for automatically filtering the emails.

timwolla,
@timwolla@phpc.social avatar

@heiglandreas @Girgias @saki Yeah qmail and ezmlm is not exactly what I would consider “modern” 😀

timwolla,
@timwolla@phpc.social avatar

@heiglandreas (dropping the cc list) Huh, since when is the list DKIM signing the mails? And why is there no matching DNS record for the signing key:

dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=php.net header.i=@php.net header.b="eSVy3AwZ";

timwolla,
@timwolla@phpc.social avatar

@heiglandreas It's adding the footer and mangles the Subject for all emails. For senders with a p=reject policy it will perform DMARC mangling (meaning it will replace the From header by internals@lists.php.net with a name of "Foo Bar via internals").

timwolla,
@timwolla@phpc.social avatar

@heiglandreas For non-DMARC p=reject domains the From header will be the original one. That's why Gina's email was marked as spam, as DMARC mangling was not performed for it (due to p=quarantine).

nyamsprod, to php French
@nyamsprod@phpc.social avatar

I wish had two things and none of them involve generics... I wish it had type aliases and a native base32 encoding/decoding mechanism (in a class or a pair of functions I do not care)

timwolla,
@timwolla@phpc.social avatar

@nyamsprod Agreed with regard to base32. Though my use cases so far have all been security-sensitive (TOTP secrets), thus needing to use https://github.com/paragonie/constant_time_encoding anyway.

SenseException, to php German
@SenseException@phpc.social avatar

Now that 8.1 is in Security Support and it's a great idea to update to 8.2, it's also a good idea to remind you of the existence of the class .
Example:
https://3v4l.org/pshYq
And because we love Attributes:
https://3v4l.org/C0j7M

Don't expose critical data.

timwolla,
@timwolla@phpc.social avatar

@SenseException To add to that: Attributes are backwards compatible, they don't need to be backed by a class. Thus can be applied to code that still needs to run on 8.1, without breaking anything (e.g. libraries). Below PHP 8.2 it will not do anything by default, but for the case of SensitiveParameter this doesn't matter, as you are no worse off than without the attribute. And libraries could still detect the attribute in stack traces by themselves!

Crell, (edited ) to php
@Crell@phpc.social avatar

Magic in code/APis is not bad. Excessive magic is bad.

Magic (aka, "things happen automatically") should be limited, self-evident, transparent, and discoverable. But not verboten.

timwolla,
@timwolla@phpc.social avatar

@Crell I assume you meant to use the German word for "forbidden" there? That would be "verboten" with a single "t".

heiglandreas, to random
@heiglandreas@phpc.social avatar

TIL class-constant handling in PHP is completely bollocks...

I'll use for internal stuff private constants and for everything that is used in more than one class I'll create Enums.

Everything else is a mess.

I'll need some more research for a blogpost though....

timwolla,
@timwolla@phpc.social avatar

@heiglandreas I believe there are valid use-cases for class constants. For example the format constants on DateTimeInterface:

https://www.php.net/manual/en/class.datetimeinterface.php

timwolla,
@timwolla@phpc.social avatar

@heiglandreas That would be a misuse of an enum. Enums are meant for a “finite”, and ideally never or rarely changing, set of valid values where you want the help of the type system to ensure you don't receive anything invalid.

The list of legal format strings is infinite, the ones in the constants are just some commonly used ones.

Also, backed enums are terrible in general.

timwolla,
@timwolla@phpc.social avatar

@heiglandreas I'm with you regarding the use of IntlDateFormatter over the format method.

However your use of the words “perhaps one or two” really indicates that the list of formats isn't a finite set, as you were not able to actually enumerate all the valid format strings.

heiglandreas, to random
@heiglandreas@phpc.social avatar

TIL for Symfonys Serializer it is a difference whether the method is called isDSTTransition or isDstTransition ...

I wish I could get that lost hour back somehow...

timwolla,
@timwolla@phpc.social avatar

@heiglandreas

> I wish I could get that lost hour back somehow...

Easy, just change your UTC offset by one hour 😜

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