PHP Classes

File: vendor/pimple/pimple/ext/pimple/tests/014.phpt

Recommend this page to a friend!
  Classes of Gavin Gordon Markowski  >  Helphp PHP Class Generator  >  vendor/pimple/pimple/ext/pimple/tests/014.phpt  >  Download  
File: vendor/pimple/pimple/ext/pimple/tests/014.phpt
Role: Example script
Content type: text/plain
Description: Example script
Class: Helphp PHP Class Generator
Generate classes from configuration parameters
Author: By
Last change:
Date: 4 months ago
Size: 520 bytes
 

Contents

Class file image Download
--TEST--
Test raw()
--SKIPIF--
<?php if (!extension_loaded("pimple")) print "skip"; ?>
--FILE--
<?php

$p
= new Pimple\Container();
$f = function () { var_dump('called-2'); return 'ret-2'; };

$p['foo'] = $f;
$p[42] = $f;

var_dump($p['foo']);
var_dump($p->raw('foo'));
var_dump($p[42]);

unset(
$p['foo']);

try {
   
$p->raw('foo');
    echo
"expected exception";
} catch (
InvalidArgumentException $e) { }
--
EXPECTF--
string(8) "called-2"
string(5) "ret-2"
object(Closure)#%i (0) {
}
string(8) "called-2"
string(5) "ret-2"

For more information send a message to info at phpclasses dot org.