Lightweight version, php 5.4+