Skip to content

u/aeveltstra

In this archive from Feb 2019 to Feb 2025

1
posts
69
comments
1
media
210
score
2 saved before deletion

If operator overload doesn’t happen by making operators into functions, PHP might have a chance to not be completely and utterly messed up by anyone, for any reason.

Rogue: someone or something that acts out of control. For instance: unvetted dependencies and packages maintained by other people. Do you have time to vet every version of package composer loads into your environment? Maybe the ones you choose directly. What about the transitive ones they need to function? Every single time you need an update?

This is not at all far-fetched. This is a problem that plagues every single dependency management system. Oversight is cost-prohibitive.

0 points

Not at all. This happens all the time in front-end engineering and frankly I’m amazed it isn’t a huge problem in PHP. PHP simply allows anyone to change the implementation of any function. Overloading operators is done by treating them as functions, and allowing their implementation to be changed. But PHP doesn’t guard its globals: everything is up for grabs. As a result, security-minded engineers stop using package managers like composer, because they can’t spend time to vet every single downloaded script.

0 points

Elaborate? Generics in Java for instance are implemented very badly: data types get erased altogether during compilation, and at runtime the engine couldn’t care less about them. If PHP is going to go that route, I’ll give conservative stubborn naysayers all the room.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.