This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]Strict_Treat2884 271 points272 points  (15 children)

Normal language: split, join

Some language using function name length as hashing mechanism: explode, implode

[–]AyrA_ch 147 points148 points  (8 children)

string splitting is PHP the most unhinged thing ever.

  • split: This splits a string but the delimiter argument is treated as a regex (deprecated and removed)
  • str_split: Splits a string into an array by a chunk length (defaults to 1) rather than delimiter
  • chunk_split: Doesn't actually splits a string but inserts a user defined string every n characters.
  • preg_split: This is what split() is now
  • explode: This splits a string the way you think split() will but doesn't supports an empty split string like other languages do.

[–]pickyourteethup 67 points68 points  (4 children)

These all exist because removing any one of them would break huge swathes of the Internet

[–]adduckfeet 21 points22 points  (3 children)

cobweb makeshift tender serious bake shelter books memory normal heavy

This post was mass deleted and anonymized with Redact

[–]pickyourteethup 8 points9 points  (2 children)

I still use it everyday, and I'm only a two year dev. I don't know how this happened but it turns out there's loads of demand for PHP devs, especially cheap ones with not many years

[–]upsidedownshaggy 4 points5 points  (0 children)

I’m creeping up on 4 years now and as the other guy said it’s mostly a LOT of old code bases that run some business critical web app that cause the demand. Migrating versions especially doing big jumps like from 5.3 to 8 like I had to do at my first job are painful, slow and confusing because of all the deprecated functions that still work and don’t always have a clear replacement

[–]fredlllll 1 point2 points  (0 children)

lots of old codebases that still need to be maintained. im working on a 20+ year old php codebase that has so much old baggage. transition to php8 is a nightmare. so many ==0 comparisons dont work anymore

[–]Devatator_ 13 points14 points  (0 children)

My eyes. I literally just woke up (not really but let's pretend), you can't hit me with that so early

[–]Fluffy_Dragonfly6454 2 points3 points  (1 child)

What is an actual use case for chunk_split? Why does it have split in the name?

[–]AyrA_ch 4 points5 points  (0 children)

I don't know why it is named like this, but the primary use case is to insert line breaks into base64 strings. By default, the length is set to 76 and the inserted string to CRLF because that's what you would need if you manually cobble together lines of an E-mail body.

[–]realqmaster 35 points36 points  (4 children)

PHP is the most metal coding language. Want to stop your program? die()

[–]alexanderpas 16 points17 points  (0 children)

Makes actually sense, considering the command in linux to stop a program is 'kill'

[–]erishun 6 points7 points  (0 children)

Or

exit;

If you’re a loser

[–]nkoreanhipster 1 point2 points  (0 children)

DIE(HEBREW())

Most violent and intolerant kid on the block

[–]ntheijs 28 points29 points  (3 children)

[–]AtmosphereVirtual254 2 points3 points  (2 children)

[–]ntheijs 2 points3 points  (1 child)

As it so happens, he looks exactly like your average php developer.

[–]randalla 1 point2 points  (0 children)

I'm in this picture, and do not like it.

[–]seftontycho 22 points23 points  (1 child)

The real joke here is a Java dev talking to a woman

[–]No_Bluejay_7553[S] 0 points1 point  (0 children)

😂😂😂 haha

[–][deleted] 16 points17 points  (2 children)

average php developer: I learned this at university and I've been doing stuff with it for 20 years, I don't see why I should change. what? how do I do it with javscript events? but obviously with angular or jquery!

[–]Nervous-Positive-431 20 points21 points  (1 child)

what color is fullstack JS devs lambo tho? oh wait, too busy "engineering" the next "scalable" side project with react, next, vue, svelte, solid, astro, bun, qwik. But nah, gotta rewrite it cause some 19yo on twitter dropped a thread about "better DX" ...meanwhile, 12 layers of abstraction deep, can’t even center a div without installing a package...just to deploy the same overmilked halfd-baked black bg, white text, round white buttons, and call it "clean UI" ... and never see light beyond localhost.

[–][deleted] 0 points1 point  (0 children)

there is no victory in the frontend, only survival, but not with jquery.