3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLunationNumber($m, $d, $y) { $offset = 1; $synodicMonth = 29.530588861; $lunationBase = 2423436.40347; return round(((gregoriantojd($m, $d, $y) - $lunationBase ) / $synodicMonth )) + $offset; } echo getLunationNumber(1, 17, 1923).PHP_EOL; // 1 echo getLunationNumber(10, 25, 2003).PHP_EOL; // 1000

preferences:
61.26 ms | 402 KiB | 5 Q