DEV Community

Discussion on: How to write a different PHP?

Collapse
 
inxomnyaa profile image
Dan

$base_url = $url ? $url : 'localhost';

shouldn't that be

$base_url === $url ? $url : 'localhost';

otherwise the condition will always be true because you assign a variable..

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Hi Dan
Not it is not a condition, it is an assignment statement.