item4 / worst-php-code

DO NOT WRITE PHP CODE LIKE THIS
Other
14 stars 0 forks source link

PHP string 비교할 때 type confusion #3

Open marnitto opened 8 years ago

marnitto commented 8 years ago
marnitto@icicle ~ $ php -v
PHP 5.6.24-pl1-gentoo (cli) (built: Jul 28 2016 16:32:18)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
marnitto@icicle ~ $ php -a
Interactive shell

php > $something = 0;
php > echo ('password123' == $something) ? 'true' : 'false';
true
item4 commented 8 years ago

현재 소스코드의 모든 비교 연산자는 ==, !=를 쓰고 있는데, 이것을 위한 밑작업입니다. (!)