Fix deprecated notice in PHP 5.6
Rewrite for Phalcony ~0.2.3