Can someone please explain what PHP "with" does?
Example begins:
Say I have a class:
\App\fa_batch
What is the difference between this statement:
$w = (with (new \App\fa_batch))
// uses 'with'
// returns App\fa_batch
and this statement?
$n = (new \App\fa_batch)
// does not use 'with'
// also returns App\fa_batch
Context / Background Info:
I'm having trouble finding documentation for with
, maybe because the PHP.net, stack overflow and google search engines considers php "with" keyword
such a common search phrase.
If context helps, I came across this usage of the word with
from this answer:
https://stackoverflow.com/a/33222754/5722034