PHP4 compatibility: Replace self:: with CastToType::