Похожие чаты

$Compare1 = 1234; $compare2 = '1234'; if ($compare1 == $compare2) {

// type juggling concern
}

if ((int)$compare1 === (int)$compare2) {
// not type juggling
}Which one is more preferred in terms of security and performance? Have there been a benchmark test done on this kind of stuff?

9 ответов

5 просмотров

in most of the cases, uses === instead of ==

Generally being stricter during programming has always better results at the end and cleaner code. So i think === is mostly better if u can afford it. But it doesn't make sense if u gonna type cast the variables before checking (string) then u r doing == again

Found answer for this?

Mser
Found answer for this?

It's a 2 year old post

Mser
Found answer for this?

Anyway, personally I would prefer the second one as it is more explicit what you are doing and expecting

Mser
Found answer for this?

isnt the test easy as hell? you just execute both comparisons timed a few thousand oder million times untill you see a difference in the times oO

Sunbro
isnt the test easy as hell? you just execute both...

or is there something i should know which could interfere regarding the php interpreter

Sunbro
isnt the test easy as hell? you just execute both...

I'm on detailed web assessment and source code review project , just validating vulnerability

Mser
I'm on detailed web assessment and source code rev...

then the question is still what you are trying to accomolish in said comparison

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта