Skip to content

Language: PROFILE≥8.3 dim-read Warning still "value of type …" — Zend "on false|true|int|…" (re-#30028, zend_execute.c) #30053

Description

@PurHur

Category

Language · php-src-strict · scalar dim-read Warning text

Problem

PHP 8.3+ shortened Trying to access array offset on value of type T → Trying to access array offset on T (and for bools, true/false not bool). #30028 fixed the resource case; other scalars still use the pre-8.3 wording under PHP_COMPILER_PROFILE≥8.3.

Probed 2026-08-11 — php:8.4-cli 8.4.24 vs PHP_COMPILER_PROFILE=8.4.

Repro Zend 8.4.24 VM / JIT
$a=false; var_export($a[0]); Warning … on false Warning … on value of type bool
$a=true; … … on true … on value of type bool
$a=1; … … on int … on value of type int
$a=1.5; … … on float … on value of type float
$a=null; … … on null … on value of type null

php-src reference

PHP implementation target

  • lib/VM/ErrorReporter.php — arrayOffsetOnNonContainerMessage() / PROFILE≥8.3 branch (same pattern as arrayOffsetOnResourceMessage)
  • Pass true/false (not bool) for boolean containers
  • JIT helpers that share the message (lib/VM/ScalarDimFetchJitHelper.php etc.)
  • PHP-in-PHP; no new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
export PHP_COMPILER_PROFILE=8.4
printf "%s\n" "<?php
\$a=false;
var_export(\$a[0]);
echo PHP_EOL;
" >/tmp/dim_false.php
php -d error_reporting=E_ALL -d display_errors=1 bin/vm.php /tmp/dim_false.php
php -d error_reporting=E_ALL -d display_errors=1 bin/jit.php /tmp/dim_false.php
'

Done when

Activity

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

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions