Menu Home

Friends in PHP

// Can I can be your friend too?

Class Friend {

if ($joke)
laugh(“Jeez, you’re funny!”);

elseif ($laugh)
smile(“I’m glad you enjoyed it”);

elseif ($cry)
comfort(“Things will get better”);

elseif ($lonely)
hang_out(“You wanna go anywhere today?”);

elseif ($angry)

offer_chocolate(“Want some chocolate?”);


// And so I guess we’re friends now?

Real_Friend extends Friend {

// There are no functions that you can see in this class.
// There are only hidden variables, with unknown values.
// Stop analysing. There’s nothing here. It’s intangible.


Categories: Light-hearted Love Philosophy Sociology Tech

Donn Lee

I love to read and write. Professionally, data science, technology, and sales ops are my thing. In my non-professional life, I aspire quite simply to be a good person, and encourage others to do the same. For those who care, I test as INFJ/INTJ (55/45?) in the MBTI.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s