« first day (1500 days earlier)      last day (3442 days later) » 

2:00 PM
@Ja͢ck i am not sure, i am looking to understand why . The plugin i used gave this result : The character = was found unencoded in the result page
 
If escaping is properly done, it shouldn't happen .. so the question is what's being used instead.
If anything, it's a sign of something suspicious.
 
A = could be an XSS vuln if you didn't quote the attribute
but that would be silly anyway
 
2:14 PM
Good morning!
 
@Ja͢ck after running the test , i found this value in the field in question 1545126541616=
 
Morning @AustinBurk
 
I've had this old piece of PHP filling my error logs for months now, it seems to have to do with cURL error handling, but I can't test it myself because it needs valid traffic...
http://pastebin.com/T64VtX0E
[Mon Nov 24 08:16:03 2014] [error] [client 23.235.47.30] PHP Notice: Undefined variable: ch in /home/www/lib/functions/function.getFSIDfromHatena.php on line 54
[Mon Nov 24 08:16:03 2014] [error] [client 23.235.47.30] PHP Warning: curl_close() expects parameter 1 to be resource, null given in /home/www/lib/functions/function.getFSIDfromHatena.php on line 54
It's really quite old - it makes me wince when I read through it.
 
@AustinBurk the notice/warning looks pretty obvious, but maybe they are not?
 
@AustinBurk I think that code runs after the function definition ...
i.e. the documentation is wrong.
which is why you should never document your code anyway ;p
 
2:19 PM
@Ja͢ck //sigh//
I don't want to touch it because it's a vital component, but the error logs just kill me
 
@Ja͢ck a quick copy paste into a editor confirms this.
correcto
 
Hey, I just counted your curly braces; it should be me doing the sighing.
 
(try counting it again =] )
 
@AustinBurk fixing that will not break anything. At worst, just comment out the offending line
curl_close() as the last line of a function is redundant anyway if the curl handle is about to go out of scope
 
@DaveRandom yeah just noticed it :P
 
2:22 PM
Shouldn't cost you more than a few million $$$
 
:D
 
Oh hey, I moved the line above the curly bracket and the errors seem to have stopped
 
How about that.
 
I hope you at least understood some of it so it was kinda worth it
 
Makes sense too, curl's gotta stick together.
 
2:23 PM
@PeeHaa I think so :P
 
No I was just listening you your jeans I think
 
I'll be back, I have a lot of work to do today :P
 
So totally worth it right?
 
No time for PHP today, I'm too busy being mesmerised by my bread making machine \o/
 
Nowww to design a user notification/mail system :|
Can't be tooo hard, can it? <famous last words>
@Ja͢ck Oooh, very nice.
 
2:28 PM
A notification system that doesn't send any notifications is easy to make.
 
@Ja͢ck *make->fake
 
Good morning
 
@ircmaxell Good morning!
 
@LeviMorrison I thought of the definitive reason to not use prefix return types
if we ever want to type callbacks, it becomes REALLY hard to mentally parse with prefix, but trivial with suffex
 
2:44 PM
@ircmaxell it's a bit ugly in both cases tho
for params that is, as they use prefix types
having postfix everything would've been nicer :)
 
function int foo(int $bar);
function int callable(float) foo2(int $bar);
function int callable(int) callable(float) foo3(int $bar);

vs

function foo(int) : int;
function foo(int) : callable(float) : int
function foo(int) : callable(float) : callable(int) : int
 
but yeah, that's a good point for sure
 
@NikiC sure
 
hack actually uses function(float) : int syntax, so that would be even weirder
You'd have function int function(int) foo(int $bar) :D
 
...what.
 
2:47 PM
yeah, I don't care if it's function(float) or callable(float). Though I do prefer callable slightly, since it can be a method, instance method, static, function, etc
 
yeah, and it's already used for sigless callable hints, so makes sense to keep using it for that as well
 
yeah
and as long as we don't have first-class functions, where callables can be strings, I do prefer callable as it's more descriptive of what's going on
7 messages moved to bin
 
^ good call
 
3:02 PM
If it was about boobs, it totally wouldn't have been moved...
 
posted on November 24, 2014 by kbironneau

/* by Nekeniehl */

 
@salathe coughcoughbooleans
 
*doesn't "get" it*
 
For function types, you could always force declaration of them:
delegate foo (int $a): int;
delegate bar (int $b): int;

function qux(foo $foo) : bar {
    return function (int $b) use ($foo): int {
        return $foo($b + 1);
    };
}

$f = qux(function ($a): int {
    return $a + 1;
});

$f(1); // 3
I may have made that example more complicated than necessary
 
3:10 PM
yeah, create external types (like a type definition system)
 
^^
Anonymous callable signatures, as parameter/return types, would be nice, but the syntax gets borky fast
I guess as long as declared is supported too, then it doesn't matter if someone want's to write pudding with a cannon
 
