[Challenge] Can you play with your language's syntax without breaking it?

Four years ago I was so bored I made this:

<?php
$lol = "lol";
define("HAHA", $lol, 1);
class ha
{
    public function result()
    {
        return 'This will be the result!';
    }
}
class idk
{
    public function lol()
    {
        return array(0, new ha() );
    }
}
function lol()
{
    return array( new idk() );
}
echo ${HaHa}()[0]->{${$lol}}()[1]->result();

This still works on PHP 7.1! Can you do it with your favorite language?

NOTE: This is just for fun. Don't do this while actually coding!

Did you find this post useful? Show some love!
DISCUSSION (5)

I've barely touched perl, but the program/poem "Black Perl" is infamous:

BEFOREHAND: close door, each window & exit; wait until time.
    open spellbook, study, read (scan, select, tell us);
write it, print the hex while each watches,
    reverse its length, write again;
    kill spiders, pop them, chop, split, kill them.
        unlink arms, shift, wait & listen (listening, wait),
sort the flock (then, warn the "goats" & kill the "sheep");
    kill them, dump qualms, shift moralities,
    values aside, each one;
        die sheep! die to reverse the system
        you accept (reject, respect);
next step,
    kill the next sacrifice, each sacrifice,
    wait, redo ritual until "all the spirits are pleased";
    do it ("as they say").
do it(*everyone***must***participate***in***forbidden**s*e*x*).
return last victim; package body;
    exit crypt (time, times & "half a time") & close it,
    select (quickly) & warn your next victim;
AFTERWORDS: tell nobody.
    wait, wait until time;
    wait until next year, next decade;
        sleep, sleep, die yourself,
        die at last

I wonder if witches today practice TDD.

TDD sounds more alchemical or goetic but I suppose everybody's a syncretist nowadays.

This talk at RubyConf 2017 has some of the most impressive, mind-boggling, examples of this that I've ever seen: confreaks.tv/videos/rubyconf2017-e...

Classic DEV Post from May 16

Taking Notes

Using bullet journal techniques to take notes and get things done

READ POST
Follow @monknomo to see more of their posts in your feed.
I'm Luis! \^-^/
A web developer interested in learning a bunch of new stuff. I HAVE A LOT OF FREE TIME so feel free to reach me if you want help in your project or company!
Trending on dev.to
PHP Security: Introduction
#php #security
Why JavaScript is an OOP Language (Even Though It Doesn't Have Classes)
#javascript #computerscience #programming #programminglanguages
On upcoming PHP deadlines
#php #uphpgraded #composer #wordpress
Finally in Promises & Try/Catch
#javascript #learning #programming
My journey from PHP to Go
#php #go #feedback
How OTP Applications are structured
#elixir #beginners #programming #erlang
What is PHP Airbnb Clone Script?
#php #opensource #productivity #webdev
We Don't Need No Stinking map() or filter()
#showdev #programming #learning