Skip to content

Instantly share code, notes, and snippets.

@bocharsky-bw
Last active August 29, 2015 13:57
Show Gist options
  • Save bocharsky-bw/9687137 to your computer and use it in GitHub Desktop.
Save bocharsky-bw/9687137 to your computer and use it in GitHub Desktop.
Passed array options with default values
<?php
public function __construct(array $options = array()) {
/* By default */
$options = array_merge(
array(
'one' => 1,
'two' => 2,
'three' => 3,
),
$options
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment