mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-13 09:13:58 +02:00
Merge branch 'gh-pages' of github.com:codeguy/php-the-right-way into gh-pages
This commit is contained in:
@@ -21,15 +21,17 @@ create and edit your files on your host machine and then run the code inside you
|
|||||||
|
|
||||||
### A little help
|
### A little help
|
||||||
|
|
||||||
If you need a little help to start using Vagrant there are two services that might be useful:
|
If you need a little help to start using Vagrant there are three services that might be useful:
|
||||||
|
|
||||||
- [Rove][rove]: service that allows you to pregenerate typical Vagrant builds, PHP among the options. The
|
- [Rove][rove]: service that allows you to pregenerate typical Vagrant builds, PHP among the options. The
|
||||||
provisioning is made with Chef.
|
provisioning is made with Chef.
|
||||||
- [Puphpet][puphpet]: simple GUI to set up virtual machines for PHP development. **Heavily focused in PHP**. Besides
|
- [Puphpet][puphpet]: simple GUI to set up virtual machines for PHP development. **Heavily focused in PHP**. Besides
|
||||||
local VMs, can be used to deploy to cloud services as well. The provisioning is made with Puppet.
|
local VMs, can be used to deploy to cloud services as well. The provisioning is made with Puppet.
|
||||||
|
- [Protobox][protobox]: is a layer on top of vagrant and a web GUI to setup virtual machines for web development. A single YAML document controls everything that is installed on the virtual machine.
|
||||||
|
|
||||||
[vagrant]: http://vagrantup.com/
|
[vagrant]: http://vagrantup.com/
|
||||||
[puppet]: http://www.puppetlabs.com/
|
[puppet]: http://www.puppetlabs.com/
|
||||||
[chef]: http://www.opscode.com/
|
[chef]: http://www.opscode.com/
|
||||||
[rove]: http://rove.io/
|
[rove]: http://rove.io/
|
||||||
[puphpet]: https://puphpet.com/
|
[puphpet]: https://puphpet.com/
|
||||||
|
[protobox]: http://getprotobox.com/
|
||||||
|
@@ -7,14 +7,14 @@ title: Functional Programming in PHP
|
|||||||
|
|
||||||
PHP supports first-class functions, meaning that a function can be assigned to a variable. Both user-defined and built-in
|
PHP supports first-class functions, meaning that a function can be assigned to a variable. Both user-defined and built-in
|
||||||
functions can be referenced by a variable and invoked dynamically. Functions can be passed as arguments to other
|
functions can be referenced by a variable and invoked dynamically. Functions can be passed as arguments to other
|
||||||
functions (a feature called higher-order functions) and a function can return other functions.
|
functions and a function can return other functions (a feature called higher-order functions).
|
||||||
|
|
||||||
Recursion, a feature that allows a function to call itself, is supported by the language, but most of the PHP code focus
|
Recursion, a feature that allows a function to call itself, is supported by the language, but most of the PHP code focus
|
||||||
is on iteration.
|
is on iteration.
|
||||||
|
|
||||||
Anonymous functions (with support for closures) have been present since PHP 5.3 (2009).
|
Anonymous functions (with support for closures) have been present since PHP 5.3 (2009).
|
||||||
|
|
||||||
PHP 5.4 added the ability to bind closures to an object's scope and also improved support for callables such that they
|
PHP 5.4 added the ability to bind closures to an object's scope and also improved support for callables such that they
|
||||||
can be used interchangeably with anonymous functions in almost all cases.
|
can be used interchangeably with anonymous functions in almost all cases.
|
||||||
|
|
||||||
The most common usage of higher-order functions is when implementing a strategy pattern. The built-in `array_filter`
|
The most common usage of higher-order functions is when implementing a strategy pattern. The built-in `array_filter`
|
||||||
|
Reference in New Issue
Block a user