"Fossies" - the Fresh Open Source Software Archive

Member "forkcms/vendor/pimple/pimple/ext/pimple/tests/001.phpt" (5 Dec 2019, 598 Bytes) of package /linux/www/forkcms-5.7.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 Test for read_dim/write_dim handlers
    3 --SKIPIF--
    4 <?php if (!extension_loaded("pimple")) print "skip"; ?>
    5 --FILE--
    6 <?php 
    7 $p = new Pimple\Container();
    8 $p[42] = 'foo';
    9 $p['foo'] = 42;
   10 
   11 echo $p[42];
   12 echo "\n";
   13 echo $p['foo'];
   14 echo "\n";
   15 try {
   16 	var_dump($p['nonexistant']);
   17 	echo "Exception excpected";
   18 } catch (InvalidArgumentException $e) { }
   19 
   20 $p[54.2] = 'foo2';
   21 echo $p[54];
   22 echo "\n";
   23 $p[242.99] = 'foo99';
   24 echo $p[242];
   25 
   26 echo "\n";
   27 
   28 $p[5] = 'bar';
   29 $p[5] = 'baz';
   30 echo $p[5];
   31 
   32 echo "\n";
   33 
   34 $p['str'] = 'str';
   35 $p['str'] = 'strstr';
   36 echo $p['str'];
   37 ?>
   38 
   39 --EXPECTF--
   40 foo
   41 42
   42 foo2
   43 foo99
   44 baz
   45 strstr