xref: /PHP-7.4/ext/opcache/tests/opt/sccp_022.phpt (revision 12edc453)
1--TEST--
2SCCP 022: Invailid types
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.opt_debug_level=0x20000
8opcache.preload=
9--SKIPIF--
10<?php require_once('skipif.inc'); ?>
11--FILE--
12<?php
13function foo(int $x) {
14	$a[0] = $x;
15	$a[1] = 5;
16	echo $a[1];
17	$a->foo = 5;
18	echo $a[1];
19}
20?>
21--EXPECTF--
22$_main: ; (lines=1, args=0, vars=0, tmps=0)
23    ; (after optimizer)
24    ; %ssccp_022.php:1-10
25L0 (10):    RETURN int(1)
26
27foo: ; (lines=11, args=1, vars=2, tmps=1)
28    ; (after optimizer)
29    ; %ssccp_022.php:2-8
30L0 (2):     CV0($x) = RECV 1
31L1 (3):     ASSIGN_DIM CV1($a) int(0)
32L2 (3):     OP_DATA CV0($x)
33L3 (4):     ASSIGN_DIM CV1($a) int(1)
34L4 (4):     OP_DATA int(5)
35L5 (5):     ECHO int(5)
36L6 (6):     ASSIGN_OBJ CV1($a) string("foo")
37L7 (6):     OP_DATA int(5)
38L8 (7):     T2 = FETCH_DIM_R CV1($a) int(1)
39L9 (7):     ECHO T2
40L10 (8):    RETURN null
41