A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; HTTPException has a deprecated constructor

Filename: core/MY_Controller.php

Line Number: 5

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Exception404 has a deprecated constructor

Filename: core/MY_Controller.php

Line Number: 12

A PHP Error was encountered

Severity: Notice

Message: Only variables should be assigned by reference

Filename: core/Loader.php

Line Number: 74

A PHP Error was encountered

Severity: 8192

Message: Function mcrypt_get_iv_size() is deprecated

Filename: libraries/Encrypt.php

Line Number: 319

A PHP Error was encountered

Severity: 8192

Message: Function mcrypt_create_iv() is deprecated

Filename: libraries/Encrypt.php

Line Number: 320

A PHP Error was encountered

Severity: 8192

Message: Function mcrypt_encrypt() is deprecated

Filename: libraries/Encrypt.php

Line Number: 321

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; LuminousOptions has a deprecated constructor

Filename: src/options.class.php

Line Number: 21

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Scripts has a deprecated constructor

Filename: ci-script-loader/Scripts.php

Line Number: 9

A PHP Error was encountered

Severity: 8192

Message: Function mcrypt_get_iv_size() is deprecated

Filename: libraries/Encrypt.php

Line Number: 319

A PHP Error was encountered

Severity: 8192

Message: Function mcrypt_create_iv() is deprecated

Filename: libraries/Encrypt.php

Line Number: 320

A PHP Error was encountered

Severity: 8192

Message: Function mcrypt_encrypt() is deprecated

Filename: libraries/Encrypt.php

Line Number: 321

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; MarkupLite has a deprecated constructor

Filename: libraries/markuplite.class.php

Line Number: 58

Luminous PHP Syntax Highlighter - Features
Fork me on GitHub

What makes Luminous a great PHP syntax highlighter?

High Quality PHP Syntax Highlighting

*Easy to use - Highlighting requires only one line of code.
*CSS themes - There are several light and dark themes included and you can easily create more.
Includes transparent *caching so your site should stay fast
*Powerful: It uses lexical scanners to highlight your source code, which means syntax highlighting is high quality and accurate. It's powerful enough to do clever things like:
  1. Handle mixed PHP/HTML/CSS/JavaScript and Ruby on Rails-like language nesting,
  2. highlight source code inside diff/patch files,
  3. highlight Ruby's string interpolation and balanced delimiters.
*Well documented and open source - Stuck, or want to extend Luminous? Check out the documentation section.
*Safe - Luminous has a large test database and is frequently tested against random input, so you know it'll handle your code gracefully.

Luminous as a GeSHi alternative: Why not just use GeSHi?

GeSHi is another PHP syntax highlighter and has existed for much longer. Unfortunately GeSHi has a number of obvious and not so obvious problems [stackoverflow.com]. GeSHi uses a one-size-fits-all approach to languages, and as a result, can struggle on complex languages. Luminous employs a totally different approach by implementing individually written lexers for each language, and as a result, the highlighting is better. It also means that Luminous's internals tend to be more transparent (although more work may be involved in writing such a lexer), therefore Luminous is fairly easy to extend and customise under the hood (if you so desire).

Furthermore, GeSHi makes things like CSS styles difficult (it defines colours inside the language files), and it makes no real effort to work around PCRE (Perl compatible regular expressions - PHP's regular expression library) limitations; GeSHi's infrastructure is sufficiently lacking that it has to rely on complex regular expressions which can easily crash PCRE, whereas Luminous is explicitly tested against nonsense code to check that it works correctly.

GeSHi is generally a bit faster than Luminous in terms of raw throughput. However, Luminous includes a caching system which means in reality, Luminous will be much faster on average.