Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Use === and !== in null checks instead of == and != #7412

Merged
merged 2 commits into from
May 4, 2015

Conversation

samsonasik
Copy link
Contributor

Test :

$foo = '';
echo "\r\nTest with == \r\n";
if ($foo == null) {
    echo 'foo is null';
} else {
    echo 'foo is not null';
}

echo "\r\n-------------------\r\n";

echo "\r\nTest with ===\r\n";
if ($foo === null) {
    echo 'foo is null';
} else {
    echo 'foo is not null';
}

Result :

Test with == 
foo is null
 ------------------- 
Test with === 
foo is not null

@Xerkus
Copy link
Member

Xerkus commented Apr 3, 2015

best name and description 👍

@samsonasik samsonasik force-pushed the null-three branch 2 times, most recently from 044f8f6 to edd08f4 Compare April 3, 2015 11:08
@DASPRiD DASPRiD changed the title Null check uses === and !== instead of == and != Use === and !== in null checks instead of == and != Apr 3, 2015
@weierophinney weierophinney added this to the 2.4.1 milestone May 4, 2015
weierophinney added a commit that referenced this pull request May 4, 2015
Use === and !== in null checks instead of == and !=
weierophinney added a commit that referenced this pull request May 4, 2015
@weierophinney weierophinney merged commit edd08f4 into zendframework:master May 4, 2015
weierophinney added a commit that referenced this pull request May 4, 2015
@samsonasik samsonasik deleted the null-three branch May 5, 2015 14:27
weierophinney added a commit to zendframework/zend-authentication that referenced this pull request May 14, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-authentication that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-barcode that referenced this pull request May 14, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-barcode that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-paginator that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-paginator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-file that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-file that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
…ull-three

Use === and !== in null checks instead of == and !=
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants