Which these php script use less memory of server?
    function test($matches)
    {
    	$fx = '';
    	if(strpos($matches[0],"http://")===false)
    	{
    		$fx = "http://";
    	}
    	elseif(strpos($matches[0],"http:/")===false)
    	{
    		$fx = "http:/";
    	}
    	elseif(strpos($matches[0],"http:")===false)
    	{
    		$fx = "http:";
    	}
    	elseif(strpos($matches[0],"http")===false)
    	{
    		$fx = "http";
    	}
    	return $fx.$matches[0];
    }

or

    function test($matches)
    {
    	if(strpos($matches[0],"http://")===false)
    	{
    		return  "http://".$matches[0];
    	}
    	elseif(strpos($matches[0],"http:/")===false)
    	{
    		return "http:/".$matches[0];
    	}
    	elseif(strpos($matches[0],"http:")===false)
    	{
    		return "http:".$matches[0];
    	}
    	elseif(strpos($matches[0],"http")===false)
    	{
    		return "http".$matches[0];
    	}
    }

I'm trying to write my scripts to them use less memory as possible, but idk sometimes the code look ugly, in my opnion the first script look more pretty and organized, but i think it use more memory of server.

thanks.
Which these php script use less memory of server?
===

    function test($matches)
    {
    	$fx = '';
    	if(strpos($matches[0],"http://")===false)
    	{
    		$fx = "http://";
    	}
    	elseif(strpos($matches[0],"http:/")===false)
    	{
    		$fx = "http:/";
    	}
    	elseif(strpos($matches[0],"http:")===false)
    	{
    		$fx = "http:";
    	}
    	elseif(strpos($matches[0],"http")===false)
    	{
    		$fx = "http";
    	}
    	return $fx.$matches[0];
    }

or

    function test($matches)
    {
    	if(strpos($matches[0],"http://")===false)
    	{
    		return  "http://".$matches[0];
    	}
    	elseif(strpos($matches[0],"http:/")===false)
    	{
    		return "http:/".$matches[0];
    	}
    	elseif(strpos($matches[0],"http:")===false)
    	{
    		return "http:".$matches[0];
    	}
    	elseif(strpos($matches[0],"http")===false)
    	{
    		return "http".$matches[0];
    	}
    }

I'm trying to write my scripts to them use less memory as possible, but idk sometimes the code look ugly, in my opnion the first script look more pretty and organized, but i think it use more memory of server.

thanks.