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