![]() Topic awaiting preservation: May I borrow your eyes? (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: |
![]() php code |
Bipolar (III) Inmate From: |
![]() Upon further investigation it seems I forgot a }. |
Maniac (V) Inmate From: Cell 666 |
![]() |
Bipolar (III) Inmate From: |
![]() Well, I am a relatively inexperienced PHP programmer, so if you can tell me a better/faster/cleaner way to do what I'm trying to do, I wouldn't mind borrowing them for a bit longer. |
Maniac (V) Inmate From: under the bed |
![]() I'm quite inexperienced myself, but one *small* thing I would recommend is using a Switch() instead of an if() for simple things like the greeting bit. It's faster and easier. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
![]() The poster has demanded we remove all his contributions, less he takes legal action. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() well, I'm not 100% sure about php, but I know that in Pascal switch() (or case() as they call it) is, if used properly, many times faster than an if. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
![]() The poster has demanded we remove all his contributions, less he takes legal action. |
Maniac (V) Inmate From: under the bed |
![]() I've always read and been told that switch was faster. |
Paranoid (IV) Inmate From: A graveyard of dreams |
![]() I'm no expert, but I've been told by more learned friends that if is faster for small chains, but switch is faster on larger chains. But that is in C++, might be different in PHP. |
Bipolar (III) Inmate From: |
![]() All this controversy...and started with a stupid missing }. |
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
![]() The poster has demanded we remove all his contributions, less he takes legal action. |
Maniac (V) Inmate From: under the bed |
![]() |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() I was going to ask how he benchmarked his results but I found the source code for that test here |