1--TEST-- 2using different variables to access boolean offsets 3--FILE-- 4<?php 5 6$bool = TRUE; 7 8var_dump($bool[1]); 9var_dump($bool[0.0836]); 10var_dump($bool[NULL]); 11var_dump($bool["run away"]); 12 13var_dump($bool[TRUE]); 14var_dump($bool[FALSE]); 15 16$fp = fopen(__FILE__, "r"); 17var_dump($bool[$fp]); 18 19$obj = new stdClass; 20var_dump($bool[$obj]); 21 22$arr = Array(1,2,3); 23var_dump($bool[$arr]); 24 25echo "Done\n"; 26?> 27--EXPECTF-- 28Warning: Trying to access array offset on true in %s on line %d 29NULL 30 31Warning: Trying to access array offset on true in %s on line %d 32NULL 33 34Warning: Trying to access array offset on true in %s on line %d 35NULL 36 37Warning: Trying to access array offset on true in %s on line %d 38NULL 39 40Warning: Trying to access array offset on true in %s on line %d 41NULL 42 43Warning: Trying to access array offset on true in %s on line %d 44NULL 45 46Warning: Trying to access array offset on true in %s on line %d 47NULL 48 49Warning: Trying to access array offset on true in %s on line %d 50NULL 51 52Warning: Trying to access array offset on true in %s on line %d 53NULL 54Done 55