The dollar sign is correct. Without the dollar sign is the old (2.x) style syntax.