← every case · 6000 · another language inside the file

6110-php_block_holding_html_around_it

the file switches language at a tag rather than at a file boundary, and switches back at another tag, so the markup between the two belongs to a language the extension does not name

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.php
1code<?php
2code?>
3code HTML<p>hello</p>
4comments HTML<!-- an html comment, which php has no symbol for -->
5code<?php
6codeecho "hi";
7code?>

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the file is read as php from beginning to end and never switches language at the closing tag, so the markup comment between the blocks counts as code

the rules ask7 lines · 0 blanks · 6 code · 1 comments · HTML 2
it answers7 lines · 0 blanks · 7 code · 0 comments

cloc --json cases/6000-another_language_inside_the_file/6110-php_block_holding_html_around_it/input.php

mezura.content ✗ fails

the file is read as php from beginning to end, so the html comment is counted with php's symbols, which do not include it

the rules ask7 lines · 4 code · 1 comments · 2 extra · HTML 2
it answers7 lines · 5 code · 0 comments · 2 extra

mezura cases/6000-another_language_inside_the_file/6110-php_block_holding_html_around_it/input.php --output json --hide timing --counting content

mezura.region ✗ fails

the file is read as php from beginning to end, so the html comment is counted with php's symbols, which do not include it

the rules ask7 lines · 0 blanks · 6 code · 1 comments · HTML 2
it answers7 lines · 0 blanks · 7 code · 0 comments

mezura cases/6000-another_language_inside_the_file/6110-php_block_holding_html_around_it/input.php --output json --hide timing --counting region

scc.default ✗ fails

the file is read as php from beginning to end, so the html comment is counted as code

the rules ask7 lines · 0 blanks · 6 code · 1 comments · HTML 2
it answers7 lines · 0 blanks · 7 code · 0 comments

scc --format json cases/6000-another_language_inside_the_file/6110-php_block_holding_html_around_it/input.php

tokei.default ✗ fails

the file is read as php from beginning to end, so the html comment is counted as code

the rules ask7 lines · 0 blanks · 6 code · 1 comments · HTML 2
it answers7 lines · 0 blanks · 7 code · 0 comments

tokei --output json cases/6000-another_language_inside_the_file/6110-php_block_holding_html_around_it/input.php