A Love Poem in PHP

Wrote this a long time ago but never posted it. Stumbled onto it while cleaning up my email:

<?php
	$me = new Lover;

	$me->partner = $you;

	$me->feelings = array('adore','miss','want','love');

	foreach ($feelings as $feeling) {

		$me->express_feeling($feeling);

		if ($you->feeling_mutual($feeling))
			$me->epic_hugs($you);
	}
?>

Sure, it’s not the most expressive form of writing out there, but like with Haiku I think the limitation and challenge of putting poetry into code form can help push you to create something really fresh and strange without the baggage and cliché feel of regular poetry. I also just love naming variables and methods ;)

Either way, I think my poem is at least more uplifting than this other PHP love poem I found.

It was actually a follow-up to a shorter, twitter-length PHP love poem I wrote around the same time:

<?php
	$things_i_dont_miss_about_you = array();
?>

Submit your coded love poems in the comments, bonus points if it could at least theoretically execute in real life (assuming for example things like the existence of a “Lover” class with an express_feeling() method). If you’ve got the time write us an Epic PHP Poem, including all the needed class definitions :P

Jer Clarke is a web developer based in Mexico City. Jer builds Global Voices with WordPress and loves everything.

Jer is available to work! Read about Jer’s skills and get in touch.

Jer’s pronouns are They/Them.

Comments

4 responses to “A Love Poem in PHP”

  1. Jim Avatar

    Are PHP love poems more lasting than JavaScript poems?

  2. mira Avatar

    aw, that twitter poem is the sweetest thing. the longer one is nice, too. :)

  3. billythekid Avatar

    people->you))$myLife->quality++;
    ?>

    careful of the appearance of infinite loop memory hogging on long term relationships…

  4. Alberto Cini Avatar

    is it too late to tell you that it is a fantastic idea?
    You inspired me, thak you!

Leave a Reply