本文整理汇总了PHP中__var_dump函数的典型用法代码示例。如果您正苦于以下问题:PHP __var_dump函数的具体用法?PHP __var_dump怎么用?PHP __var_dump使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了__var_dump函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
function __()
{
$GLOBALS['a'] = "bug\n";
array_splice($GLOBALS, 0, count($GLOBALS));
/* All global variables including $GLOBALS are removed */
@__var_dump($GLOBALS['a']);
}
示例2: f5
function f5()
{
$c = extract(array("111" => 1), EXTR_PREFIX_ALL, "prefix");
echo "Extracted:";
__var_dump($c);
__var_dump(get_defined_vars());
}
示例3: dump
function dump($elems)
{
foreach ($elems as $elem) {
__var_dump($elem->nodeName);
dump($elem->childNodes);
}
}
示例4: test
function test($v)
{
//echo var_export($v, true) . "\n";
__var_dump($v);
echo "{$v}\n";
//print_r($v);
echo "\n------\n";
}
示例5: test
function test($x = Foo::HUN)
{
static $arr2 = array(TEN => 'ten');
static $arr = array(Foo::HUN => 'ten');
__var_dump($arr);
__var_dump($arr2);
__var_dump($x);
}
示例6: g7
function g7()
{
$a = 1;
$b = 2;
f($a = $a =& $b);
u($a = $a =& $b);
__var_dump($a, $b);
}
示例7: does_not_work
function does_not_work()
{
global $data;
// Remove this line to make array_multisort() work
$data = array('first', 'fifth', 'second', 'forth', 'third');
$sort = array(1, 5, 2, 4, 3);
array_multisort($sort, $data);
__var_dump($data);
}
示例8: __construct
function __construct()
{
$this->name = 'init';
$this->other = 'other';
__var_dump($this);
parent::__construct();
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
$this->name = 'derived';
__var_dump($this);
}
示例9: extract_test
function extract_test($array, $type, $prefix)
{
${"a d"} = "hello";
${0} = "hello";
${""} = "hello";
$ad = null;
${"000g"} = "hello";
$prefix_ad = "hello";
__var_dump(extract($array, $type, $prefix));
unset($array, $type, $prefix);
$vars = get_defined_vars();
ksort($vars, SORT_STRING);
__var_dump($vars);
}
示例10: t3
function t3()
{
$a = array('foo' => 'aaa');
// refcount($a) = 1
// refcount($a['foo']) = 1
$b =& $a;
// refcount($a) = 2
// is_ref($a) = true
// refcount($a['foo']) = 1
unset($b);
// refcount($a) = 1
// is_ref($a) = true
// refcount($a['foo']) = 1
__var_dump($a);
extract($a, EXTR_REFS);
$foo = 'noo';
__var_dump($a);
}
示例11: array
[expect php]
[file]
<?php
require 'Phalanger.inc';
/* This works */
$f = array('7' => 0);
__var_dump($f);
__var_dump(array_key_exists(7, $f));
__var_dump(array_key_exists('7', $f));
print "----------\n";
/* This doesn't */
$f = array_flip(array('7'));
__var_dump($f);
__var_dump(array_key_exists(7, $f));
__var_dump(array_key_exists('7', $f));
示例12: __var_dump
[expect php]
[file]
<?php
require 'Phalanger.inc';
__var_dump(strripos("test test string", "test"));
__var_dump(strripos("test string sTring", "string"));
__var_dump(strripos("test strip string strand", "str"));
__var_dump(strripos("I am what I am and that's all what I am", "am", -3));
__var_dump(strripos("test string", "g"));
__var_dump(strripos("te" . chr(0) . "st", chr(0)));
__var_dump(strripos("tEst", "test"));
__var_dump(strripos("teSt", "test"));
__var_dump(@strripos("foo", "f", 1));
__var_dump(@strripos("", ""));
__var_dump(@strripos("a", ""));
__var_dump(@strripos("", "a"));
__var_dump(@strripos("\\\\a", "\\a"));
示例13: __var_dump
__var_dump(str_word_count($str, 123));
__var_dump(str_word_count($str, -1));
__var_dump(str_word_count($str, 99999999999999999));
// invalid input: __var_dump(str_word_count($str, array()));
// invalid input: __var_dump(str_word_count($str, $b));
__var_dump($str);
$str2 = "F0o B4r 1s bar foo";
__var_dump(str_word_count($str2, NULL, "04"));
__var_dump(str_word_count($str2, NULL, "01"));
__var_dump(str_word_count($str2, NULL, "014"));
// invalid input: __var_dump(str_word_count($str2, NULL, array()));
// invalid input: __var_dump(str_word_count($str2, NULL, new stdClass));
__var_dump(str_word_count($str2, NULL, ""));
__var_dump(str_word_count($str2, 1, "04"));
__var_dump(str_word_count($str2, 1, "01"));
__var_dump(str_word_count($str2, 1, "014"));
// invalid input: __var_dump(str_word_count($str2, 1, array()));
// invalid input: __var_dump(str_word_count($str2, 1, new stdClass));
__var_dump(str_word_count($str2, 1, ""));
__var_dump(str_word_count($str2, 2, "04"));
__var_dump(str_word_count($str2, 2, "01"));
__var_dump(str_word_count($str2, 2, "014"));
// invalid input: __var_dump(str_word_count($str2, 2, array()));
// invalid input: __var_dump(str_word_count($str2, 2, new stdClass));
__var_dump(str_word_count($str2, 2, ""));
__var_dump(str_word_count("foo'0 bar-0var", 2, "0"));
__var_dump(str_word_count("'foo'", 2));
__var_dump(str_word_count("'foo'", 2, "'"));
__var_dump(str_word_count("-foo-", 2));
__var_dump(str_word_count("-foo-", 2, "-"));
示例14: __var_dump
[expect php]
[file]
<?php
include 'Phalanger.inc';
__var_dump(number_format(0.0001, 1));
__var_dump(number_format(0.0001, 0));
示例15: array
[expect php]
[file]
<?php
include 'Phalanger.inc';
$arrays = array(array(), array(0), array(1), array(-1), array(0, 2), array(1, 2, 3), array(1 => 0), array(2 => 1), array(3 => -1), array(1 => 0, 2 => 2), array(1 => 1, 2 => 2, 3 => 3), array(0 => 0, 3 => 2), array(1 => 1, 5 => 2, 8 => 3), array(1, 2), array(0, 1, 2), array(1, 2, 3), array(0, 1, 2, 3), array(1, 2, 3, 4), array(0, 1, 2, 3, 4), array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), array("a" => 1), array("b" => 1, "c" => 2), array("p" => 1, "q" => 2, "r" => 3, "s" => 4, "u" => 5, "v" => 6), array("a" => "A"), array("p" => "A", "q" => "B", "r" => "C", "s" => "D", "u" => "E", "v" => "F"));
foreach ($arrays as $item) {
echo "===========================================\n";
__var_dump($item);
echo "-------------------------------------------\n";
for ($i = 0; $i < sizeof($item) + 1; $i++) {
echo "[{$i}]\n";
__var_dump(@array_chunk($item, $i));
__var_dump(@array_chunk($item, $i, TRUE));
__var_dump(@array_chunk($item, $i, FALSE));
echo "\n";
}
echo "\n";
}
echo "end\n";