Good day. I need to make such a chip, but I don’t know how:

There is a variable, let's call it $ f1 = 1; When its value changes, for example, $ f1 = 2; The value of this variable must be recorded. Type:

$f1 = 10; $f1 = 20; $f1 = 5; 

How to do it?

    1 answer 1

    Declare a function and change a variable only by calling this function.

     function set_f1($AVal) { global $f1; $f1 = $AVal; log('$f1 = ' . $f1); } set_f1(10);