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=== Array 56 57Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d 58bool(false) 59 60Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d 61bool(false) 62 63Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d 64bool(false) 65 66Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d 67bool(false) 68 69Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d 70bool(false) 71 72Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d 73bool(false) 74 75=== 10000000 76string(3) "Dec" 77string(8) "December" 78string(3) "Jul" 79string(4) "July" 80string(6) "Tishri" 81string(0) "" 82 83Done 84