HTML comment tags prevent PHP execution [duplicate]

I have PHP code at the top of my document and I want to surround it with HTML comment tags so that it is commented out in the source code in my dev environment.

<!--
<?php
session_start();
lib->checkSession();
?>
-->

<html>
my website
</html>

Normally, HTML comment tags shouldn’t prevent the php from executing but somehow it does. Is that configurable?