Return to hexdec_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / math |
1.1 misho 1: --TEST-- 2: Test hexdec() - wrong params test hexdec() 3: --FILE-- 4: <?php 5: /* Prototype : number hexdec ( string $hex_string ) 6: * Description: Returns the decimal equivalent of the hexadecimal number represented by the hex_string argument. 7: * Source code: ext/standard/math.c 8: */ 9: 10: echo "*** Testing hexdec() : error conditions ***\n"; 11: 12: // get a class 13: class classA 14: { 15: } 16: 17: echo "\n-- Incorrect number of arguments --\n"; 18: hexdec(); 19: hexdec('0x123abc',true); 20: 21: echo "\n-- Incorrect input --\n"; 22: hexdec(new classA()); 23: 24: ?> 25: --EXPECTF-- 26: *** Testing hexdec() : error conditions *** 27: 28: -- Incorrect number of arguments -- 29: 30: Warning: hexdec() expects exactly 1 parameter, 0 given in %s on line %d 31: 32: Warning: hexdec() expects exactly 1 parameter, 2 given in %s on line %d 33: 34: -- Incorrect input -- 35: 36: Catchable fatal error: Object of class classA could not be converted to string in %s on line %d