Skip to content

Instantly share code, notes, and snippets.

@oskarcalvo
Created October 3, 2017 10:38
Show Gist options
  • Save oskarcalvo/eecdc2eae5157be418ef461eb7dbefe2 to your computer and use it in GitHub Desktop.
Save oskarcalvo/eecdc2eae5157be418ef461eb7dbefe2 to your computer and use it in GitHub Desktop.
<?php
<?php
/**
* Created by PhpStorm.
* User: oskar
* Date: 3/10/17
* Time: 10:00
*/
$time_start = microtime(true);
echo memory_get_usage(), "\n";
function ejecutar_switch($data = NULL) {
$array = [];
switch ($data) {
case 'wadus':
$array['wadus'] = 'cuarenta y dos';
break;
case 'wadus2':
$array['wadus2'] = 'cuarenta y tres';
break;
case 'wadus3':
$array['wadus3'] = 'cuarenta y cuatro';
break;
default:
$array['wadus4'] = 'cuarenta y cinco';
break;
}
return $array;
}
$resultado = ejecutar_switch('wadus');
var_dump($resultado) ; echo "\n";
$resultado = ejecutar_switch();
var_dump($resultado) ; echo "\n";
$time_end = microtime(true);
$execution_time = ($time_end - $time_start)/60;
echo '<b>Total Execution Time:</b> '.$execution_time.' Mins';
echo "\n";
echo memory_get_usage(), "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment