Questions

PHP questions

Choose a question page, learn the concept, then test your understanding with a quiz.

PHP Maximum Execution Time Exceeded: Diagnose and Fix Long-Running Scripts

Learn why PHP scripts exceed maximum execution time, how to diagnose slow loops and downloads, and safely use timeouts, batching, and pagination.

phpjson

PHP Newline Characters: Single vs Double Quotes

Learn why PHP prints \r\n literally in single quotes and how to create real newline characters for text files, browsers, and Windows Notepad.

phpstring-interpolation

PHP Null Coalescing Operator (??): Meaning, Usage, and Examples

Learn what the PHP null coalescing operator (??) means, how it differs from isset() and ?:, and how to use it safely in real code.

phpoperator-keyword

PHP Random String Generator: Return Values, Scope, and Correct String Building

Learn how to generate a random string in PHP, fix scope mistakes, and build strings correctly with practical examples.

phpstringrandom

PHP Short Tags Explained: Should You Use `<?` and `<?=` in PHP?

Learn when PHP short tags are acceptable, why they are discouraged, and how `<?`, `<?=`, and `<?php` differ in real projects.

phpphp-shorttags

PHP Static Code Analysis: Finding Bugs Beyond Syntax

Learn how PHP static analysis finds type errors, undefined variables, dead code, and style issues before runtime, with practical PHP examples.

phpcode-analysisstatic-analysis

PHP Syntax Symbols Explained: Operators, Tokens, and What They Mean

Learn what common PHP syntax symbols mean, including operators like ==, ===, ->, =>, ??, ?:, and more with clear examples.

phpargumentsoperatorssymbols

PHP Thread Safe vs Non-Thread Safe: What It Means and Which One to Use

Learn what thread-safe and non-thread-safe PHP builds mean, how they differ, and which PHP package to choose for Apache, FastCGI, and CLI use.

phpmultithreadingpackagethread-safety

PHP Variable to String: PHP Equivalent of Java/.NET ToString()

Learn how to convert PHP values to strings, when casting works, and how __toString() compares to Java and .NET ToString().

phpstring

PHP cURL Custom Headers: Sending HTTP Request Headers

Learn how to send custom HTTP headers with PHP cURL using CURLOPT_HTTPHEADER, including syntax, examples, debugging, and common mistakes.

phpcurl

PHP cURL HTTP POST Example: Sending Form Data and Reading the Response

Learn how to make an HTTP POST request with PHP cURL, send form data, and read the server response with clear examples.

phphttpcurlhttp-post

PHP define() vs const: Differences, Usage, and Best Practices

Learn the difference between define() and const in PHP, when to use each, and how constants behave in classes, files, and runtime code.

phpconstantspsr-1psr-12

PHP json_decode(): Decode JSON as an Associative Array

Learn why json_decode returns stdClass objects by default in PHP and how to decode JSON into associative arrays safely and correctly.

phparraysjson

PHP new self vs new static: Understanding Late Static Binding

Learn the difference between `new self` and `new static` in PHP, including late static binding, inheritance behavior, and practical examples.

phpstaticlate-static-binding

PHP require vs include vs require_once vs include_once Explained

Learn the difference between require, include, require_once, and include_once in PHP, with examples, errors, and when to use each one.

phpincluderequirerequire-once

PHP self vs $this: Difference, Usage, and When to Use Each

Learn the difference between self and $this in PHP, when to use each, and how static vs instance context works with clear examples.

phpclassoopscope

Pretty-Printing JSON in PHP with json_encode

Learn how to pretty-print JSON in PHP using json_encode, including syntax, examples, common mistakes, and real-world usage.

phpjsonpretty-print

Public vs Private vs Protected in PHP Classes

Learn the difference between public, private, and protected in PHP classes, when to use each, and how visibility affects methods and properties.

phpoopprivatepublic

Python Equivalent of PHP var_dump(): repr, pprint, type, and vars

Learn Python alternatives to PHP var_dump(), including repr(), pprint(), type(), vars(), and inspect tools for clear debugging output.

phppythondebugging

Run a Single PHPUnit Test Method with --filter

Learn how PHPUnit's --filter option selects one PHP test method, including regex patterns, command argument order, and reliable examples.

phpphpunit

Page 6 of 7 - 136 questions