M
Marc Weber
 - you never know when syntax or similar errors occur..
which will give a runtime error. I'm sure there are some PHP analysis
tools which can detect this kind of error before running your web
application.
For those who are to lazy to look it up (PHP lambda summary):
Syntax looks like this:
[static] function (/*args*/) use (&$x, $y) { /* body */ };
You can use "use" to put vars into the scope of the function body.
Note that & will create references to the var, no matter which type
its contents has. If you don't use "use" vars which are also present in
outer scope will be null.. [static] is used to not include the $this
reference.
So maybe PHP get's closer. Can you do this as well now?
echo new FooBar()->fun();
About parallelism: I only used ruby to run some php -l commands to check
syntax in parallel. It's perfect for this kind of task: Create a quick
work list, start 3 threads and pop items off from that list.
That's why I recommended learning Ruby rather than PHP. Because PHP
can't get this job done although it is a scripting language.
Marc Weber
If you compare PHP with Java you can extend abstract classes in PHPWhat?
which will give a runtime error. I'm sure there are some PHP analysis
tools which can detect this kind of error before running your web
application.
He thanks. I only knew about create_function.Available since PHP 5.3
For those who are to lazy to look it up (PHP lambda summary):
Syntax looks like this:
[static] function (/*args*/) use (&$x, $y) { /* body */ };
You can use "use" to put vars into the scope of the function body.
Note that & will create references to the var, no matter which type
its contents has. If you don't use "use" vars which are also present in
outer scope will be null.. [static] is used to not include the $this
reference.
So maybe PHP get's closer. Can you do this as well now?
echo new FooBar()->fun();
About parallelism: I only used ruby to run some php -l commands to check
syntax in parallel. It's perfect for this kind of task: Create a quick
work list, start 3 threads and pop items off from that list.
That's why I recommended learning Ruby rather than PHP. Because PHP
can't get this job done although it is a scripting language.
Marc Weber