PHP manual viewers

The PHP documentation is really good. It covers almost all parts of the language and is filled with examples that help you grasp a function's meaning and usage really fast. And since PHP is a grown language, it's function naming and parameter order are often confusing - requiring you to look up the manual more often.

Last week, Bruno Skvorc told you to use devdocs.io as documentation viewer. This might work well if you're online all day and don't care about traffic, but there are better ways to access the PHP documentation.

pman - PHP manual pages

pman showing array_shift PHP's documentation is available as unix man pages! This is every awesome if you use a console-based editor like emacs or vim, because you can easily show them in an editor window.

Installation is easy:

$ pear install doc.php.net/pman

Now you can access man pages with the pman command:

$ pman array_shift

Emacs integration is trivial; I have mapped the F1 key to open the manual page for the word under the cursor:

(setq manual-program "pman")
(global-set-key [(f1)] (lambda () (interactive) (manual-entry (current-word))))

vim

Integration in vim is also easy:

" Use pman for manual pages
setlocal keywordprg=pman

Pressing Shift + k opens pman with the word at the cursor.

xCHM

xCHM showing array_shift The full PHP manual is available as CHM files. CHM is the former Windows HTML help file format and gives you a navigatable table-of-contents tree, a keyword index and full text search - all in one single file.

PHP CHM files are available with and without user notes.

Several CHM viewers exist for Linux: xCHM, Kchmviewer and chmsee.

I like xCHM most since it's small, fast and stable.

Zeal

Zeal showing array_shift Zeal stands out because it does not only display offline PHP documentation, but also has support for more than a hundred other documentation packages: CSS, HTML, JavaScript, jQuery, Python, ...

It unifies them in a single contents tree and has a searchable index of all methods/functions/classes/constants.

Zeal is an open source clone of the MacOSX application Dash, whose documentation sets it supports.

Written by Christian Weiske.

Comments? Please send an e-mail.