Skip to main content

New answers tagged

3 votes

Sending Firebase Cloud Messaging Notifications via FCM HTTP v1 API with PHP

I would be curious about performance gain if reusing an existing curl handle rather than init/close every time. Especially when there is a TLS handshake involved. I have not been doing much PHP for a ...
Kate's user avatar
  • 7,083
5 votes
Accepted

Sending Firebase Cloud Messaging Notifications via FCM HTTP v1 API with PHP

I'm going to do this in steps so you can follow my train of thought: 1. Make it classy First, I would wrap everything in a class. Functions that belong together go together in a class (unless you have ...
Martijn's user avatar
  • 827
3 votes

Reversing string in PHP

That is quite a "basic" example, and yet there are different approaches possible. PSR There is one things that puts me off a bit: spacing. Spacing makes code more readable, thus easier to ...
Kate's user avatar
  • 7,083
2 votes

Reversing string in PHP

Can you provide details as to what is wrong with it or how it could be done better? Starting the counter length doesn't consider multi-byte characters As was mentioned in a comment, the first ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes

Reversing string in PHP

correctness It's unclear what the specification reverse a string really means in this context. To reverse US ASCII like "hello world" is straightforward,...
J_H's user avatar
  • 30.4k
4 votes

Detect the social network of a given URL

test suite The OP code doesn't have any unit tests, and it would benefit from some. It would help the Gentle Reader to better understand what URLs are in-scope and what kind are not. specification The ...
J_H's user avatar
  • 30.4k

Top 50 recent answers are included