Skip to content

Instantly share code, notes, and snippets.

@joubertredrat
Created September 2, 2014 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joubertredrat/66916cfd5fe6a2320f24 to your computer and use it in GitHub Desktop.
Save joubertredrat/66916cfd5fe6a2320f24 to your computer and use it in GitHub Desktop.
Um simples conceito para debate
<?php
// como é atualmente
$a = ['um', 'dois', 'tres', 'quatro'];
echo implode (',', $a);
// Conceito 1
// $params = new paramClass();
$params = new stdClass();
$params->glue = ',';
$params->pieces = ['um', 'dois', 'tres', 'quatro'];
echo implode ($params);
// Conceito 2
$params['glue'] = ',';
$params['pieces'] = ['um', 'dois', 'tres', 'quatro'];
echo implode ($params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment