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.


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 )

Facebook photo

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

Connecting to %s

Create a website or blog at

Up ↑