No, the function is inserted in place of http (hand-written) in the code, so now everything is https, so http now no longer exists ...
before
Code:
<link rel="canonical" href="<?php echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>" />
Now
Code:
<link rel="canonical" href="<?php echo URL_protocol().$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>" />