Closures in JavaScript zijn functies met 'vrije variabelen'. De functie onthoud zijn omgeving waarin hij gemaakt is. Je kunt een closure gebruiken om dynamische functies te maken. Wat voorbeelden zullen helpen om het geheel te begrijpen. In onderstaand voorbeeld maken we een functie welke machten uitrekent. De functie 'powers' geeft een functie terug. Alle instanties… Read More


Definitie: Een prototype is een object waarvan geïnstantieerde objecten de properties erven. (bron: JavaScriptWeblog) Als je, bijvoorbeeld, een functie 'car' maakt (wat dan een object is, aangezien alle functies in javascript objecten zijn) en je plaatst properties en methods in de prototype van dit object, dan zullen alle instanties van dit object die methods en properties… Read More


It can be a bit painful to get the database connection started from your PHPStorm IDE to your MySQL database. As a quick hint, this is where it went wrong with mine: MySQL wasn't listening for incoming connections on the network (change directive bind-address to 0.0.0.0 in /etc/mysql/my.cnf and restart MySQL) My database user was only… Read More


PHP CodeSniffer, aka phpcs, helps you in detecting violations in your PHP code. Violations can be: opening curly brackets in the wrong place (on a new line, or vice versa) indentation use of upper- or lowercase variable/function/method/class names missing phpdoc blocks for files, classes or functions your own coding standards etc. Before installing PHP CodeSniffer… Read More


Use PHP Code Sniffer to detect violations to coding standards in your PHP files. To use PHP Code Sniffer in PHPStorm, open the Settings and go to PHP -> Code Sniffer In the field 'PHP Code Sniffer (phpcs) path:' fill in the path where the binary resides. Most of the times this is '/usr/bin/phpcs'. If… Read More


PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.

That's it! You can play with it now. For example: use PHP CodeSniffer with PHPStorm  … Read More


What is PHP Mess Detector? Given its homepage, it aims to detect: Possible bugs Suboptimal code Overcomplicated expressions Unused parameters, methods, properties In short: it helps by pointing you on the mess inside your PHP scripts! Listing available packages:

Now, check which packages (and versions) are available on the server.

Install the latest… Read More


Install PEAR on your OSX Mountain Lion machine to easily install PHP libraries.

Install pear. Accept the defaults while installing.

Pear is installed!

Now you can install some nice libraries: PHP Mess Detector: detect possible bugs, suboptimal code and unused parameters, methods, properties  PHP Code Sniffer: detect violations against (your own set)… Read More


Install xdebug on the server Installing Xdebug on the server is not in the scope of this article. You can find related articles here: http://xdebug.org/docs/install http://www.jetbrains.com/phpstorm/webhelp/... Install xdebug on Ubuntu: http://ubuntuforums.org/.... Youtube: install xdebug on windows XP Configure xdebug in phpstorm's settings Open the phpstorm Settings window and go to PHP -> Debug Apply the settings… Read More