1--TEST-- 2Test sql_regcase() function : usage variations - unexpected arg type 3--FILE-- 4<?php 5/* Prototype : proto string sql_regcase(string string) 6 * Description: Make regular expression for case insensitive match 7 * Source code: ext/standard/reg.c 8 * Alias to functions: msql_regcase 9 */ 10 11function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { 12 echo "Error: $err_no - $err_msg, $filename($linenum)\n"; 13} 14set_error_handler('test_error_handler'); 15 16echo "*** Testing sql_regcase() : usage variations ***\n"; 17 18// Initialise function arguments not being substituted (if any) 19 20//get an unset variable 21$unset_var = 10; 22unset ($unset_var); 23 24//array of values to iterate over 25$values = array( 26 27 // int data 28 0, 29 1, 30 12345, 31 -2345, 32 33 // float data 34 10.5, 35 -10.5, 36 10.1234567e10, 37 10.7654321E-10, 38 .5, 39 40 // array data 41 array(), 42 array(0), 43 array(1), 44 array(1, 2), 45 array('color' => 'red', 'item' => 'pen'), 46 47 // null data 48 NULL, 49 null, 50 51 // boolean data 52 true, 53 false, 54 TRUE, 55 FALSE, 56 57 // empty data 58 "", 59 '', 60 61 // object data 62 new stdclass(), 63 64 // undefined data 65 $undefined_var, 66 67 // unset data 68 $unset_var, 69); 70 71// loop through each element of the array for string 72 73foreach($values as $value) { 74 echo "\nArg value $value \n"; 75 var_dump( sql_regcase($value) ); 76}; 77 78echo "Done"; 79?> 80--EXPECTF-- 81*** Testing sql_regcase() : usage variations *** 82Error: 8 - Undefined variable: undefined_var, %s(62) 83Error: 8 - Undefined variable: unset_var, %s(65) 84 85Arg value 0 86Error: 8192 - Function sql_regcase() is deprecated, %s(72) 87string(1) "0" 88 89Arg value 1 90Error: 8192 - Function sql_regcase() is deprecated, %s(72) 91string(1) "1" 92 93Arg value 12345 94Error: 8192 - Function sql_regcase() is deprecated, %s(72) 95string(5) "12345" 96 97Arg value -2345 98Error: 8192 - Function sql_regcase() is deprecated, %s(72) 99string(5) "-2345" 100 101Arg value 10.5 102Error: 8192 - Function sql_regcase() is deprecated, %s(72) 103string(4) "10.5" 104 105Arg value -10.5 106Error: 8192 - Function sql_regcase() is deprecated, %s(72) 107string(5) "-10.5" 108 109Arg value 101234567000 110Error: 8192 - Function sql_regcase() is deprecated, %s(72) 111string(12) "101234567000" 112 113Arg value 1.07654321E-9 114Error: 8192 - Function sql_regcase() is deprecated, %s(72) 115string(16) "1.07654321[Ee]-9" 116 117Arg value 0.5 118Error: 8192 - Function sql_regcase() is deprecated, %s(72) 119string(3) "0.5" 120Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) 121 122Arg value Array 123Error: 8192 - Function sql_regcase() is deprecated, %s(72) 124Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) 125NULL 126Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) 127 128Arg value Array 129Error: 8192 - Function sql_regcase() is deprecated, %s(72) 130Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) 131NULL 132Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) 133 134Arg value Array 135Error: 8192 - Function sql_regcase() is deprecated, %s(72) 136Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) 137NULL 138Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) 139 140Arg value Array 141Error: 8192 - Function sql_regcase() is deprecated, %s(72) 142Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) 143NULL 144Error: 8 - Array to string conversion, %ssql_regcase_variation_001.php(%d) 145 146Arg value Array 147Error: 8192 - Function sql_regcase() is deprecated, %s(72) 148Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72) 149NULL 150 151Arg value 152Error: 8192 - Function sql_regcase() is deprecated, %s(72) 153string(0) "" 154 155Arg value 156Error: 8192 - Function sql_regcase() is deprecated, %s(72) 157string(0) "" 158 159Arg value 1 160Error: 8192 - Function sql_regcase() is deprecated, %s(72) 161string(1) "1" 162 163Arg value 164Error: 8192 - Function sql_regcase() is deprecated, %s(72) 165string(0) "" 166 167Arg value 1 168Error: 8192 - Function sql_regcase() is deprecated, %s(72) 169string(1) "1" 170 171Arg value 172Error: 8192 - Function sql_regcase() is deprecated, %s(72) 173string(0) "" 174 175Arg value 176Error: 8192 - Function sql_regcase() is deprecated, %s(72) 177string(0) "" 178 179Arg value 180Error: 8192 - Function sql_regcase() is deprecated, %s(72) 181string(0) "" 182Error: 4096 - Object of class stdClass could not be converted to string, %s(71) 183 184Arg value 185Error: 8192 - Function sql_regcase() is deprecated, %s(72) 186Error: 2 - sql_regcase() expects parameter 1 to be string, object given, %s(72) 187NULL 188 189Arg value 190Error: 8192 - Function sql_regcase() is deprecated, %s(72) 191string(0) "" 192 193Arg value 194Error: 8192 - Function sql_regcase() is deprecated, %s(72) 195string(0) "" 196Done 197