xref: /PHP-8.3/ext/calendar/tests/jdtojewish.phpt (revision 56f90492)
1--TEST--
2jdtojewish() function
3--EXTENSIONS--
4calendar
5--FILE--
6<?php
7
8var_dump(jdtojewish(gregoriantojd(10,28,2002))."\r\n".
9    jdtojewish(gregoriantojd(10,28,2002),true)."\r\n".
10    jdtojewish(gregoriantojd(10,28,2002),true, CAL_JEWISH_ADD_ALAFIM_GERESH)."\r\n".
11    jdtojewish(gregoriantojd(10,28,2002),true, CAL_JEWISH_ADD_ALAFIM)."\r\n".
12    jdtojewish(gregoriantojd(10,28,2002),true, CAL_JEWISH_ADD_ALAFIM_GERESH+CAL_JEWISH_ADD_ALAFIM)."\r\n".
13    jdtojewish(gregoriantojd(10,28,2002),true, CAL_JEWISH_ADD_GERESHAYIM)."\r\n".
14    jdtojewish(gregoriantojd(10,8,2002),true, CAL_JEWISH_ADD_GERESHAYIM)."\r\n".
15    jdtojewish(gregoriantojd(10,8,2002),true, CAL_JEWISH_ADD_GERESHAYIM+CAL_JEWISH_ADD_ALAFIM_GERESH)."\r\n".
16    jdtojewish(gregoriantojd(10,8,2002),true, CAL_JEWISH_ADD_GERESHAYIM+CAL_JEWISH_ADD_ALAFIM)."\r\n".
17    jdtojewish(gregoriantojd(10,8,2002),true, CAL_JEWISH_ADD_GERESHAYIM+CAL_JEWISH_ADD_ALAFIM+CAL_JEWISH_ADD_ALAFIM_GERESH)."\r\n".
18    jdtojewish(gregoriantojd(3,10,2007))."\r\n");
19
20echo jdtojewish(gregoriantojd(11,5,2002)) . "\n";
21echo jdtojewish(gregoriantojd(11,29,2004)) . "\n";
22echo jdtojewish(gregoriantojd(1,1,9998)) . "\n";
23try {
24    jdtojewish(gregoriantojd(1,1,9998),true);
25} catch (ValueError $ex) {
26    echo "{$ex->getMessage()}\n";
27}
28?>
29--EXPECTF--
30string(%d) "2/22/5763
31�� ���� �����
32�� ���� �'����
33�� ���� � ����� ����
34�� ���� �' ����� ����
35�"� ���� ����"�
36�' ���� ����"�
37�' ���� �'���"�
38�' ���� � ����� ���"�
39�' ���� �' ����� ���"�
407/20/5767
41"
422/30/5763
433/16/5765
443/8/13758
45Year out of range (0-9999)
46