cvs: ZendEngine2 /tests isset_001.phpt isset_002.phpt isset_003.phpt

[email protected] ("Felipe Pena")
Newsgroups php.zend-engine.cvs
Message-ID <cvsfelipe1210342311@cvsserver>
felipe		Fri May  9 14:11:51 2008 UTC

  Added files:                 
    /ZendEngine2/tests	isset_001.phpt isset_002.phpt isset_003.phpt 
  Log:
  - New tests
  
  

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/isset_001.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/isset_001.phpt
+++ ZendEngine2/tests/isset_001.phpt
--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

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/isset_002.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/isset_002.phpt
+++ ZendEngine2/tests/isset_002.phpt
--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)

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/isset_003.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/isset_003.phpt
+++ ZendEngine2/tests/isset_003.phpt
--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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.