3v4l.org

run code in 300+ PHP versions simultaneously
<?php // fake function to simulate what a query with PDO::FETCH_COLUMN will return function returnWords(?PDO $pdo, string $category, int $limit): array { $words = []; for ($i = 0; $i < $limit; $i++) { $words[] = 'Word' . rand(1, 99); } return $words; } $pdo = null; $limit = 4; $categories = ['0', '33', '67']; $words_joined = ''; foreach ($categories as $category) { $words = returnWords($pdo, $category, $limit); $words_joined .= implode("\r\n", $words) . "\r\n"; } echo $words_joined;

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.4.100.0110.01117.95

preferences:
28.94 ms | 403 KiB | 5 Q