Declaring user functions in PHP scripts


#1

I need to implement function in PHP script service for the sake of code-reusing and readability. The function will be called later in the scope of the same script. I wonder if there are any restrictions against that in DF PHP scripting engine?

UPD. Yes, it’s possible. Function declarations are supported, all right.


#2

The only restrictions we’ve seen are in function ordering.
Normally in a php file, you can call function before it’s defined, since everything gets loaded into memory before execution. However DF scripting executes PHP in the same manner as if you were running it on a command line.
So every function has to be defined before you call it.