1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

- New tests

This commit is contained in:
Felipe Pena
2008-05-09 14:16:24 +00:00
parent d88eb15159
commit bcccfa6bf1
3 changed files with 76 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Testing isset and unset with variable variables
--FILE--
<?php
print "- isset ---\n";
$var_name = 'unexisting';
if (isset($$var_name)) {
print "error\n";
}
$test = 'var_name';
if (isset($$$test)) {
print "error\n";
}
print "- unset ---\n";
unset($$var_name);
unset($$$test);
print "done\n";
?>
--EXPECT--
- isset ---
- unset ---
done
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Testing isset with several undefined variables as argument
--FILE--
<?php
var_dump(isset($a, ${$b}, $$c, $$$$d, $e[$f->g]->d));
?>
--EXPECT--
bool(false)
+34
View File
@@ -0,0 +1,34 @@
--TEST--
Testing isset accessing undefined array itens and properties
--FILE--
<?php
$a = 'foo';
$b =& $a;
var_dump(isset($b));
var_dump(isset($a[0], $b[1]));
var_dump(isset($a[0]->a));
var_dump(isset($c[0][1][2]->a->b->c->d));
var_dump(isset(${$a}->{$b->$c[$d]}));
var_dump(isset($GLOBALS));
var_dump(isset($GLOBALS[1]));
var_dump(isset($GLOBALS[1]->$GLOBALS));
?>
--EXPECT--
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
bool(false)