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
Category
Language· php-src-strict · scalar dim-read Warning textProblem
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/falsenotbool).#30028fixed the resource case; other scalars still use the pre-8.3 wording underPHP_COMPILER_PROFILE≥8.3.Probed 2026-08-11 —
php:8.4-cli8.4.24 vsPHP_COMPILER_PROFILE=8.4.$a=false; var_export($a[0]);… on false… 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 nullphp-src reference
Zend/zend_execute.c—ZEND_FETCH_DIM_Rscalar WarningPHP implementation target
lib/VM/ErrorReporter.php—arrayOffsetOnNonContainerMessage()/ PROFILE≥8.3 branch (same pattern asarrayOffsetOnResourceMessage)true/false(notbool) for boolean containerslib/VM/ScalarDimFetchJitHelper.phpetc.)runtime/*.cRepro
Done when
value of type …if that was prior behavioron resource.phptundertest/compliance/cases/