Re: [SMARTY-DEV] unneeded statement?

From: Date: Thu, 20 Feb 2003 14:25:10 +0000
Subject: Re: [SMARTY-DEV] unneeded statement?
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-773@lists.php.net to get a copy of this message
If _parse_file_path fails, then $_return will be tested without going into the block. if(!$_return) ... With verbose error_reporting this will create a notice if $_return is not initialized. Monte On Thu, 2003-02-20 at 02:35, Dennis Gearon wrote: > In function smarty._fetch_template_info() > > In the second major 'if' block inside that function > > In version 2.4.2 (maybe others) > > line 1615 which reads > ' $_return = false;' > > this seems totally redundant. That block of code containing that variable '$_return' > cannot be reached unless '$_return' is *already* false, and there is nothing between the > if > statement testing for $_return== false (line 1610), which modifies $_return. So, $_return will > always be false at line 1615 and there is no need to set it false. > > Also, wouldn't: > > 'FALSE' > 'TRUE' > > reveal that they're constants a little more clearly? > -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.dev (#773) next »