php 欺骗提交,欺骗PHP整数
不要告訴任何人!
class IntegerstringArray IMPLEMENTS ArrayAccess {
var $evil = "0000111122220000ffff";
// 16 bit each
function offsetExists ( $offset ) {
return (strlen($this->evil) / 4) - 1 >= $offset;
}
function offsetGet ( $offset ) {
return hexdec(substr($this->evil, $offset * 4, 4));
}
function offsetSet ( $offset , $value ) {
$hex = dechex($value);
if ($fill = 4 - strlen($hex)) {
$hex = str_repeat("0", $fill) . $hex;
}
for ($i=0; $i<4; $i++) {
$this->evil[$offset*4+$i] = $hex[$i];
}
}
function offsetUnset ( $offset ) {
assert(false);
}
}
所以你幾乎可以創建一個數組對象:
$array = new IntegerstringArray();
$array[2] = 65535;
print $array[2];
它在內部存儲一個列表并接受16位整數.陣列偏移必須是連續的.
Not tested. Just as an implementation guide.
總結
以上是生活随笔為你收集整理的php 欺骗提交,欺骗PHP整数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php什么框架性能高,主流PHP框架性能
- 下一篇: 读《java的讲座》后感,老师讲座听后感