Annotation of embedaddon/php/ext/standard/tests/general_functions/set_magic_quotes_runtime_variation1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test set_magic_quotes_runtime() function - usage variation
! 3: --INI--
! 4: magic_quotes_runtime = 0
! 5: --FILE--
! 6: <?php
! 7: /* Prototype: bool set_magic_quotes_runtime ( int $new_setting )
! 8: * Description: Sets the current active configuration setting of magic_quotes_runtime
! 9: */
! 10:
! 11: echo "Simple testcase for set_magic_quotes_runtime() function\n";
! 12:
! 13: $g = get_magic_quotes_runtime();
! 14: echo "magic quotes runtime set in INI file: ".$g."\n";
! 15:
! 16: // Prevent notices about undefines variables
! 17: error_reporting(E_ALL & ~E_NOTICE);
! 18:
! 19: $unset_var = 10;
! 20: unset ($unset_var);
! 21:
! 22: class fooClass {
! 23: function __toString() {
! 24: return "true";
! 25: }
! 26: }
! 27:
! 28: $fp = fopen(__FILE__, "r");
! 29:
! 30: $values = array(
! 31:
! 32: // int data
! 33: /*1*/ 0,
! 34: 1,
! 35: 12345,
! 36: -2345,
! 37:
! 38: // float data
! 39: /*5*/ 0.0,
! 40: 10.5,
! 41: -10.5,
! 42: 10.1234567e10,
! 43: 10.7654321E-10,
! 44: .5,
! 45:
! 46: // null data
! 47: /*11*/ NULL,
! 48: null,
! 49:
! 50: // boolean data
! 51: /*13*/ true,
! 52: false,
! 53: TRUE,
! 54: FALSE,
! 55:
! 56: // empty data
! 57: /*17*/ "",
! 58: '',
! 59:
! 60: // object data
! 61: /*19*/ new fooClass(),
! 62:
! 63: // resource
! 64: /*20*/ $fp,
! 65:
! 66: // undefined data
! 67: /*21*/ $undefined_var,
! 68:
! 69: // unset data
! 70: /*22*/ $unset_var
! 71: );
! 72:
! 73: // loop through each element of the array for data
! 74:
! 75: $iterator = 1;
! 76: foreach($values as $value) {
! 77: echo "-- Iterator $iterator --\n";
! 78: var_dump( set_magic_quotes_runtime($value) );
! 79: echo "New value of magic_quotes_runtime after last set is " . get_magic_quotes_runtime(). "\n";
! 80: $iterator++;
! 81: };
! 82:
! 83: fclose($fp);
! 84:
! 85: ?>
! 86: ===DONE===
! 87: --EXPECTF--
! 88: Simple testcase for set_magic_quotes_runtime() function
! 89: magic quotes runtime set in INI file: 0
! 90: -- Iterator 1 --
! 91:
! 92: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 93: bool(true)
! 94: New value of magic_quotes_runtime after last set is 0
! 95: -- Iterator 2 --
! 96:
! 97: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 98: bool(true)
! 99: New value of magic_quotes_runtime after last set is 1
! 100: -- Iterator 3 --
! 101:
! 102: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 103: bool(true)
! 104: New value of magic_quotes_runtime after last set is 1
! 105: -- Iterator 4 --
! 106:
! 107: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 108: bool(true)
! 109: New value of magic_quotes_runtime after last set is 1
! 110: -- Iterator 5 --
! 111:
! 112: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 113: bool(true)
! 114: New value of magic_quotes_runtime after last set is 0
! 115: -- Iterator 6 --
! 116:
! 117: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 118: bool(true)
! 119: New value of magic_quotes_runtime after last set is 1
! 120: -- Iterator 7 --
! 121:
! 122: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 123: bool(true)
! 124: New value of magic_quotes_runtime after last set is 1
! 125: -- Iterator 8 --
! 126:
! 127: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 128: bool(true)
! 129: New value of magic_quotes_runtime after last set is 1
! 130: -- Iterator 9 --
! 131:
! 132: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 133: bool(true)
! 134: New value of magic_quotes_runtime after last set is 1
! 135: -- Iterator 10 --
! 136:
! 137: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 138: bool(true)
! 139: New value of magic_quotes_runtime after last set is 1
! 140: -- Iterator 11 --
! 141:
! 142: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 143: bool(true)
! 144: New value of magic_quotes_runtime after last set is 0
! 145: -- Iterator 12 --
! 146:
! 147: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 148: bool(true)
! 149: New value of magic_quotes_runtime after last set is 0
! 150: -- Iterator 13 --
! 151:
! 152: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 153: bool(true)
! 154: New value of magic_quotes_runtime after last set is 1
! 155: -- Iterator 14 --
! 156:
! 157: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 158: bool(true)
! 159: New value of magic_quotes_runtime after last set is 0
! 160: -- Iterator 15 --
! 161:
! 162: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 163: bool(true)
! 164: New value of magic_quotes_runtime after last set is 1
! 165: -- Iterator 16 --
! 166:
! 167: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 168: bool(true)
! 169: New value of magic_quotes_runtime after last set is 0
! 170: -- Iterator 17 --
! 171:
! 172: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 173: bool(true)
! 174: New value of magic_quotes_runtime after last set is 0
! 175: -- Iterator 18 --
! 176:
! 177: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 178: bool(true)
! 179: New value of magic_quotes_runtime after last set is 0
! 180: -- Iterator 19 --
! 181:
! 182: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 183:
! 184: Warning: set_magic_quotes_runtime() expects parameter 1 to be boolean, object given in %s on line %d
! 185: NULL
! 186: New value of magic_quotes_runtime after last set is 0
! 187: -- Iterator 20 --
! 188:
! 189: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 190:
! 191: Warning: set_magic_quotes_runtime() expects parameter 1 to be boolean, resource given in %s on line %d
! 192: NULL
! 193: New value of magic_quotes_runtime after last set is 0
! 194: -- Iterator 21 --
! 195:
! 196: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 197: bool(true)
! 198: New value of magic_quotes_runtime after last set is 0
! 199: -- Iterator 22 --
! 200:
! 201: Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d
! 202: bool(true)
! 203: New value of magic_quotes_runtime after last set is 0
! 204: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>