????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 18.217.160.127
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 :  /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/strings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/strings/chunk_split_variation5.phpt
--TEST--
Test chunk_split() function : usage variations - different integer values for 'chunklen' argument(Bug#42796)
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
/* Prototype  : string chunk_split(string $str [, int $chunklen [, string $ending]])
 * Description: Returns split line
 * Source code: ext/standard/string.c
 * Alias to functions: none
*/

/*
* passsing different integer values for 'chunklen' argument to chunk_split()
* 'ending' is set to '||'
*/

echo "*** Testing chunk_split() : different integer values for 'chunklen' ***\n";

 //Initializing variables
$ending = "||";
$str = "This contains\tand special char & numbers 123.\nIt also checks for \0 char";

// different values for chunklen
$values = array (
  0,  
  1,  
  -123,  //negative integer
  0234,  //octal number
  0x1A,  //hexadecimal number
  PHP_INT_MAX,  //max positive integer number
  PHP_INT_MAX * 3,  //integer overflow
  -PHP_INT_MAX - 1,  //min negative integer

);

for($count = 0; $count < count($values); $count++) {
  echo "-- Iteration $count --\n";
  var_dump( chunk_split($str, $values[$count], $ending) );
}

echo "Done"
?>
--EXPECTF--
*** Testing chunk_split() : different integer values for 'chunklen' ***
-- Iteration 0 --

Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 1 --
string(213) "T||h||i||s|| ||c||o||n||t||a||i||n||s||	||a||n||d|| ||s||p||e||c||i||a||l|| ||c||h||a||r|| ||&|| ||n||u||m||b||e||r||s|| ||1||2||3||.||
||I||t|| ||a||l||s||o|| ||c||h||e||c||k||s|| ||f||o||r|| |||| ||c||h||a||r||"
-- Iteration 2 --

Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 3 --
string(73) "This contains	and special char & numbers 123.
It also checks for  char||"
-- Iteration 4 --
string(77) "This contains	and special ||char & numbers 123.
It als||o checks for  char||"
-- Iteration 5 --
string(73) "This contains	and special char & numbers 123.
It also checks for  char||"
-- Iteration 6 --

Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
-- Iteration 7 --

Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
bool(false)
Done

Youez - 2016 - github.com/yon3zu
LinuXploit