Skip to content

u/random_son

In this archive from Oct 2020 to Jul 2026

1
posts
36
comments
0
media
191
score

e.g. Java

Java and many other strongly typed programming languages give you the possibility to distinguish between "byte[]" and "string", where the type "string" usually "abstracts away" logic (e.g. for Unicode), which gets executed behind the scenes.

Now, since PHP has only "string" (so far (we are getting more and more typing, yay!)), it behaves as byte[] - e.g. hex2bin() or encryption related functions return or deal with raw byte[] data... A.k.a "string" in PHP for historical reasons. Changing the type "string" would break this. So, the quickest way to deal with Unicode strings without breaking stuff was to add mbstring. The other (more complete solution) would be to introduce strong typing, which would enable types like byte[].. we are not there yet

12 points

I understand what OP is saying is that there is a piece of bad code in the world that happens to be popular at the same time. And OP hopes that future PHP versions will not be compatible with that code, so that it will stop working and finally become history. OPs frustration is with the bad implementation of that particular project, because it reflects badly on PHP.

2 points

And/or maybe the server is trying to load a file, for which the server has not the correct permissions to read. E.g. the server runs as user www-data and the file is only accessible for some other user. (..too keep the example simple)

4 points

In the company, where I work, we use PHP as the glue between backend services (which are written in PHP or another lang - whatever fits the best) and the Frontend. IMO it's this place where PHP is a good fit.

1 points

It's hard to tell with that little information provided. We don't know how big the codebase is, what dependencies it has, if composer is used or not and if a test suite exists. Do you even use git, can you upgrade to PHP 8.1 without upgrading your OS?.. It's even hard to tell with all that info tbh.. because in reality you can only estimate time for a given plan. Your question is the typical part time manager type of question: "how long will the thing take that we don't know how to do yet?".

If experience exist for a task, plans can be plotted quickly based on experience and then time can be estimated. If no experience exists for a particular task yet, I would say do calculate with 2 days for investigation what possibilities exist (you are in this phase right now, I guess - take a look at "rector").

My suggestion would be to install a fork of the project (or the part of it, that needs to be upgraded) on a test environment. <- one point you can estimate how long this would take you

Then try rector to do the upgrade. You could be lucky and rector will convert the code in few seconds. I hope you have a test suite..

2 points

Already did (actually I have some codebases still doing it partially).

Fun fact: It actually works better with WSL1 because in WSL1 there is no native linux kernel involved and Windows could do native FS calls to the WSL1 side and the other way around. In WSL2 the original Linux kernel is used, which has lots of advantages - but the interoperation of FS suffered a lot because native Filesystem calls are not possible anymore - so, for example if the IDE/Editor is running on Windows and is monitoring filesystem events, using the OS native API for file-watching, it is no wonder that it will come to weird results when its watching "linux files"on a netshare with the Windows-native filewatcher :) However, the Jetbrains IDEs has a own Filewatcher API, maybe Jetbrains implements a own filewatcher that works better in this case - I am using SublimeText.

1 points

WSL2 is the way to go. But you should make sure not to host the codebase on a windows partition that the WSL2 instance reads and writes because this is super slow.

What I do is, I have a git repo on my windows where I do modifications to the code and a 'bare repo' on the Linux side, that serves as a 'git remote' where I push my commits to. On the Linux side I pull it. It sounds more cumbersome that it actually is and with some helper scripts it just works fine.

About the "Apache" part: in the end you will stick to the companies choice but I have the feeling that the world moved to NGINX.

7 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.