Only tested on php 5.4 and upwards