0

I have the following script.

<?php
error_reporting(E_ALL); 
ini_set('display_errors', 1);
?>
<HTML>
<HEAD>
<TITLE>test</TITLE>
<body>
<?
$foo=1;
if($foo==0){
    echo '<div class="main_container">';

echo "no";

echo'</div>';
    }

?>
</body>
</html>

in php version 7.4 this outputs nothing. In php8 it outputs '; echo "no"; echo''; } ?> If I remove the html and body tags it outputs nothing. How can I get this if statement to work properly in php8 inside html and body tags?

I expected the script to output nothing in php8

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Joey
  • 1
  • 1

0 Answers0