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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/spl/tests/arrayObject_magicMethods1.phpt
--TEST--
SPL: ArrayObject: ensure a wrapped object's magic methods for property access are not invoked when manipulating the ArrayObject's elements using [].
--FILE--
<?php
class UsesMagic {
	public $a = 1;
	public $b = 2;
	public $c = 3;

	private $priv = 'secret';
	
	function __get($name) { 
		$args = func_get_args();
		echo "In " . __METHOD__ . "(" . implode($args, ',') . ")\n";
	}
	function __set($name, $value) { 
		$args = func_get_args();
		echo "In " . __METHOD__ . "(" . implode($args, ',') . ")\n";
	}
	function __isset($name) { 
		$args = func_get_args();
		echo "In " . __METHOD__ . "(" . implode($args, ',') . ")\n";
	}
	function __unset($name) { 
		$args = func_get_args();
		echo "In " . __METHOD__ . "(" . implode($args, ',') . ")\n";
	}
	
}

$obj = new UsesMagic;

$ao = new ArrayObject($obj);
echo "\n--> Write existent, non-existent and dynamic:\n";
$ao['a'] = 'changed';
$ao['dynamic'] = 'new';
$ao['dynamic'] = 'new.changed';
echo "  Original wrapped object:\n";
var_dump($obj);
echo "  Wrapping ArrayObject:\n";
var_dump($ao);

echo "\n--> Read existent, non-existent and dynamic:\n";
var_dump($ao['a']);
var_dump($ao['nonexistent']);
var_dump($ao['dynamic']);
echo "  Original wrapped object:\n";
var_dump($obj);
echo "  Wrapping ArrayObject:\n";
var_dump($ao);

echo "\n--> isset existent, non-existent and dynamic:\n";
var_dump(isset($ao['a']));
var_dump(isset($ao['nonexistent']));
var_dump(isset($ao['dynamic']));
echo "  Original wrapped object:\n";
var_dump($obj);
echo "  Wrapping ArrayObject:\n";
var_dump($ao);

echo "\n--> Unset existent, non-existent and dynamic:\n";
unset($ao['a']);
unset($ao['nonexistent']);
unset($ao['dynamic']);
echo "  Original wrapped object:\n";
var_dump($obj);
echo "  Wrapping ArrayObject:\n";
var_dump($ao);
?>
--EXPECTF--
--> Write existent, non-existent and dynamic:
  Original wrapped object:
object(UsesMagic)#1 (5) {
  ["a"]=>
  string(7) "changed"
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
  ["priv":"UsesMagic":private]=>
  string(6) "secret"
  ["dynamic"]=>
  string(11) "new.changed"
}
  Wrapping ArrayObject:
object(ArrayObject)#2 (1) {
  ["storage":"ArrayObject":private]=>
  object(UsesMagic)#1 (5) {
    ["a"]=>
    string(7) "changed"
    ["b"]=>
    int(2)
    ["c"]=>
    int(3)
    ["priv":"UsesMagic":private]=>
    string(6) "secret"
    ["dynamic"]=>
    string(11) "new.changed"
  }
}

--> Read existent, non-existent and dynamic:
string(7) "changed"

Notice: Undefined index: nonexistent in %s on line 42
NULL
string(11) "new.changed"
  Original wrapped object:
object(UsesMagic)#1 (5) {
  ["a"]=>
  string(7) "changed"
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
  ["priv":"UsesMagic":private]=>
  string(6) "secret"
  ["dynamic"]=>
  string(11) "new.changed"
}
  Wrapping ArrayObject:
object(ArrayObject)#2 (1) {
  ["storage":"ArrayObject":private]=>
  object(UsesMagic)#1 (5) {
    ["a"]=>
    string(7) "changed"
    ["b"]=>
    int(2)
    ["c"]=>
    int(3)
    ["priv":"UsesMagic":private]=>
    string(6) "secret"
    ["dynamic"]=>
    string(11) "new.changed"
  }
}

--> isset existent, non-existent and dynamic:
bool(true)
bool(false)
bool(true)
  Original wrapped object:
object(UsesMagic)#1 (5) {
  ["a"]=>
  string(7) "changed"
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
  ["priv":"UsesMagic":private]=>
  string(6) "secret"
  ["dynamic"]=>
  string(11) "new.changed"
}
  Wrapping ArrayObject:
object(ArrayObject)#2 (1) {
  ["storage":"ArrayObject":private]=>
  object(UsesMagic)#1 (5) {
    ["a"]=>
    string(7) "changed"
    ["b"]=>
    int(2)
    ["c"]=>
    int(3)
    ["priv":"UsesMagic":private]=>
    string(6) "secret"
    ["dynamic"]=>
    string(11) "new.changed"
  }
}

--> Unset existent, non-existent and dynamic:

Notice: Undefined index: nonexistent in %s on line 60
  Original wrapped object:
object(UsesMagic)#1 (3) {
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
  ["priv":"UsesMagic":private]=>
  string(6) "secret"
}
  Wrapping ArrayObject:
object(ArrayObject)#2 (1) {
  ["storage":"ArrayObject":private]=>
  object(UsesMagic)#1 (3) {
    ["b"]=>
    int(2)
    ["c"]=>
    int(3)
    ["priv":"UsesMagic":private]=>
    string(6) "secret"
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit