User Tools

Site Tools


programmieren:php:wichtigefunktionen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
programmieren:php:wichtigefunktionen [2026/08/07 16:25] – Debugging functions adminprogrammieren:php:wichtigefunktionen [2026/08/21 16:04] (current) – memory usage admin
Line 26: Line 26:
 Native PHP. Native PHP.
 Basically echoes any variable with all its details to whatever interface you're working on. Great to see what actual data you get from something like an API. Basically echoes any variable with all its details to whatever interface you're working on. Great to see what actual data you get from something like an API.
 +
 +===== Memory Usage functions =====
 +
 +Theres functions in PHP to measure and display your current and your peak memory usage:
 +
 +<code php>
 +$memoryCurrentlyUsed = memory_get_usage(true) // The parameter makes it take the real allocated usage
 +
 +$memoryPeakUsage = memory_get_peak_usage(true) // These will give back an int value of bytes used
 +
 +memory_reset_peak_usage() // Needs to be run to reset the peak usage, if needed
 +</code>
 +
programmieren/php/wichtigefunktionen.txt · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki