Monthly Archives: March 2016

Three steps to test PHP locally without installing a server

1. Install PHP 5.5+ which has a built-in server

sudo apt-get install php5

2. Create a directory for php files. For example public_html/index.php

3. Run

php -S localhost:8000

4. Check http://localhost:8000/index.php

How to return an subclass with generics

In 2013, I created a project to provide a general-purpose tree structure in Java.

One challenge at that time (mostly because I was not an expertise at that time, neither am I now) is the return type of Tree methods. For example, the return type of getChild(int index) that should return the child at the specified index. read more