I am not a PHP expert, but have you considered writing unit test data to get a concrete understanding of these functions. If you are unsure of your reliability and the documentation is unclear, then nothing beats the unit test, which can test 1000 permutations and their expected result.
You really donβt even have to go as far as I imagine that you want to test only some special cases. Your programming skills and compiler are your best friend here. The program you are writing will either confirm or refute your suspicions.
In addition, to throw a bonus, you can monitor how much time each method takes and see which is more effective.
Just a thought.
source share