read()) !== false) { if ($e[0] !== "." && $e !== "default.css" && strpos($e, ".css") !== false) { $styles[] = $e; } } sort($styles); use Highlight\Highlighter; $hl = new Highlighter(); $hl->setAutodetectLanguages($hl->listLanguages()); $tableRows = ""; $failed = array(); foreach ($hl->listLanguages() as $name) { $sn = $name; $snippet = file_get_contents("../test/detect/{$sn}/default.txt"); $r = $hl->highlightAuto($snippet); $passed = ($r->language === $name); $res = "
{$r->value}
Failed tests: " . implode(", ", $failed); } else { $testResult = "
All tests passed"; } $testResult .= "
Highlighting took " . (microtime(true) - $start) . " seconds
"; $d->close(); ?>This is a demo/test page showing all languages supported by highlight.php. Most snippets do not contain working code :-).