1--TEST-- 2Test base_convert() function : error conditions - incorrect input 3--FILE-- 4<?php 5/* Prototype : string base_convert ( string $number , int $frombase , int $tobase ) 6 * Description: Convert a number between arbitrary bases. 7 * Source code: ext/standard/math.c 8 */ 9 10echo "*** Testing base_convert() : error conditions ***\n"; 11 12// get a class 13class classA 14{ 15} 16 17echo "Incorrect number of arguments\n"; 18base_convert(); 19base_convert(35); 20base_convert(35,2); 21base_convert(1234, 1, 10); 22base_convert(1234, 10, 37); 23 24echo "Incorrect input\n"; 25try { 26 base_convert(new classA(), 8, 10); 27} catch (Error $e) { 28 echo $e->getMessage(), "\n"; 29} 30 31?> 32--EXPECTF-- 33*** Testing base_convert() : error conditions *** 34Incorrect number of arguments 35 36Warning: base_convert() expects exactly 3 parameters, 0 given in %s on line %d 37 38Warning: base_convert() expects exactly 3 parameters, 1 given in %s on line %d 39 40Warning: base_convert() expects exactly 3 parameters, 2 given in %s on line %d 41 42Warning: base_convert(): Invalid `from base' (1) in %s on line %d 43 44Warning: base_convert(): Invalid `to base' (37) in %s on line %d 45Incorrect input 46Object of class classA could not be converted to string 47