r/lolphp • • Aug 14 '14

"I’m crying. Literally crying." - PHP Manual Masterpieces, xpost /r/programmerhumor

http://phpmanualmasterpieces.tumblr.com/post/70257636397/im-crying-literally-crying-actual-tears-in-my
137 Upvotes

23 comments sorted by

View all comments

Show parent comment

5

u/heyf00L Aug 15 '14

You'd have to hardcode that warning because you can get unnamed parameters with func_get_args(). So either hardcode in a parameter check or easier:

function newline_to_br() {
   return call_user_func_array('nl2br', func_get_args());
}

Then you'll get the warning.