What are some potential performance issues when using highlight_string() for longer PHP code?

Using highlight_string() for longer PHP code can result in performance issues due to the overhead of parsing and highlighting the entire code. To solve this, you can limit the number of lines to be highlighted by using the second parameter of the function to specify the maximum number of lines to highlight.

<?php
$code = file_get_contents('example.php');
highlight_string($code, true); // Highlight only the first 10 lines of code
?>