This definitely works in PHP4
<?php
DEFINE ("Keysize","V28r4aaj0Gf3lrjB0");
$text="COME TO DADDY";
$td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, "");
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
$encrypted = mcrypt_cbc(MCRYPT_TripleDES, (Keysize), $text, MCRYPT_ENCRYPT, $iv);
$decrypted = mcrypt_cbc(MCRYPT_TripleDES, (Keysize), $encrypted, MCRYPT_DECRYPT, $iv);
echo "This is iv $iv<br>";
echo "Text $text<br>";
echo "Encrypted $encrypted<br>";
echo "Decrypted again $decrypted<br>";
?>