Skip to content
Tagged articles

strict comparison

4 articles · Page 1 of 1
php Courses
php Courses
Sep 18, 2026 · Backend Development

PHP Weak Typing Pitfalls: Secure Comparison Templates & Input Validation Code

This article details five critical PHP weak typing vulnerabilities — loose equality, empty() misuse, in_array/switch type juggling, and 0e hash collisions — and provides production-ready secure comparison templates, strict input validation functions, and a pre-deployment checklist to prevent authentication bypasses and data corruption.

PHPdeclare strict_typeshash_equals
0 likes · 6 min read
PHP Weak Typing Pitfalls: Secure Comparison Templates & Input Validation Code
php Courses
php Courses
Sep 18, 2026 · Backend Development

PHP Weak Typing Pitfalls: Why Local Works But Production Crashes

This article explains how PHP's loose comparison (==) leads to security vulnerabilities and data corruption in production due to malformed input, detailing three common scenarios—permission bypass, zero-value misjudgment, and in_array/switch bypass—and provides strict comparison, input validation, and hash_equals best practices to prevent such bugs.

Best PracticesPHPSecurity Vulnerabilities
0 likes · 7 min read
PHP Weak Typing Pitfalls: Why Local Works But Production Crashes
php Courses
php Courses
Jul 15, 2022 · Backend Development

Understanding PHP in_array() Pitfalls and Proper Usage

This article explains how the PHP in_array() function can return misleading results when the strict comparison flag is omitted, demonstrates the issue with a simple code example, and shows the correct usage as well as a comparable JavaScript approach using indexOf().

BackendPHParray_search
0 likes · 2 min read
Understanding PHP in_array() Pitfalls and Proper Usage