]> git.nbdom.net Git - nb.git/commitdiff
improvment
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 1 Jul 2015 00:04:42 +0000 (01:04 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 1 Jul 2015 00:04:42 +0000 (01:04 +0100)
lib/php/test.php [new file with mode: 0644]

diff --git a/lib/php/test.php b/lib/php/test.php
new file mode 100644 (file)
index 0000000..68c0fb4
--- /dev/null
@@ -0,0 +1,56 @@
+<?php // test.php
+if (0) die(
+  ' strpos: '.strpos('text/html', 'ml')
+  .' strlen: '.(strlen('text/html')-strlen('ml'))
+);
+require(dirname(__FILE__).'/functions.php');
+
+/*
+$a = array('a' => 'A');
+if (isset($a['a'])) echo "OK\n";
+echo realpath('lib/php/default.php')."\n";
+*/
+
+/*
+print_r(parse_str('first=value&arr[]=foo+bar&arr[]=baz'));
+echo $first;
+exit;
+*/
+
+function _f1() {
+  $var = ''; is_null($var);
+} benchmark('_f1');
+
+function _f2() {
+  $var = ''; empty($var);
+} benchmark('_f2');
+
+function _f3() {
+  $var = ''; isset($var);
+} benchmark('_f3');
+
+function _f4() {
+  stripos('zaza', 'z') == ( strlen('zaza')-strlen('z') );
+} benchmark('_f4');
+
+benchmark();
+exit;
+
+$g = array();
+function _is_set() {
+  global $g;
+  return isset($g['a']);
+} benchmark('_is_set');
+
+function _array_key_exists() {
+  global $g;
+  return array_key_exists('a',$g);
+} benchmark('_array_key_exists');
+
+function _null() {
+  global $g;
+  return (@$g['a'] === null);
+} benchmark('_null');
+
+benchmark();
+?>