[ create a new paste ] login | about

Link: http://codepad.org/rINjj5Rs    [ raw code | output | fork ]

PHP, pasted on Jul 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

$foo = array("hello" => "world");

$start = microtime();
for ($i=0; $i<1000; $i++)
    array_key_exists("hello", $foo);
$end = microtime();
echo ($end-$start)." <-- array_key_exists\n";


$start = microtime();
for ($i=0; $i<1000; $i++)
    isset($foo["hello"]);
$end = microtime();
echo ($end-$start)." <-- isset";


Output:
1
2
0.025782 <-- array_key_exists
0.00054399999999999 <-- isset


Create a new paste based on this one


Comments: