1--TEST-- 2Test | operator : various numbers as strings 3--FILE-- 4<?php 5 6$strVals = array( 7 "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", 8 "a5.9" 9); 10 11error_reporting(E_ERROR); 12 13foreach ($strVals as $strVal) { 14 foreach($strVals as $otherVal) { 15 echo "--- testing: '$strVal' | '$otherVal' ---\n"; 16 var_dump(bin2hex($strVal|$otherVal)); 17 } 18} 19 20 21?> 22--EXPECT-- 23--- testing: '0' | '0' --- 24string(2) "30" 25--- testing: '0' | '65' --- 26string(4) "3635" 27--- testing: '0' | '-44' --- 28string(6) "3d3434" 29--- testing: '0' | '1.2' --- 30string(6) "312e32" 31--- testing: '0' | '-7.7' --- 32string(8) "3d372e37" 33--- testing: '0' | 'abc' --- 34string(6) "716263" 35--- testing: '0' | '123abc' --- 36string(12) "313233616263" 37--- testing: '0' | '123e5' --- 38string(10) "3132336535" 39--- testing: '0' | '123e5xyz' --- 40string(16) "313233653578797a" 41--- testing: '0' | ' 123abc' --- 42string(14) "30313233616263" 43--- testing: '0' | '123 abc' --- 44string(14) "31323320616263" 45--- testing: '0' | '123abc ' --- 46string(14) "31323361626320" 47--- testing: '0' | '3.4a' --- 48string(8) "332e3461" 49--- testing: '0' | 'a5.9' --- 50string(8) "71352e39" 51--- testing: '65' | '0' --- 52string(4) "3635" 53--- testing: '65' | '65' --- 54string(4) "3635" 55--- testing: '65' | '-44' --- 56string(6) "3f3534" 57--- testing: '65' | '1.2' --- 58string(6) "373f32" 59--- testing: '65' | '-7.7' --- 60string(8) "3f372e37" 61--- testing: '65' | 'abc' --- 62string(6) "777763" 63--- testing: '65' | '123abc' --- 64string(12) "373733616263" 65--- testing: '65' | '123e5' --- 66string(10) "3737336535" 67--- testing: '65' | '123e5xyz' --- 68string(16) "373733653578797a" 69--- testing: '65' | ' 123abc' --- 70string(14) "36353233616263" 71--- testing: '65' | '123 abc' --- 72string(14) "37373320616263" 73--- testing: '65' | '123abc ' --- 74string(14) "37373361626320" 75--- testing: '65' | '3.4a' --- 76string(8) "373f3461" 77--- testing: '65' | 'a5.9' --- 78string(8) "77352e39" 79--- testing: '-44' | '0' --- 80string(6) "3d3434" 81--- testing: '-44' | '65' --- 82string(6) "3f3534" 83--- testing: '-44' | '-44' --- 84string(6) "2d3434" 85--- testing: '-44' | '1.2' --- 86string(6) "3d3e36" 87--- testing: '-44' | '-7.7' --- 88string(8) "2d373e37" 89--- testing: '-44' | 'abc' --- 90string(6) "6d7677" 91--- testing: '-44' | '123abc' --- 92string(12) "3d3637616263" 93--- testing: '-44' | '123e5' --- 94string(10) "3d36376535" 95--- testing: '-44' | '123e5xyz' --- 96string(16) "3d3637653578797a" 97--- testing: '-44' | ' 123abc' --- 98string(14) "2d353633616263" 99--- testing: '-44' | '123 abc' --- 100string(14) "3d363720616263" 101--- testing: '-44' | '123abc ' --- 102string(14) "3d363761626320" 103--- testing: '-44' | '3.4a' --- 104string(8) "3f3e3461" 105--- testing: '-44' | 'a5.9' --- 106string(8) "6d353e39" 107--- testing: '1.2' | '0' --- 108string(6) "312e32" 109--- testing: '1.2' | '65' --- 110string(6) "373f32" 111--- testing: '1.2' | '-44' --- 112string(6) "3d3e36" 113--- testing: '1.2' | '1.2' --- 114string(6) "312e32" 115--- testing: '1.2' | '-7.7' --- 116string(8) "3d3f3e37" 117--- testing: '1.2' | 'abc' --- 118string(6) "716e73" 119--- testing: '1.2' | '123abc' --- 120string(12) "313e33616263" 121--- testing: '1.2' | '123e5' --- 122string(10) "313e336535" 123--- testing: '1.2' | '123e5xyz' --- 124string(16) "313e33653578797a" 125--- testing: '1.2' | ' 123abc' --- 126string(14) "313f3233616263" 127--- testing: '1.2' | '123 abc' --- 128string(14) "313e3320616263" 129--- testing: '1.2' | '123abc ' --- 130string(14) "313e3361626320" 131--- testing: '1.2' | '3.4a' --- 132string(8) "332e3661" 133--- testing: '1.2' | 'a5.9' --- 134string(8) "713f3e39" 135--- testing: '-7.7' | '0' --- 136string(8) "3d372e37" 137--- testing: '-7.7' | '65' --- 138string(8) "3f372e37" 139--- testing: '-7.7' | '-44' --- 140string(8) "2d373e37" 141--- testing: '-7.7' | '1.2' --- 142string(8) "3d3f3e37" 143--- testing: '-7.7' | '-7.7' --- 144string(8) "2d372e37" 145--- testing: '-7.7' | 'abc' --- 146string(8) "6d776f37" 147--- testing: '-7.7' | '123abc' --- 148string(12) "3d373f776263" 149--- testing: '-7.7' | '123e5' --- 150string(10) "3d373f7735" 151--- testing: '-7.7' | '123e5xyz' --- 152string(16) "3d373f773578797a" 153--- testing: '-7.7' | ' 123abc' --- 154string(14) "2d373e37616263" 155--- testing: '-7.7' | '123 abc' --- 156string(14) "3d373f37616263" 157--- testing: '-7.7' | '123abc ' --- 158string(14) "3d373f77626320" 159--- testing: '-7.7' | '3.4a' --- 160string(8) "3f3f3e77" 161--- testing: '-7.7' | 'a5.9' --- 162string(8) "6d372e3f" 163--- testing: 'abc' | '0' --- 164string(6) "716263" 165--- testing: 'abc' | '65' --- 166string(6) "777763" 167--- testing: 'abc' | '-44' --- 168string(6) "6d7677" 169--- testing: 'abc' | '1.2' --- 170string(6) "716e73" 171--- testing: 'abc' | '-7.7' --- 172string(8) "6d776f37" 173--- testing: 'abc' | 'abc' --- 174string(6) "616263" 175--- testing: 'abc' | '123abc' --- 176string(12) "717273616263" 177--- testing: 'abc' | '123e5' --- 178string(10) "7172736535" 179--- testing: 'abc' | '123e5xyz' --- 180string(16) "717273653578797a" 181--- testing: 'abc' | ' 123abc' --- 182string(14) "61737333616263" 183--- testing: 'abc' | '123 abc' --- 184string(14) "71727320616263" 185--- testing: 'abc' | '123abc ' --- 186string(14) "71727361626320" 187--- testing: 'abc' | '3.4a' --- 188string(8) "736e7761" 189--- testing: 'abc' | 'a5.9' --- 190string(8) "61776f39" 191--- testing: '123abc' | '0' --- 192string(12) "313233616263" 193--- testing: '123abc' | '65' --- 194string(12) "373733616263" 195--- testing: '123abc' | '-44' --- 196string(12) "3d3637616263" 197--- testing: '123abc' | '1.2' --- 198string(12) "313e33616263" 199--- testing: '123abc' | '-7.7' --- 200string(12) "3d373f776263" 201--- testing: '123abc' | 'abc' --- 202string(12) "717273616263" 203--- testing: '123abc' | '123abc' --- 204string(12) "313233616263" 205--- testing: '123abc' | '123e5' --- 206string(12) "313233657763" 207--- testing: '123abc' | '123e5xyz' --- 208string(16) "31323365777b797a" 209--- testing: '123abc' | ' 123abc' --- 210string(14) "31333373636363" 211--- testing: '123abc' | '123 abc' --- 212string(14) "31323361636363" 213--- testing: '123abc' | '123abc ' --- 214string(14) "31323361626320" 215--- testing: '123abc' | '3.4a' --- 216string(12) "333e37616263" 217--- testing: '123abc' | 'a5.9' --- 218string(12) "71373f796263" 219--- testing: '123e5' | '0' --- 220string(10) "3132336535" 221--- testing: '123e5' | '65' --- 222string(10) "3737336535" 223--- testing: '123e5' | '-44' --- 224string(10) "3d36376535" 225--- testing: '123e5' | '1.2' --- 226string(10) "313e336535" 227--- testing: '123e5' | '-7.7' --- 228string(10) "3d373f7735" 229--- testing: '123e5' | 'abc' --- 230string(10) "7172736535" 231--- testing: '123e5' | '123abc' --- 232string(12) "313233657763" 233--- testing: '123e5' | '123e5' --- 234string(10) "3132336535" 235--- testing: '123e5' | '123e5xyz' --- 236string(16) "313233653578797a" 237--- testing: '123e5' | ' 123abc' --- 238string(14) "31333377756263" 239--- testing: '123e5' | '123 abc' --- 240string(14) "31323365756263" 241--- testing: '123e5' | '123abc ' --- 242string(14) "31323365776320" 243--- testing: '123e5' | '3.4a' --- 244string(10) "333e376535" 245--- testing: '123e5' | 'a5.9' --- 246string(10) "71373f7d35" 247--- testing: '123e5xyz' | '0' --- 248string(16) "313233653578797a" 249--- testing: '123e5xyz' | '65' --- 250string(16) "373733653578797a" 251--- testing: '123e5xyz' | '-44' --- 252string(16) "3d3637653578797a" 253--- testing: '123e5xyz' | '1.2' --- 254string(16) "313e33653578797a" 255--- testing: '123e5xyz' | '-7.7' --- 256string(16) "3d373f773578797a" 257--- testing: '123e5xyz' | 'abc' --- 258string(16) "717273653578797a" 259--- testing: '123e5xyz' | '123abc' --- 260string(16) "31323365777b797a" 261--- testing: '123e5xyz' | '123e5' --- 262string(16) "313233653578797a" 263--- testing: '123e5xyz' | '123e5xyz' --- 264string(16) "313233653578797a" 265--- testing: '123e5xyz' | ' 123abc' --- 266string(16) "31333377757a7b7a" 267--- testing: '123e5xyz' | '123 abc' --- 268string(16) "31323365757a7b7a" 269--- testing: '123e5xyz' | '123abc ' --- 270string(16) "31323365777b797a" 271--- testing: '123e5xyz' | '3.4a' --- 272string(16) "333e37653578797a" 273--- testing: '123e5xyz' | 'a5.9' --- 274string(16) "71373f7d3578797a" 275--- testing: ' 123abc' | '0' --- 276string(14) "30313233616263" 277--- testing: ' 123abc' | '65' --- 278string(14) "36353233616263" 279--- testing: ' 123abc' | '-44' --- 280string(14) "2d353633616263" 281--- testing: ' 123abc' | '1.2' --- 282string(14) "313f3233616263" 283--- testing: ' 123abc' | '-7.7' --- 284string(14) "2d373e37616263" 285--- testing: ' 123abc' | 'abc' --- 286string(14) "61737333616263" 287--- testing: ' 123abc' | '123abc' --- 288string(14) "31333373636363" 289--- testing: ' 123abc' | '123e5' --- 290string(14) "31333377756263" 291--- testing: ' 123abc' | '123e5xyz' --- 292string(16) "31333377757a7b7a" 293--- testing: ' 123abc' | ' 123abc' --- 294string(14) "20313233616263" 295--- testing: ' 123abc' | '123 abc' --- 296string(14) "31333333616263" 297--- testing: ' 123abc' | '123abc ' --- 298string(14) "31333373636363" 299--- testing: ' 123abc' | '3.4a' --- 300string(14) "333f3673616263" 301--- testing: ' 123abc' | 'a5.9' --- 302string(14) "61353e3b616263" 303--- testing: '123 abc' | '0' --- 304string(14) "31323320616263" 305--- testing: '123 abc' | '65' --- 306string(14) "37373320616263" 307--- testing: '123 abc' | '-44' --- 308string(14) "3d363720616263" 309--- testing: '123 abc' | '1.2' --- 310string(14) "313e3320616263" 311--- testing: '123 abc' | '-7.7' --- 312string(14) "3d373f37616263" 313--- testing: '123 abc' | 'abc' --- 314string(14) "71727320616263" 315--- testing: '123 abc' | '123abc' --- 316string(14) "31323361636363" 317--- testing: '123 abc' | '123e5' --- 318string(14) "31323365756263" 319--- testing: '123 abc' | '123e5xyz' --- 320string(16) "31323365757a7b7a" 321--- testing: '123 abc' | ' 123abc' --- 322string(14) "31333333616263" 323--- testing: '123 abc' | '123 abc' --- 324string(14) "31323320616263" 325--- testing: '123 abc' | '123abc ' --- 326string(14) "31323361636363" 327--- testing: '123 abc' | '3.4a' --- 328string(14) "333e3761616263" 329--- testing: '123 abc' | 'a5.9' --- 330string(14) "71373f39616263" 331--- testing: '123abc ' | '0' --- 332string(14) "31323361626320" 333--- testing: '123abc ' | '65' --- 334string(14) "37373361626320" 335--- testing: '123abc ' | '-44' --- 336string(14) "3d363761626320" 337--- testing: '123abc ' | '1.2' --- 338string(14) "313e3361626320" 339--- testing: '123abc ' | '-7.7' --- 340string(14) "3d373f77626320" 341--- testing: '123abc ' | 'abc' --- 342string(14) "71727361626320" 343--- testing: '123abc ' | '123abc' --- 344string(14) "31323361626320" 345--- testing: '123abc ' | '123e5' --- 346string(14) "31323365776320" 347--- testing: '123abc ' | '123e5xyz' --- 348string(16) "31323365777b797a" 349--- testing: '123abc ' | ' 123abc' --- 350string(14) "31333373636363" 351--- testing: '123abc ' | '123 abc' --- 352string(14) "31323361636363" 353--- testing: '123abc ' | '123abc ' --- 354string(14) "31323361626320" 355--- testing: '123abc ' | '3.4a' --- 356string(14) "333e3761626320" 357--- testing: '123abc ' | 'a5.9' --- 358string(14) "71373f79626320" 359--- testing: '3.4a' | '0' --- 360string(8) "332e3461" 361--- testing: '3.4a' | '65' --- 362string(8) "373f3461" 363--- testing: '3.4a' | '-44' --- 364string(8) "3f3e3461" 365--- testing: '3.4a' | '1.2' --- 366string(8) "332e3661" 367--- testing: '3.4a' | '-7.7' --- 368string(8) "3f3f3e77" 369--- testing: '3.4a' | 'abc' --- 370string(8) "736e7761" 371--- testing: '3.4a' | '123abc' --- 372string(12) "333e37616263" 373--- testing: '3.4a' | '123e5' --- 374string(10) "333e376535" 375--- testing: '3.4a' | '123e5xyz' --- 376string(16) "333e37653578797a" 377--- testing: '3.4a' | ' 123abc' --- 378string(14) "333f3673616263" 379--- testing: '3.4a' | '123 abc' --- 380string(14) "333e3761616263" 381--- testing: '3.4a' | '123abc ' --- 382string(14) "333e3761626320" 383--- testing: '3.4a' | '3.4a' --- 384string(8) "332e3461" 385--- testing: '3.4a' | 'a5.9' --- 386string(8) "733f3e79" 387--- testing: 'a5.9' | '0' --- 388string(8) "71352e39" 389--- testing: 'a5.9' | '65' --- 390string(8) "77352e39" 391--- testing: 'a5.9' | '-44' --- 392string(8) "6d353e39" 393--- testing: 'a5.9' | '1.2' --- 394string(8) "713f3e39" 395--- testing: 'a5.9' | '-7.7' --- 396string(8) "6d372e3f" 397--- testing: 'a5.9' | 'abc' --- 398string(8) "61776f39" 399--- testing: 'a5.9' | '123abc' --- 400string(12) "71373f796263" 401--- testing: 'a5.9' | '123e5' --- 402string(10) "71373f7d35" 403--- testing: 'a5.9' | '123e5xyz' --- 404string(16) "71373f7d3578797a" 405--- testing: 'a5.9' | ' 123abc' --- 406string(14) "61353e3b616263" 407--- testing: 'a5.9' | '123 abc' --- 408string(14) "71373f39616263" 409--- testing: 'a5.9' | '123abc ' --- 410string(14) "71373f79626320" 411--- testing: 'a5.9' | '3.4a' --- 412string(8) "733f3e79" 413--- testing: 'a5.9' | 'a5.9' --- 414string(8) "61352e39" 415