php running sequence

now I got a headache problem, whether the php code runs from top to bottom?

in my code:



function function1($param1,$param2)


{


    generate the static data area


     ...


    generate  the identifying code


    ...


    call another function to update the 'static data area'


}





function function2 ()


{


    the function is to finish update the static data area


}


now , the identifying code always be generated after the function2 finish.

why, does the php code run from top to bottom?

thanks.

How did you call these functions?

qiang,

the above code is not in Yii framework. just in common php files,but i want u guys can help me.

  1. index.php

      demoClass1=new Class1();

      demoClass1->function1();

  2. class Class1()

{

    function function1($param1,$param2)

    {

        generate the static data area

        …

        generate  the identifying code

        …

        call another function to update the ‘static data area

    }

    function function2 ()

    {

        the function is to finish updating the static data area

    }

}