Skip to content

u/Lelectrolux

In this archive from Sep 2015 to Sep 2026

5
posts
1k
comments
0
media
3.4k
score

Top posts

Eager loading in Eloquent : $region->hotels->first()->region make 3 queries instead of 2 ? Why ?

Lets say i have 2 Eloquent models, Region and Hotel. Each hotel has a web page with a slug url created from region name and hotel name. public function getSlugAttribute() { return \Str::slug($this->name.'-'.$this->region->name); } In one page i have a list of hotels by regions, loaded like this : $r...

5 points3 comments
Open on Reddit

Is there a complete resource on what you need to know when dealing with WYSIWYG editor in backend languages ?

This is more of an open ended discussion on what you think are best practive or good ways to deal with a wysiwyg editor on backend and rendering on front. I've never found any resource that felt complete and secure (except the markdown ones but I'll need html) I've always avoided the problem by havi...

0 points3 comments
Open on Reddit

Top comments

I'm a nobody in PHPLand, but I'd like to thank /u/nikic for all the good work these last few years. And even the years before.

You really pushed the language a long way. (I know, team effort, but still)

Sad to see you go, but all the best to you in LLVMLand.

I do hope the torch will be picked up by this PHP Foundation initiative.


EDIT : I kinda like that my best comment ever is thanking someone else

130 points

Obviously they think the added value doesn't outweight the cost in breaking change it would create.
Too hard of an upgrade path is how you end up with a dead/split community.

Python 2 still being used a lot today when Python 3 was released in 2008.
Vue 3 is still controversial and not that well supported by some keystone libraries 1 year later. It's not even too related to the bc breaks, mostly about option vs composition api.

The longer a project lives, the more people value stability and forward compatibility over the new hotness.
I currently have 6 projects coasting along in maintenance only mode, while I work on other things. I don't want a pain in the ass upgrade to the next LTS if I can afford it.

54 points

Because the extra perf ain't worth the extra complexity and gotcha's for a lot (most even) of applications.

Long running processes are always a pain at some point. If you need it, it's great that it exists.

I don't have nearly enough traffic on the websites and internal tools that pay me to even care.

45 points

PHP can do it just fine. I might go with NodeJs if websockets are absolutely central to your app (but you can do it just fine with pusher in php) and golang if there is some heavy non web specific problems (math, thumbnail generation from video, ...). But again, PHP can do it just fine too. Don't bother learning a language just for that.

Look into redis (data cache), look into varnish (http cache), look into static storage (AWS or digital ocean spaces, for static files), look into offloading costly processes (memory or time) to queues (even better if queues run on a separate server).

Cache long computations whenever you can (sql queries especially).

Remember, bottlenecks ain't just about memory or time, but also parrallelism. Caching your fastest query, if it is done on 1k req/s, might be better than your longest if done on 5req/s. It memory * req/s and time * req/s you want to look at.

Unless you are doing something pretty funky, 1k-5k concurrent will be dealt with easily. Even with only half of the above.

45 points

Subreddits

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.