xref: /PHP-7.0/ext/opcache/tests/bug70423.phpt (revision b9155b85)
1--TEST--
2Bug #70423 Warning Internal error: wrong size calculation
3--INI--
4open_basedir=.
5opcache.enabled=1
6opcache.enable_cli=1
7opcache.log_verbosity_level=2
8--FILE--
9<?php
10
11/* forked from Zend\tests\bug53958.phpt */
12
13
14// TEST 1
15$a = 1;
16$fn1 = function() use ($a) {echo "$a\n"; $a++;};
17$fn2 = function() use ($a) {echo "$a\n"; $a++;};
18$a = 5;
19$fn1(); // 1
20$fn2(); // 1
21$fn1(); // 1
22$fn2(); // 1
23
24// TEST 2
25$b = 1;
26$fn1 = function() use (&$b) {echo "$b\n"; $b++;};
27$fn2 = function() use (&$b) {echo "$b\n"; $b++;};
28$b = 5;
29$fn1(); // 5
30$fn2(); // 6
31$fn1(); // 7
32$fn2(); // 8
33
34// TEST 3
35$c = 1;
36$fn1 = function() use (&$c) {echo "$c\n"; $c++;};
37$fn2 = function() use ($c) {echo "$c\n"; $c++;};
38$c = 5;
39$fn1(); // 5
40$fn2(); // 1
41$fn1(); // 6
42$fn2(); // 1
43
44// TEST 4
45$d = 1;
46$fn1 = function() use ($d) {echo "$d\n"; $d++;};
47$fn2 = function() use (&$d) {echo "$d\n"; $d++;};
48$d = 5;
49$fn1(); // 1
50$fn2(); // 5
51$fn1(); // 1
52$fn2(); // 6
53?>
54--EXPECT--
551
561
571
581
595
606
617
628
635
641
656
661
671
685
691
706
71