[php-src] Issue #21781: Hebrew dates wrong
[email protected] (aelster)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/21781
Author: aelster
### Description
I'm working on a family dates project with Claude and saw a converted date was wrong. This is what Claude reported:
_The root cause: PHP's jdtojewish() uses the civil Hebrew calendar (Tishrei=1, …, Elul=13), but the month names array was written for the religious calendar (Nisan=1, …, Elul=12). So every month was being looked up with the wrong name — Iyar (PHP month 9) was displayed as "Kislev" (the old array's entry for 9), etc. Also fixed the Adar I/II fallback in nextGregorianDate() which was checking for the nonexistent month 13._
### PHP Version
```plain
PHP 8.5.4 (cli) (built: Mar 10 2026 23:15:23) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.5.4, Copyright (c) Zend Technologies
with Xdebug v3.5.0, Copyright (c) 2002-2025, by Derick Rethans
with Zend OPcache v8.5.4, Copyright (c), by Zend Technologies
```
### Operating System
MacOS Tahoe Version 26.4