Re: Your Opinion

From: Date: Tue, 16 Dec 2003 14:33:09 +0000
Subject: Re: Your Opinion
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-172807@lists.php.net to get a copy of this message
For correct benchmarking you should run the test also when $foo == 'string' Gerard Samuel wrote:
Looking to squeeze as much out of my core scripts (not that they are slow ;) ). The thought arose that I can replace simple functions like is_string(), is_array() with simpler php code. For example -> <?php $foo = array('foo','foo','foo','foo','foo','foo','foo','foo','foo','foo',
                  'foo','foo','foo','foo','foo','foo','foo','foo','foo','foo',
                  'foo','foo','foo','foo','foo','foo','foo','foo','foo','foo');
for($x=0; $x < 50; $x++) {
    if ($foo === @(array)$foo)
//    if (is_array( $foo ))
    {
        echo 'true<br />';
    }
    else
    {
        echo 'false<br />';
    }
} ?> It seems to work, and debugging it via APD shows that it uses less resources. Just an idea, nothing serious. Thanks


« previous php.general (#172807) next »