Skip to content

Stdlib: error_log() — VM/JIT/AOT (closes #3380) - #8322

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-3380-error-log
Jun 13, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-3380-error-log

Conversation

@PurHur

@PurHur PurHur commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement error_log() per php-src ext/standard/basic_functions.c::_php_error_log in PHP (ext/standard/error_log.php, VmErrorLog.php).
  • Type 0/4/default writes to stderr via fprintf; type 3 appends via __compiler_file_put_contents / JitFilePutContents lowering.
  • Register in Module.php; capability matrix row added; compliance + AOT fixture + unit tests.

php-src reference

  • ext/standard/basic_functions.cPHP_FUNCTION(error_log) / _php_error_log

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(function_exists(\"error_log\"));"'
# bool(true)

vendor/bin/phpunit --filter ErrorLogBuiltinTest
# OK (5 tests)

vendor/bin/phpunit --filter "stdlib/error_log"
# OK (2 tests — VM + JIT compliance)

php bin/vm.php test/repro/maintainer-error_log.php
# stderr: hello from error_log; stdout: ok + file msg

php bin/compile.php -l test/repro/maintainer-error_log.php
# lint exit 0

php bin/compile.php -o /tmp/el_aot test/repro/error_log_aot_type3.php && /tmp/el_aot
# AOT type-3 append OK (file created)

php bin/jit.php test/repro/maintainer-error_log.php
# JIT OK

Closes #3380

Made with Cursor

Port php-src _php_error_log semantics into ext/standard with stderr logging
(type 0/4/default) and file append (type 3), matching Zend ValueError edges.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit a624d41 into master Jun 13, 2026
@PurHur
PurHur deleted the agent/issue-3380-error-log branch June 13, 2026 08:46
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: error_log() — write message to SAPI/error log (ext/standard/basic_functions.c parity)

1 participant