All articles
Every article published on Guilty Of PHP
43 articles
-
When Should a PHP Method Go in a Trait?
Use a trait for one clearly named behavior, then check that its inputs and expectations of the using class are visible before reusing it.
-
Understand PHP execution and behavior
Write and Run Your First PHP Hello World Page
Save a small PHP file, open it through your configured web server, then change its message and place it inside an HTML paragraph.
-
Declare a PHP Method Attribute and Read Its Arguments with Reflection
Define a method-only Label attribute, attach a named value, then inspect both its supplied arguments and its constructed object.
-
Read PHP Scalars in serialize() Output and Check Array and Object Round Trips
Recognize integer and string markers, then use round-trip checks to verify array entries and object state without relying on printed output alone.
-
Understand PHP execution and behavior
Avoid Misreading PHP Assignment Results and Operator Precedence
Trace a subtotal through arithmetic and assignment, then use parentheses to make numeric-string comparisons and logical assignments easier to read.
-
Understand PHP execution and behavior
Find a PHP Example and Check What It Produces
Choose an example with a stated result, check what files it needs, then compare text in an editor or a PDF in the browser.
-
Display, Check, and Change PHP Dates in Explicit Time Zones
Set UTC for current-time output, inspect a parsing warning, then modify a fixed date while keeping its original value and displaying the result in Amsterdam.
-
Understand PHP execution and behavior
Measure Current and Peak PHP Memory Usage at Script Checkpoints
Print byte readings before and after an array is created and unset, then add periodic checkpoints to a loop without mistaking a persistent peak for current usage.
-
Understand PHP execution and behavior
What Happens to PHP Memory During One Request?
Follow an array from creation through assignment, a write, and unset(), then see how reference counting, cycle collection, and memory_limit fit into the script’s lifecycle.
-
Measure PHP Attribute Lookup Costs Before Caching Reflection Results
Time the code path with and without an attribute, isolate repeated lookups from object instantiation, and cache retrieved metadata only if the measured workload benefits.
