Skip to content

Stdlib: JIT/AOT date_sunrise()/date_sunset() (#6137) - #8125

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-6137-date-sunrise-sunset-jit
Jun 12, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-6137-date-sunrise-sunset-jit

Conversation

@PurHur

@PurHur PurHur commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/date/php_date.c — PHP_FUNCTION(date_sunrise), PHP_FUNCTION(date_sunset)
  • ext/date/lib/astro.c — ported in ext/standard/VmDateSunNative.php

Verification

./script/docker-exec.sh -- bash -lc 'cd /compiler && vendor/bin/phpunit --filter date_sunrise_sunset test/compliance/VMTest.php'
# OK (2 tests) — VM + JIT PHPT

./script/docker-exec.sh -- bash -lc 'cd /compiler && vendor/bin/phpunit --filter date_sunrise_sunset test/aot/AotTest.php'
# OK (1 test) — AOT link + execute

./script/docker-exec.sh -- bash -lc 'cd /compiler && php bin/compile.php -o /tmp/sun /tmp/sun.php && /tmp/sun'
# with: <?php echo date_sunrise(1782000000, 0, 51.5, -0.1, 90.0, 0.0);
# => 1782013676

Closes #6137

Made with Cursor

Compile-time literal baking via JitDateSunFunc mirrors date_sun_info; preserve
compileTimeFloat through unary-minus and temporary boxing for negative coords.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit e9a8c39 into master Jun 12, 2026
@PurHur
PurHur deleted the agent/issue-6137-date-sunrise-sunset-jit branch June 12, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: date_sunrise()/date_sunset() — solar position helpers missing (ext/date/php_date.c)

1 participant