PHP Articles

All articles

"Deprecated: Implicit conversion from float to int loses precision" in PHP — What It Means and How to Fix It

What the PHP error "Deprecated: Implicit conversion from float to int loses precision" means and how to fix it.

"Parse error: syntax error, unexpected end of file" in PHP — What It Means and How to Fix It

What the PHP error "Parse error: syntax error, unexpected end of file" means and how to fix it.

"Call to undefined method X::y()" in PHP — What It Means and How to Fix It

What the PHP error "Call to undefined method X::y()" means and how to fix it.

"Fatal error: Uncaught Error" in PHP — What It Means and How to Fix It

What the PHP error "Fatal error: Uncaught Error" means and how to fix it.

"Array to string conversion" in PHP — What It Means and How to Fix It

What the PHP error "Array to string conversion" means and how to fix it.

"Only variables should be passed by reference" in PHP — What It Means and How to Fix It

What the PHP error "Only variables should be passed by reference" means and how to fix it.

"Access to undeclared static property" in PHP — What It Means and How to Fix It

What the PHP error "Access to undeclared static property" means and how to fix it.

"Uncaught TypeError: Argument #1 ($x) must be of type X" in PHP — What It Means and How to Fix It

What the PHP error "Uncaught TypeError: Argument #1 ($x) must be of type X" means and how to fix it.

"Cannot modify header information - headers already sent" in PHP — What It Means and How to Fix It

What the PHP error "Cannot modify header information - headers already sent" means and how to fix it.

"Headers already sent" in PHP — What It Means and How to Fix It

What the PHP error "Headers already sent" means and how to fix it.

"Maximum execution time exceeded" in PHP — What It Means and How to Fix It

What the PHP error "Maximum execution time exceeded" means and how to fix it.

"Allowed memory size exhausted" in PHP — What It Means and How to Fix It

What the PHP error "Allowed memory size exhausted" means and how to fix it.

"Trying to access array offset on value of type X" in PHP — What It Means and How to Fix It

What the PHP error "Trying to access array offset on value of type X" means and how to fix it.

"Cannot redeclare function X()" in PHP — What It Means and How to Fix It

What the PHP error "Cannot redeclare function X()" means and how to fix it.

"Call to undefined function X()" in PHP — What It Means and How to Fix It

What the PHP error "Call to undefined function X()" means and how to fix it.

"syntax error, unexpected token" in PHP — What It Means and How to Fix It

What the PHP error "syntax error, unexpected token" means and how to fix it.

"Class "X" not found" in PHP — What It Means and How to Fix It

What the PHP error "Class "X" not found" means and how to fix it.

"Call to a member function X() on null" in PHP — What It Means and How to Fix It

What the PHP error "Call to a member function X() on null" means and how to fix it.

"Undefined array key" in PHP — What It Means and How to Fix It

What the PHP error "Undefined array key" means and how to fix it.

"Undefined variable $x" in PHP — What It Means and How to Fix It

What the PHP error "Undefined variable $x" means and how to fix it.

How to Securely Hash Passwords in PHP

Use PHP's password_hash() and password_verify() functions to store and check passwords securely — never store plain text or use md5/sha1 for passwords.

self:: vs static:: in PHP

self:: always refers to the class where it's written; static:: resolves to the actual called class at runtime, enabling late static binding.

How Composer Autoloading Works in PHP

Composer's autoloader maps namespaces to folders via PSR-4, so classes load automatically without manual require statements. Learn how it works and how to regenerate it.

What Are PHP Namespaces and Why Do You Need Them?

PHP namespaces prevent class and function name collisions between libraries. Learn the namespace/use syntax and how PSR-4 autoloading relies on them.

isset() vs empty() vs is_null() in PHP

isset() checks a variable exists and isn't null; empty() also treats '', 0, and false as empty; is_null() strictly checks for null. Learn the differences.

PHP Sessions vs Cookies — What's the Difference?

Cookies store small data on the client browser; sessions store data server-side and use a cookie only to reference it. Learn when to use each in PHP.

Essential PHP Array Functions You Should Know

A practical guide to array_map, array_filter, array_reduce, in_array, and array_merge — the PHP array functions used in almost every codebase.