You should use stricter comparison here. 

 `==` will match both `0` and `false` (both can be returned by `preg_match`) and `false` would be casted to int implicitly. `1 !== preg_match` would better show the intent imho.