From 8aad91d14a0d213b1eb6fc1c3160f05c1faee228 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 16 Jul 2010 11:44:30 +0000 Subject: Simplified string offset reading --- Zend/micro_bench.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Zend/micro_bench.php') diff --git a/Zend/micro_bench.php b/Zend/micro_bench.php index b67bfcda9a..87a1b158c2 100644 --- a/Zend/micro_bench.php +++ b/Zend/micro_bench.php @@ -188,6 +188,20 @@ function read_global_var($n) { } } +function read_hash($n) { + $hash = array('test' => 0); + for ($i = 0; $i < $n; ++$i) { + $x = $hash['test']; + } +} + +function read_str_offset($n) { + $str = "test"; + for ($i = 0; $i < $n; ++$i) { + $x = $str[1]; + } +} + /*****/ function empty_loop($n) { @@ -300,4 +314,8 @@ read_auto_global(N); $t = end_test($t, '$x = $_GET', $overhead); read_global_var(N); $t = end_test($t, '$x = $GLOBALS[\'v\']', $overhead); +read_hash(N); +$t = end_test($t, '$x = $hash[\'v\']', $overhead); +read_str_offset(N); +$t = end_test($t, '$x = $str[0]', $overhead); total($t0, "Total"); -- cgit v1.2.1