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
Output for git.master_jit, git.master
Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/UFBcn on line 5 Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/UFBcn on line 6 Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/UFBcn on line 7 Warning: Cannot modify header information - headers already sent by (output started at /in/UFBcn:5) in /in/UFBcn on line 14 name,email,role Alex,alex@example.com,CTO Jane,jane@example.com,Dev

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.34 ms | 523 KiB | 4 Q