1--TEST-- 2jdtomonthname() test 3--SKIPIF-- 4<?php if (!extension_loaded("calendar")) print "skip"; ?> 5--FILE-- 6<?php 7 8$jd_days = Array( 9 2453396, 10 2440588, 11 -1, 12 array(), 13 10000000 14 ); 15 16foreach ($jd_days as $jd_day) { 17 echo "=== ", $jd_day, "\n"; 18 var_dump(jdmonthname($jd_day,0)); 19 var_dump(jdmonthname($jd_day,1)); 20 var_dump(jdmonthname($jd_day,2)); 21 var_dump(jdmonthname($jd_day,3)); 22 var_dump(jdmonthname($jd_day,4)); 23 var_dump(jdmonthname($jd_day,5)); 24 echo "\n"; 25} 26 27echo "Done\n"; 28 29?> 30--EXPECTF-- 31=== 2453396 32string(3) "Jan" 33string(7) "January" 34string(3) "Jan" 35string(7) "January" 36string(6) "Shevat" 37string(0) "" 38 39=== 2440588 40string(3) "Jan" 41string(7) "January" 42string(3) "Dec" 43string(8) "December" 44string(5) "Tevet" 45string(0) "" 46 47=== -1 48string(0) "" 49string(0) "" 50string(0) "" 51string(0) "" 52string(0) "" 53string(0) "" 54 55=== 56Notice: Array to string conversion in %sjdtomonthname.php on line %d 57Array 58 59Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d 60bool(false) 61 62Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d 63bool(false) 64 65Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d 66bool(false) 67 68Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d 69bool(false) 70 71Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d 72bool(false) 73 74Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d 75bool(false) 76 77=== 10000000 78string(3) "Dec" 79string(8) "December" 80string(3) "Jul" 81string(4) "July" 82string(6) "Tishri" 83string(0) "" 84 85Done 86