register_shutdown_function order

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    register_shutdown_function order

    Hi all !

    I am using register_shutdo wn_function. It behaves something
    strange.

    register_shutdo wn_function("f1 ");
    register_shutdo wn_function("f2 ");

    they fire in sequence
    f1
    f2

    One would expect them to fire
    f2
    f1

    Lets assume that I want to use tracer and db access.
    f1 - should close the tracer
    f2 - should close db connection


    It's bug or feature ?

    Regards

    Matjaz


  • Jon Kraft

    #2
    Re: register_shutdo wn_function order

    <matjaz.ostrove rsnik@zrs-tk.si> wrote:
    [color=blue]
    > I am using register_shutdo wn_function. It behaves something
    > strange.
    >
    > register_shutdo wn_function("f1 ");
    > register_shutdo wn_function("f2 ");
    >
    > they fire in sequence
    > f1
    > f2[/color]

    Correct:

    <quote>Multip le calls to register_shutdo wn_function() can be made, and
    each will be called in the same order as they were registered.</quote>
    [color=blue]
    > One would expect them to fire
    > f2
    > f1[/color]

    Why? It's not meant to be a stack.

    JOn

    Comment

    Working...