1--TEST-- 2Statics in nested functions & evals. 3--FILE-- 4<?php 5 6static $a = array(7,8,9); 7 8function f1() { 9 static $a = array(1,2,3); 10 11 function g1() { 12 static $a = array(4,5,6); 13 var_dump($a); 14 } 15 16 var_dump($a); 17 18} 19 20f1(); 21g1(); 22var_dump($a); 23 24eval(' static $b = array(10,11,12); '); 25 26function f2() { 27 eval(' static $b = array(1,2,3); '); 28 29 function g2a() { 30 eval(' static $b = array(4,5,6); '); 31 var_dump($b); 32 } 33 34 eval('function g2b() { static $b = array(7, 8, 9); var_dump($b); } '); 35 var_dump($b); 36} 37 38f2(); 39g2a(); 40g2b(); 41var_dump($b); 42 43 44eval(' function f3() { static $c = array(1,2,3); var_dump($c); }'); 45f3(); 46 47?> 48--EXPECTF-- 49array(3) { 50 [0]=> 51 int(1) 52 [1]=> 53 int(2) 54 [2]=> 55 int(3) 56} 57array(3) { 58 [0]=> 59 int(4) 60 [1]=> 61 int(5) 62 [2]=> 63 int(6) 64} 65array(3) { 66 [0]=> 67 int(7) 68 [1]=> 69 int(8) 70 [2]=> 71 int(9) 72} 73array(3) { 74 [0]=> 75 int(1) 76 [1]=> 77 int(2) 78 [2]=> 79 int(3) 80} 81array(3) { 82 [0]=> 83 int(4) 84 [1]=> 85 int(5) 86 [2]=> 87 int(6) 88} 89array(3) { 90 [0]=> 91 int(7) 92 [1]=> 93 int(8) 94 [2]=> 95 int(9) 96} 97array(3) { 98 [0]=> 99 int(10) 100 [1]=> 101 int(11) 102 [2]=> 103 int(12) 104} 105array(3) { 106 [0]=> 107 int(1) 108 [1]=> 109 int(2) 110 [2]=> 111 int(3) 112} 113