Annotation of embedaddon/php/ext/mbstring/tests/bug26639.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #26639 (mb_convert_variables() clutters variables beyond the references)
! 3: --SKIPIF--
! 4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
! 5: --FILE--
! 6: <?php
! 7: $a = "あいうえお";
! 8: $b = $a;
! 9: mb_convert_variables("EUC-JP", "Shift_JIS", $b);
! 10: debug_zval_dump($a);
! 11: debug_zval_dump($b);
! 12: unset($a);
! 13: unset($b);
! 14:
! 15: $a = "あいうえお";
! 16: $b = &$a;
! 17: mb_convert_variables("EUC-JP", "Shift_JIS", $b);
! 18: debug_zval_dump($a);
! 19: debug_zval_dump($b);
! 20: unset($a);
! 21: unset($b);
! 22:
! 23: $a = "あいうえお";
! 24: $b = array($a);
! 25: $c = $b;
! 26: mb_convert_variables("EUC-JP", "Shift_JIS", $c);
! 27: debug_zval_dump($b);
! 28: debug_zval_dump($c);
! 29: unset($a);
! 30: unset($b);
! 31: unset($c);
! 32:
! 33: $a = "あいうえお";
! 34: $b = array(&$a);
! 35: $c = $b;
! 36: mb_convert_variables("EUC-JP", "Shift_JIS", $c);
! 37: debug_zval_dump($b);
! 38: debug_zval_dump($c);
! 39: unset($a);
! 40: unset($b);
! 41: unset($c);
! 42:
! 43: $a = "あいうえお";
! 44: $b = array($a);
! 45: $c = &$b;
! 46: mb_convert_variables("EUC-JP", "Shift_JIS", $c);
! 47: debug_zval_dump($b);
! 48: debug_zval_dump($c);
! 49: unset($a);
! 50: unset($b);
! 51: unset($c);
! 52:
! 53: $a = "あいうえお";
! 54: $b = array(&$a);
! 55: $c = &$b;
! 56: mb_convert_variables("EUC-JP", "Shift_JIS", $c);
! 57: debug_zval_dump($b);
! 58: debug_zval_dump($c);
! 59: unset($a);
! 60: unset($b);
! 61: unset($c);
! 62:
! 63: $a = array(array("あいうえお"));
! 64: $b = $a;
! 65: $c = $b;
! 66: mb_convert_variables("EUC-JP", "Shift_JIS", $c);
! 67: debug_zval_dump($b);
! 68: debug_zval_dump($c);
! 69: unset($a);
! 70: unset($b);
! 71: unset($c);
! 72: ?>
! 73: --EXPECT--
! 74: string(10) "あいうえお" refcount(2)
! 75: string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
! 76: string(10) "、「、、、ヲ、ィ、ェ" refcount(1)
! 77: string(10) "、「、、、ヲ、ィ、ェ" refcount(1)
! 78: array(1) refcount(2){
! 79: [0]=>
! 80: string(10) "あいうえお" refcount(2)
! 81: }
! 82: array(1) refcount(2){
! 83: [0]=>
! 84: string(10) "、「、、、ヲ、ィ、ェ" refcount(1)
! 85: }
! 86: array(1) refcount(2){
! 87: [0]=>
! 88: &string(10) "あいうえお" refcount(2)
! 89: }
! 90: array(1) refcount(2){
! 91: [0]=>
! 92: string(10) "、「、、、ヲ、ィ、ェ" refcount(1)
! 93: }
! 94: array(1) refcount(1){
! 95: [0]=>
! 96: string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
! 97: }
! 98: array(1) refcount(1){
! 99: [0]=>
! 100: string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
! 101: }
! 102: array(1) refcount(1){
! 103: [0]=>
! 104: string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
! 105: }
! 106: array(1) refcount(1){
! 107: [0]=>
! 108: string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
! 109: }
! 110: array(1) refcount(3){
! 111: [0]=>
! 112: array(1) refcount(1){
! 113: [0]=>
! 114: string(10) "あいうえお" refcount(1)
! 115: }
! 116: }
! 117: array(1) refcount(2){
! 118: [0]=>
! 119: array(1) refcount(1){
! 120: [0]=>
! 121: string(10) "、「、、、ヲ、ィ、ェ" refcount(1)
! 122: }
! 123: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>