1--TEST-- 2SCCP 002: Conditional Constant Propagation of non-escaping array elements 3--INI-- 4opcache.enable=1 5opcache.enable_cli=1 6opcache.optimization_level=-1 7opcache.opt_debug_level=0x20000 8opcache.preload= 9zend_test.observer.enabled=0 10--EXTENSIONS-- 11opcache 12--FILE-- 13<?php 14function foo(int $x) { 15 $a = [$x]; 16 $i = 1; 17 $c = $i < 2; 18 if ($c) { 19 $k = 2 * $i; 20 $a[$k] = $i; 21 echo $a[$k]; 22 } 23 echo $a[2]; 24} 25?> 26--EXPECTF-- 27$_main: 28 ; (lines=1, args=0, vars=0, tmps=0) 29 ; (after optimizer) 30 ; %ssccp_002.php:1-14 310000 RETURN int(1) 32 33foo: 34 ; (lines=4, args=1, vars=1, tmps=0) 35 ; (after optimizer) 36 ; %ssccp_002.php:2-12 370000 CV0($x) = RECV 1 380001 ECHO string("1") 390002 ECHO string("1") 400003 RETURN null 41