PHP Classes

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

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   PHP Slim Framework 3 Modular Application   libraries/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb   Download  
File: libraries/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Slim Framework 3 Modular Application
Create modular applications using Slim Framework
Author: By
Last change:
Date: 6 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;
?>