Is this really needed when we data-attr for the elements in html
<input type ="text" name="text1" id ="text1" data-attr="<?php echo $hell ?>">
Is it needed? no. Will it pass the W3C validator without it? no.
You'll have no actual issues using data attributes either way, it just depends how important validation is to you.