Debugging server side scripting

Hello guys. I have an query where i’m using server side scripting. Inside server side script i have a temporary calculation, and inside this calculation some bug exists that i can’t fix. So, i guess that some mechanism should exists to print this temporary calculation result for debugging.
I found this solution

but i dont understand how cat i use this from php driver connection?