Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /usr/local/src/php7/php-7.0.5/ext/standard/tests/general_functions/ |
Current File : //usr/local/src/php7/php-7.0.5/ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt |
--TEST-- Test debug_zval_dump() function : basic operations --SKIPIF-- <?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?> --INI-- precision=14 --FILE-- <?php /* Prototype: void debug_zval_dump ( mixed $variable ); Description: Dumps a string representation of an internal zend value to output. */ /* creating file resource */ $file_handle = fopen(__FILE__, "r"); echo "*** Testing debug_zval_dump() on scalar and non-scalar variables ***\n"; $values = array ( /* integers */ 0, // zero as argument 000000123, //octal value of 83 123000000, -00000123, //octal value of 83 -12300000, 0xffffff, //hexadecimal value 123456789, 1, -1, /* floats */ -0.0, +0.0, 1.234, -1.234, -2.000000, 2.0000000, -4.0001e+5, 4.0001E+5, 6.99999989, -.5, .567, -.6700000e-3, -.6700000E+3, 1E-5, -1e+5, 1e+5, 1E-5, /* strings */ "", '', " ", ' ', "0", "\0", '\0', "\t", '\t', "PHP", 'PHP', "1234\t\n5678\n\t9100\rabcda\x0000cdeh\0stuv", // strings with escape chars /* boolean */ TRUE, FALSE, true, false, /* arrays */ array(), array(NULL), array(true), array(""), array(''), array(array(1, 2), array('a', 'b')), array("test" => "is_array", 1 => 'One'), array(0), array(-1), array(10.5, 5.6), array("string", "test"), array('string', 'test'), /* resources */ $file_handle ); /* loop to display the variables and its reference count using debug_zval_dump() */ $counter = 1; foreach( $values as $value ) { echo "-- Iteration $counter --\n"; debug_zval_dump( $value ); $counter++; } /* closing resource handle */ fclose($file_handle); echo "Done\n"; ?> --EXPECTF-- *** Testing debug_zval_dump() on scalar and non-scalar variables *** -- Iteration 1 -- int(0) -- Iteration 2 -- int(83) -- Iteration 3 -- int(123000000) -- Iteration 4 -- int(-83) -- Iteration 5 -- int(-12300000) -- Iteration 6 -- int(16777215) -- Iteration 7 -- int(123456789) -- Iteration 8 -- int(1) -- Iteration 9 -- int(-1) -- Iteration 10 -- float(-0) -- Iteration 11 -- float(0) -- Iteration 12 -- float(1.234) -- Iteration 13 -- float(-1.234) -- Iteration 14 -- float(-2) -- Iteration 15 -- float(2) -- Iteration 16 -- float(-400010) -- Iteration 17 -- float(400010) -- Iteration 18 -- float(6.99999989) -- Iteration 19 -- float(-0.5) -- Iteration 20 -- float(0.567) -- Iteration 21 -- float(-0.00067) -- Iteration 22 -- float(-670) -- Iteration 23 -- float(1.0E-5) -- Iteration 24 -- float(-100000) -- Iteration 25 -- float(100000) -- Iteration 26 -- float(1.0E-5) -- Iteration 27 -- string(0) "" refcount(%d) -- Iteration 28 -- string(0) "" refcount(%d) -- Iteration 29 -- string(1) " " refcount(%d) -- Iteration 30 -- string(1) " " refcount(%d) -- Iteration 31 -- string(1) "0" refcount(%d) -- Iteration 32 -- string(1) "