0

What is (using) function variable in php

We have (using) function in C# that when chosed this block, remove all connections and variables Do you know what is this function similar in php???

8th Apr 2019, 7:56 PM
Rahman Sadeghi
Rahman Sadeghi - avatar
3 Answers
+ 1
PHP and C# are quite different in this regard I believe, using is for garbage collection. PHP handles its garbage collection differently and will clear memory automatically as long as you follow code best practices. Closing connections is easily done simply by unsetting the variable holding the connection. global variables will be kept, but function specific are handled by the GC.
8th Apr 2019, 8:16 PM
Victor Andersson
Victor Andersson - avatar
0
When you use style like this Using name(){...} When your block is close, it's look like you call GC method and clear any thing This method is deferential to try catch style
8th Apr 2019, 8:12 PM
Rahman Sadeghi
Rahman Sadeghi - avatar
0
Thanks
8th Apr 2019, 8:19 PM
Rahman Sadeghi
Rahman Sadeghi - avatar