I have one simple page with two methods, one to charge data into inputs and other to save then. Both methods are using FFI to access one pascal dll, but I need to initialize the dll at the first method called and keep the handle to be used at the nexts calls. I'm using PHP 8.3, and the dll methods are working fine at the first call.
I can't find one way to keep de state of the variable to be used at the nexts requisitions, FFI don't allow to serialize and if I keep the pointer with session variável, when I load the dll again, setting that pointer, I have access violation. Have some option to use one global variable to keep the FFI initialized at the first method to be used at the nexts calls?