Skip to content

addslashes stops at the first NUL byte instead of escaping it as \0. #279

Closed

Description

@blacktrs

Summary

addslashes stops at the first NUL byte instead of escaping it as \0.

Repro

<?php
$r = addslashes("a\0b'c");
echo strlen($r), ' ', bin2hex($r), "\n";

Expected (php)

7 615c30625c2763

Actual (manticore b9b79dfa, Darwin arm64)

1 61

Tracking

Known-bug repro: tests/aot/repro/wrong/addslashes_nul_byte.php — bash tests/aot/xfail.sh -k addslashes_nul_byte reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    wrong-answer
    on Oct 16, 2026
  2. added a commit that references this issue on Oct 16, 2026
    3c47471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions