Skip to content

Commit c2c8808

Browse files
committed
chore: add example script
1 parent e14ede6 commit c2c8808

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

example.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use Ahc\CliSyntax\Highlighter;
4+
5+
require_once __DIR__ . '/src/Highlighter.php';
6+
7+
// Highlight code
8+
echo (new Highlighter("<?php echo 'Hello world!'; ?>\n"))->highlight();
9+
10+
// Highlight file
11+
echo Highlighter::for(__FILE__)->highlight();
12+
13+
// Magic string works too:
14+
// echo new Highlighter('<?php echo "Hello world!";');
15+
// echo Highlighter::for(__FILE__);

0 commit comments

Comments
 (0)