Closed ostrolucky closed 4 years ago
The demo.php
file hasn’t been revisited in a while so it’s trying to highlight all 180+ code samples by detecting the languages automatically (which happens in a brute force fashion) on that page in 60 seconds.
At the top of the file there’s a call to set_time_limit(60)
change that 0.
set_time_limit(0);
After that, the script will take a while but it’ll finish.
I've already removed it, it didn't give impression I was looking for unfortunately. Feel free to close the issue. In your place I would fix the sample to alert user that this can take a while and/or change this limit there
I got same result:
in vendor/scrivo/highlight.php/Highlight/RegEx.php (line 79)
@AlexanderMatveev I've rewritten compare.php
in 4ad052dcec50a4ca623026aab89ba24c93372bbe to behave better. I'm going to reevaluate whether or not demo.php
is still necessary; it currently performs at least 34,225 highlighting operations on a single page load so that's why it takes forever. If you just want to see how well highlight.php compares to highlight.js, use compare.php
.
So, I just cloned the repo, did composer install, ran demo.php and: