On Sun, 30 Jun 2002, Andi Gutmans wrote:

> My only problem with this patch is that I don't like API's which pass
> around structs. I always find it cumbersome to have to create and fill the
> struct and then pass it.
> Can you think of something similar without using structs?

    If you look at the main body of the function, you will see a
    number of variables which script authors might want to
    overwrite in the future.

    Everytime an addition occurs, the main interface would have
    to change.  You might end up with something like

        sapi_add_header12("Test: X", 7, 1, 0, 404, 8372383, 123,
            "", "utf8", "filter_code", 0, -1);

    We are almost half way there.

    With the new interface of sapi_header_op(), we won't have
    this problem.  It will continue to exist unchanged,
    regardless of how many variables it might accept.  Extension
    developers will be happy about this, because it avoids BC
    issues.  The interface is also less bug prone because of its
    improved semantics.

    And thus, I conclude that passing in a struct is the most
    versatile way for this kind of API.

    - Sascha


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to