<?php
function readJsonLines(string $path): Generator {
$fh = fopen($path, 'r');
if (!$fh) throw new RuntimeException("Cannot open $path");
try {
while (($line = fgets($fh)) !== false) {
$line = trim($line);
if ($line === '') continue;
yield json_decode($line, true, 512, JSON_THROW_ON_ERROR);
}
} finally {
fclose($fh);
}
}
foreach (readJsonLines('events.jsonl') as $event) {
if ($event['type'] === 'signup') process($event);
}
Create a free account and build your private vault. Share publicly whenever you want.