Arquivos
hhvm/hphp/test/quick/array_string_key.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

35 linhas
531 B
PHP

<?php
// test CGetM
$a = array();
$a[0] = "one";
echo $a["0"] . "\n";
// test SetM
$a = array();
$a["0"] = "two";
echo $a[0] . "\n";
// test IssetM
$a = array("narf");
echo isset($a["0"]) . "\n";
// test UnsetM
$a = array();
$a[0] = "uh oh";
unset($a["0"]);
echo count($a) . "\n";
// make sure normal strings work
$a = array();
$a["not an int"] = "woo";
echo $a["not an int"] . "\n";
// it has to be strictly an integer
$a = array();
$a[0] = "hoo!";
$a["00"] = "this is different";
$a["0 "] = "and this";
echo $a[0] . "\n";