"Fossies" - the Fresh Open Source Software Archive

Member "4.6.1/composer/pimple/pimple/ext/pimple/tests/018.phpt" (8 Apr 2021, 403 Bytes) of package /linux/www/studip-4.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 Test register()
    3 --SKIPIF--
    4 <?php if (!extension_loaded("pimple")) print "skip"; ?>
    5 --FILE--
    6 <?php
    7 
    8 class Foo implements Pimple\ServiceProviderInterface
    9 {
   10     public function register(Pimple\Container $p)
   11     {
   12         var_dump($p);
   13     }
   14 }
   15 
   16 $p = new Pimple\Container();
   17 $p->register(new Foo, array(42 => 'bar'));
   18 
   19 var_dump($p[42]);
   20 --EXPECTF--
   21 object(Pimple\Container)#1 (0) {
   22 }
   23 string(3) "bar"