PHP Classes

File: vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb

Recommend this page to a friend!
  Classes of uche   Farm Price   vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb   Download  
File: vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb
Role: Example script
Content type: text/plain
Description: Example script
Class: Farm Price
API to get the prices from agriculture markets
Author: By
Last change:
Date: 2 years ago
Size: 433 bytes
 

Contents

Class file image Download
<?php

if (!class_exists('Pimple\Container')) {
    require_once
__DIR__ . '/../../../src/Pimple/Container.php';
} else {
    echo
"pimple-c extension detected, using...\n\n";
}

$time = microtime(true);


$service = function ($arg) { return "I'm a service"; };

for (
$i=0; $i<10000; $i++) {

$p = new Pimple\Container;
$p['my_service'] = $service;

$a = $p['my_service'];
$b = $p['my_service'];

}

echo
microtime(true) - $time;
?>