3v4l.org

run code in 500+ PHP versions simultaneously
<?php // build something entirely in memory... $fp = fopen('php://memory', 'r+'); fputcsv($fp, ['name', 'email', 'role']); fputcsv($fp, ['Alex', 'alex@example.com', 'CTO']); fputcsv($fp, ['Jane', 'jane@example.com', 'Dev']); rewind($fp); $csv = stream_get_contents($fp); fclose($fp); // send as download header('Content-Type: text/csv'); echo $csv; // php://temp, same but spills to disk over 2MB... or more! $fp = fopen('php://temp/maxmemory:8388608', 'r+'); // 8MB in RAM, then auto-swaps to a temp file // no gc, no unlink(), no /tmp pollution // the stream disappears when $fp is closed

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.60.0140.00316.69
8.5.50.0110.00616.76
8.5.30.0270.00516.23
8.4.210.0160.00619.40
8.4.180.0110.01021.55
8.4.90.0120.00919.70
8.3.180.0110.00716.62
8.3.50.0100.00916.53

preferences:
22.88 ms | 522 KiB | 5 Q