3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '<br><br ><br/><br />'; $with_slash = strip_tags( $content, '<br />' ); $without_slash = strip_tags( $content, '<br>' ); echo "With slash:\n'$with_slash'\n\n"; echo "Without slash:\n'$without_slash'\n\n"; echo 'Correct: ' . ( '' === $with_slash ? 'Without slash' : 'With slash' );
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
With slash: '' Without slash: '<br><br ><br/><br />' Correct: Without slash

preferences:
143.9 ms | 404 KiB | 128 Q