View Single Post
Old 02-07-2008, 05:28 PM   #13 (permalink)
RobertK
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Hey, I like that class. I have something like that in a bit of a scattered procedural form. Thought about turning it into a class, after seeing your first reply and thinking about my own project.

One question though, if you'll humor me.

Why write this instead of the equivalent shorthand? Is the first faster, and if so why?
PHP Code:
    function get($var)
    {
        
// This
        
$var $_GET[$var];
        
$var $this->sql_safe($var);
        return 
$var;
        
// versus this
        
return $this->sql_safe($_GET[$var]);
    } 
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote