JSONSerialize needs PHP 5.4+