⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bug31402.phpt

📁 php-4.4.7学习linux时下载的源代码
💻 PHPT
字号:
--TEST--Bug #31402 (unserialize() generates references when it should not)--FILE--<?php class X {  var $i;  function X($i) {    $this->i = $i;  }}class Y {  var $A = array();  var $B;  function Y() {    $this->A[1] = new X(1);    $this->A[2] = new X(2);    $this->B = $this->A[1];  }}$before = new Y();$ser = serialize($before);$after = unserialize($ser);var_dump($before, $after);?>--EXPECT--object(y)(2) {  ["A"]=>  array(2) {    [1]=>    object(x)(1) {      ["i"]=>      int(1)    }    [2]=>    object(x)(1) {      ["i"]=>      int(2)    }  }  ["B"]=>  object(x)(1) {    ["i"]=>    int(1)  }}object(y)(2) {  ["A"]=>  array(2) {    [1]=>    object(x)(1) {      ["i"]=>      int(1)    }    [2]=>    object(x)(1) {      ["i"]=>      int(2)    }  }  ["B"]=>  object(x)(1) {    ["i"]=>    int(1)  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -