I hereby claim:
- I am ircmaxell on github.
- I am ircmaxell (https://keybase.io/ircmaxell) on keybase.
- I have a public key whose fingerprint is D620 2127 D88F 66C2 10A3 BFEB 6A7C A4E4 A190 DC6B
To claim this, I am signing this object:
<?php | |
declare(ticks=1); | |
$__stack = []; | |
function getArrayKey(array $haystack, $needle) { | |
return isset($haystack[$needle]) ? $haystack[$needle] : ''; | |
} |
I hereby claim:
To claim this, I am signing this object:
<?php | |
class HashCipher { | |
protected $hash = 'sha512'; | |
protected $hashLen = 64; | |
protected $rounds = 16; | |
public function __construct($hash, $rounds = 16) { | |
$this->hash = $hash; | |
// run a test hash, to get the proper hash length |
<?hh | |
class B { | |
public function doB() : string { | |
return "b"; | |
} | |
} | |
class C extends B { | |
public function doC() : string { |
<?php | |
class a { | |
const a = b::c; | |
const b = b::d; | |
} |
interface Foo1 { | |
public function bar() | |
} | |
interface Foo2 { | |
public function bar() | |
} | |
interface Foo3 { | |
public function bar() |
<?php | |
function ackersum($a, $b) { | |
if ($a == 0) { | |
return $b; | |
} elseif ($b == 0) { | |
return $a; | |
} elseif ($a == 1) { | |
return $b + 1; | |
} |
<?php | |
define('CRYPT_SALT_LEN_MAX', 16); | |
define('CRYPT_ROUNDS_DEFAULT', 5000); | |
/** | |
* A PHP shim for crypt sha256 and sha512 | |
* to workaround bug 62372 | |
* @see https://bugs.php.net/bug.php?id=62372 | |
*/ |
13:11 <ajf> I’m mostly happy with it as-is, but given that I made int/float/numeric/string not accept NULL, I think booleans shouldn’t be accepted for them either. | |
13:19 → arty joined ⇐ DaveRand quit | |
13:49 → sonotos and lonnylot joined ⇐ dmitry and RemiFedor quit | |
14:41 <ircmaxell> ajf: that sounds sane (consistency wise). So it means that `int/float/numeric` only accept int/float/valid-number-string, and string only accepts string/int/float | |
14:43 <ajf> ircmaxell: Yeah | |
14:43 <ajf> Also, we don’t accept int/float/string for bool, so we shouldn’t accept bool for int/float/string | |
14:43 <ircmaxell> yeah, makes perfect sense | |
14:44 <ajf> Another point someone raised was that FALSE is a common error value alongside NULL. | |
14:44 <ajf> So, should I go ahead and amend the patch and RFC to do that? | |
14:44 <ircmaxell> I think that's the direction we're going, so that's valid |
<?php | |
/** | |
* @param int | |
* @param int | |
* @return int | |
*/ | |
function foo($a, $b) { | |
$c = 0; | |
if ($a) { |