diff options
author | Urban Müller | 2017-01-25 16:07:50 +0100 |
---|---|---|
committer | Urban Müller | 2017-01-25 16:08:40 +0100 |
commit | ee8607940a1af96f2366ad4ea75db5b7c2c15c8f (patch) | |
tree | 2ad7aaa27266b0700ae8e2e4bbc29fd82c0e689e | |
parent | f59a46a6dfe0194ba43092304029b2b843ed54bc (diff) | |
download | itools-ee8607940a1af96f2366ad4ea75db5b7c2c15c8f.tar.gz itools-ee8607940a1af96f2366ad4ea75db5b7c2c15c8f.tar.bz2 itools-ee8607940a1af96f2366ad4ea75db5b7c2c15c8f.zip |
standard php compatibility
-rw-r--r-- | it.class | 12 | ||||
-rwxr-xr-x | tests/it.t | 6 |
2 files changed, 3 insertions, 15 deletions
@@ -1086,16 +1086,4 @@ static function mod($a, $n) return (($a % $n) + $n) % $n; } -/** - * Same as php tempnam() but $dir defaults to tmp/ in service home - */ -static function tempnam($dir, $prefix) -{ - $dir = $dir ?: $GLOBALS['ULTRAHOME'] . "/tmp"; - if (!is_writable($dir)) - it::error("tempnam: '$dir' not writable"); - - return tempnam($dir, $prefix); -} - } @@ -420,6 +420,6 @@ is(it::map(function($k, $v) {return 5*$k+$v;}, array(0 => 1, 1 => 2)), array(1, is(it::map('strlen', array("aaa", "aa")), array(3, 2)); is(it::map('it::ucfirst', array("aaa")), array("Aaa")); # Only map selected keys -is(it::map('2*$v', [3, 4, 5], 'keys' => '0,1'), [6, 8, 5]); -is(it::map('2*$v', [3, 4, 5], 'keys' => [0,1]), [6, 8, 5]); -is(it::map('2*$v', ['foo' => 1, 'bar' => 2], 'keys' => 'foo'), ['foo' => 2, 'bar' =>2]); +is(it::map('2*$v', [3, 4, 5], ['keys' => '0,1']), [6, 8, 5]); +is(it::map('2*$v', [3, 4, 5], ['keys' => [0,1]]), [6, 8, 5]); +is(it::map('2*$v', ['foo' => 1, 'bar' => 2], ['keys' => 'foo']), ['foo' => 2, 'bar' =>2]); |