languages icon indicating copy to clipboard operation
languages copied to clipboard

Simplify PHP code for fibonacci

Open joanhey opened this issue 8 months ago • 0 comments

I have:

  • [x] Read the project README, including the benchmark descriptions
  • [x] Read the PR template instructions before I deleted them
  • [x] Understood that if I have changed something that could impact performance of one or more contributions, I should provide results benchmark runs, using the run.sh script, from before and after the change.

Description of changes

~First a == comparison is slower than a === comparison. As we have match now, we can simplify the code, and as match() is a === comparison (equality) teorically need to be faster.~

Use $n < 2 only 1 comparison like in other languages. So it's faster.

joanhey avatar May 15 '25 19:05 joanhey