Very short trick: avoid error message in PHP

If we do not want a PHP function to issue any warnings or errors, just enter the first call to the character of the spiral - or at - (@):

1
2
3
4
/ / Instead of using the canonical form
miaFunc ( ) ; $ Res = miaFunc ();
/ / You can use
miaFunc ( ) ; $ Res = @ miaFunc ();

A comment: "Very short trick: avoid error message in PHP"

  1. October 10, 2008 Nicholas Ballotta :

    I finally realized something that I wondered for a while 'time : P

Leave a comment

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL