Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bench.phpb « tests « pimple « ext « pimple « pimple « vendor « server - github.com/nextcloud/lookup-server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8f983e656b525a6dbe7871087b5899a413e84e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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);

function foo() { }
$factory = function () { };

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

$p = new Pimple\Container;

$p['foo'] = 'bar';

if (!isset($p[3])) {
    $p[3] = $p['foo'];
    $p[]  = 'bar';
}

$p[2] = 42;

if (isset($p[2])) {
	unset($p[2]);
}

$p[42] = $p['foo'];

$p['cb'] = function($arg) { };

$p[] = $p['cb'];

echo $p['cb'];
echo $p['cb'];
echo $p['cb'];

//$p->factory($factory);

$p['factory'] = $factory;

echo $p['factory'];
echo $p['factory'];
echo $p['factory'];

}

echo microtime(true)  - $time;