Skip to content

Instantly share code, notes, and snippets.

@matsubo
Created June 27, 2013 10:39
Show Gist options
  • Save matsubo/5875518 to your computer and use it in GitHub Desktop.
Save matsubo/5875518 to your computer and use it in GitHub Desktop.
parse_ini_file is 10% faster than array.
<?php
$try = 100000;
$start = microtime(true);
for ($i=0; $i< $try; $i++) {
include('./config.php');
}
$end = microtime(true);
print $end - $start."\n";
$start = microtime(true);
for ($i=0; $i< $try; $i++) {
$ini = parse_ini_file('config.ini', true);
}
$end = microtime(true);
print $end - $start."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment