Trong PHP, mã sau sẽ không tạo ra lỗi cú pháp. Là một nhà phát triển, điều này sẽ tạo ra một lỗi cú pháp trong đầu của tôi. Bất kỳ đầu mối?
<?php
$ $ $ $ $ $ $what_the_hell_php = 'what is wrong with you PHP?';
echo $what_the_hell_php; // no output
echo $ $ $ $ $ $ $what_the_hell_php; // worth a try but no output too
// echo $; // well, don't do this. this produces an actual PHP syntax error.
$dollars = 'a lot of money will make me crazy';
echo $dollars;
echo $$$$$$$$$$$$$$$$$$$$$$$$$$ $lotsofmoney = " - and PHP too!";
// echo $$$$$$something $hello = 'hello'; // won't work, PHP likes pure dollars
// is it for this??
echo
$$$ $$$$$$ $$$$$$ $$$$ $$$$ $$$ $$$$$$$$ $$$$$$$$
$$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$
$$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$
$$ $$ $$$$$$ $$ $$ $$ $$ $$ $$$$$$$$ $$
$$$$$$$$$ $$ $$ $$ $$ $$$$$$$$$ $$ $$ $$
$$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$ $$
$$ $$ $$$$$$ $$$$$$ $$$$ $$$$ $$ $$ $$ $$ $$
$ascii = "<hr />\nMy ASCII art is not a string or a comment! First time!";
?>
... và đầu ra:
a lot of money will make me crazy - and PHP too!<hr />
My ASCII art is not a text or a comment! First time!
Không biết nó hoạt động với khoảng trắng. Giải thích nó! – rationalboss
@rationalboss Tôi đã cố gắng xây dựng thêm một chút. –