"Fossies" - the Fresh Open Source Software Archive

Member "4.6.1/composer/pimple/pimple/ext/pimple/tests/011.phpt" (8 Apr 2021, 416 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 service callback throwing an exception
    3 --SKIPIF--
    4 <?php if (!extension_loaded("pimple")) print "skip"; ?>
    5 --FILE--
    6 <?php
    7 class CallBackException extends RuntimeException { }
    8 
    9 $p = new Pimple\Container();
   10 $p['foo'] = function () { throw new CallBackException; };
   11 try {
   12     echo $p['foo'] . "\n";
   13     echo "should not come here";
   14 } catch (CallBackException $e) {
   15     echo "all right!";
   16 }
   17 ?>
   18 --EXPECTF--
   19 all right!