I don't think the suffix notation is that wonky
 
function f($a, $b) : callable($c) {
    return function ($c) use ($a, $b) {
        return $a + $b - $c;
    };
};

$g = f(1, 2);

$g(3) // 0
^^ not bad, but it depends on the signature complexity. and parameters will be borky regardless.
 
true, but it puts all the information you need right in front of you
 
function qux(callable(int $a): int $foo) : callable(int $b): int {
    return function (int $b) use ($foo): int {
        return $foo($b + 1);
    };
}
^^ Pretty contrived example, and still hard to read.
 
3:15 PM
I think that's as easy to read as you're going to get really
 
Well, predeclared is easiest. Just jump to the decl.
 
without having structural typing that is
 
What I'm proposing isn't exactly structural typing though, no?
 
b
 
3:17 PM
@AustinBurk boobleans ?
 
@DanLugg no, but structural typing would negate the need for it (it's a super-set)
 
....
exit(); //I'm done
 
@ircmaxell When you say structural typing, are you referring to your withdrawn RFC as an implementation?
 
similar
 
Okay, because IIRC yours would require functors to adhere to an interface
Which is... almost possible, kinda now.
 
3:20 PM
> function qux(callable(int $a): int $foo) : callable(int $b): int {
serious ?
 
interface MyCallable {
    function __invoke($all, $the, $things);
}
^^ but now you need to implement it :-S
 
Function types! :D
Hack's system isn't bad.
 
$f = function ($all, $the, $things) implements MyCallable { };
 
if I can't see what it says at a glance then I'm not interested
 
@JoeWatkins yes
 
3:22 PM
omg
I love PHP
 
@JoeWatkins I'm not a fan of this, however I think anonymous signature types would be helpful in simpler cases such as returning a callable ($x): int
As in the contrived example ^^
 
@JoeWatkins to me, that's completely glancable
 
you surely mean SomeClass, or array, or callable ..
it isn't to me
 
Actually, with named defs and anonymous defs, there's have to be some sort of structural typing supported there anyway (to make it reasonable to use)
 
3:24 PM
function foo_closure(string $adder_str): (function (string): int) {
  return function($to_str) use ($adder_str) {
    return strlen($to_str) + strlen($adder_str);
  };
}
I don't think that looks half-bad.
 
@AndreaFaulds Yea, but if the signature of the callbacks is any more complicated (or exists as a parameter type) it gets hard to read.
 
<?hh

// Completely contrived

function f1((function(int, int): string) $x): string {
  return $x(2,3);
}

function f2(): string {
  $c = function(int $n, int $m): string {
    $r = '';
    for ($i=0; $i<$n+$m; $i++) {
      $r .= "hi";
    }
    return $r;
  };
  return f1($c);
}
@DanLugg Add whitespace, I'd suggest.
 
lol, fair enough. I think supporting both named and anonymous function types would be helpful
 
@DanLugg In a non-curried language like PHP, there's only so readable it can get ^^
Haskell's type declarations for functions can be beautiful
 
delegate f(long $and, complicated $delegate, signature $here);

function g(f $f) : callable($x) {
    // ...
    return function ($x) { };
};
 
3:27 PM
sort :: (Ord a) => [a] -> (a -> a -> Ordering) -> [a] for instance
 
^^ supporting both.
 
The equivalent in PHP to that definition of sort would be like this:
 
@DanLugg I like that, ish ... I like it better that all that junk in the signature ...
 
^^ that's my thinking.
 
3:29 PM
class Sorter<Comparable A> { public function sort(List<A>, (function(A, A) : Ordering)) : List<A>; }
@DanLugg Hack has type aliases: docs.hhvm.com/manual/en/hack.typealiasing.php e.g. type MyFoo = Bar;
 
....I've gotten almost nothing done today
 
@AndreaFaulds Not sure how that'd work here, aside from type MyDelegate = function (...);
 
@DanLugg Exactly
 
lol oh, okay :-P
 
But this is more general and IMO more intuitive, you can alias any type this way
It'd like a C typedef
 
3:32 PM
True. I'm not personally too finicky about the definition/aliasing syntax, just so long as there is support for named.
 
@AustinBurk howcome?
 
Whether it's globbed into a robust solution or rolled one-off.
 
what's the nicest way for delegates to work do we think ...
 
@JoeWatkins define "work" :-P
 
Haskell: sort :: (Ord a) => [a] -> (a -> a -> Ordering) -> [a]
 
3:33 PM
well ...
delegate f(long $and, complicated $delegate, signature $here);

function g(f $f) : callable($x) {
    // ...
    return function ($x) { };
};
 
(hypothetical) Hack: function sort<Comparable A>(List<A>, (function(A, A) : Ordering)) : List<A>;
Which would you rather use?
 
@AndreaFaulds Hack, because it ain't Haskell :-P
 
@DanLugg Haskell is wonderful
 
I know, I just haven't the time nor the purpose to learn it at the moment.
 
Aha
I was almost bang on for the type definition of sortBy! hackage.haskell.org/package/base-4.7.0.1/docs/…
 
3:35 PM
how does the executor know that f is a delegate and not a class type ... where are delegates stored, would function g(delegate f $f) be acceptable ... I mean how would it actually work, is a delegate a class or function entry and how do we glue it all together so that it's not stupid and doesn't cost anyone not using it ...
 
sortBy :: (a -> a -> Ordering) -> [a] -> [a] - a doesn't need to be comparable as you're using a custom sort function
 
function recursiveMapper(array $data, parent_function $func = null);
 
@JoeWatkins Same table as class defs, IMO. Let there be collisions.
 
sort :: Ord a => [a] -> [a] - here a does need to be comparable as you're not using a custom sort function
 
how would you reference parent_function
 
3:36 PM
@DanLugg Merge ALL THE SYMBOL TABLES!
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@LeviMorrison ^^
 
@DanLugg well same table means you can't have collisions ...
 
@JoeWatkins GOOD
 
@JoeWatkins Let there be collisions that result in error :-P
 
3:37 PM
@Naruto Internet
 
it also means storing an actual class entry, which is rather too large for what we require for a delegate ... (because dtor set for classes on that table)
 
AND HE SAID! UNTO THE WORLD! LET! THERE! BE! COLLISIONS! ...in all the symbol tables
3
 
I don't need to have a constant named Bar, a function named Bar, a class named Bar, a class method named Bar, a class property named Bar, a variable named Bar...
 
@JoeWatkins Or storing type information in the first int field
 
well okay, but it still means allocating a bunch of stuff that we don't need, property tables and whatever ...
 
3:39 PM
Not really
Make the class table be a zend_type table, where zend_type is a union of zend_class_entry, zend_type_alias
To avoid storing additional data, make zend_class_entry and zend_type_alias have a common first member specifying the type
 
that complicates everything looking up classes everywhere
 
@JoeWatkins Only where we do direct lookups, which shouldn't be in that many places
@DanLugg You forgot case-insensitive constants
 
it would also effect, indirectly, anyone using api function to lookup class ...
 
@JoeWatkins Nope.
 
3:41 PM
@AndreaFaulds I said my face hurts already, I don't want a brain injury
 
Has someone a good suggestion: I have to change dates and body text from a ICS file I can do that with sublime save it and it's working but isn't there a good UI program out there to do that?
 
@AndreaFaulds ?
 
@JoeWatkins API functions wouldn't change their interface nor behaviour...
 
of course not, but zend_lookup_class_ex would still need to have another condition to check if it found a class or delegate
 
That's true, sure.
 
3:44 PM
that's an extremely high frequency function
why are parens necessary in hack syntax ?
: (function (some $thing)) ?
 
reduce (visual) ambiguity
 
(reduce (visual) ambiguity)
 
Morning 2x
 
something like that might be quite simple ... but I like delegate (they're prototypes really) better ... I think I see a tidy way to do the hack like one though ...
it's a shame that all these kinds of changes can only ever slow us down ... it's reasonable to have that kind of feature in hack, it's a compiled language, such information is or might be valuable to an optmizer, but we can get absolutely nothing but bloat from adding things like this, while I like it, I dunno if any of it are really good ideas ...
 
lispification (lisp·i·fi·ca·tion) /lispəfəˈkāSH(ə)n/ -- to overuse the fuck outta parentheses.
 
3:51 PM
5:10 Yes:No
Aaaaaargh
 
yeah not looking hopeful ...
 
@AndreaFaulds Given your body definition, the Sorter class doesn't need to be a generic; just the sort method.
 
Only some of these people have said their reasons, too.
@LeviMorrison Yes, I later made a generic function variant
@LeviMorrison I made it a class so the method could be generic
 
You don't need a class to make methods generic ^^
 
@LeviMorrison Right.
 
3:53 PM
@AndreaFaulds should be getting used to that now ...
 
(Actually, you need a class to have methods at all; what I meant was that a method could be generic - it doesn't have to be the class)
 
@JoeWatkins Yeah...
If you haven't yet voted, please vote! wiki.php.net/rfc/safe_cast#vote /broken_record
 
@AndreaFaulds Still only 15 votes.
:/
 
I'm hoping 6 more Yes votes, but it'll never happen
@LeviMorrison Yeah :/
 
type Delegate1<T, U, V> = function (T $t, U $u, V $v);
type Delegate2<T, U>    = Delegate1<T, U, int>;
type Delegate3<T>       = Delegate2<T, int>;
type Delegate4          = Delegate3<int>;
^^ Could get bizarre and interesting
 
3:55 PM
@DanLugg no
 
Ay, I like thinking outside the box. Even if it's cold and scary and nobody wants to come with :-P
 

« first day (1500 days earlier)      last day (3442 days later) »