« first day (2385 days earlier)      last day (2559 days later) » 

6:00 PM
yo
 
o/ Joe evenin
 
Wes
o/
 
room topic changed to PHP: Mostly just telling @DaveRandom to work on amp/dns,.interspersed with occasional PHP-related conversations. [php]
 
6:15 PM
lol
 
Anonymous
@Wes how's that logo going?
 
@DaveRandom your punctuation is as bad as your work ethic :P
 
god damn it
room topic changed to PHP: Support group for those afflicted with PHP. Don't ask to ask, just ask. Username auto complete is *tab, not enter. Chat Guidelines : guide.room11.org [php]*
 
Anonymous
@Linus He's getting right into the point.
 
Anonymous
6:21 PM
:)
 
@Trowski What do we do with cancelling of ReadableStream?
 
:)
 
\o
 
the higher ups decided to open source our big climate study platform
 
6:26 PM
We get to see your code now ;)
 
Not sure how I feel. On one hand, it's pretty awesome. On the other hand, you get to see the mess I do now :D ^^
 
@FélixGagnon-Grenier It's somebody elses fault, though.
 
always, of course!
 
It's @PeeHaa's fault
!!blame @PeeHaa
 
@Jimbo printf() failed, check your format string and arguments
 
6:32 PM
ahha
 
Goddamit Dave
!!dave
 
@DaveRandom should work on DNS lib.
 
when the fault image is not even there anymore
 
He's just not using it right
 
3 messages moved to Trash
 
6:35 PM
@DaveRandom how is "right"?
 
Show me a github repo with (currently) failing travis build
!!help
 
Built-in commands (* indicates admin-only):
 admin - Manage the bot's admin list. Use 'admin help' for details.
 *alias - Add a bash-style alias
 *approve - Approve the bot for talking in this room. Room owners only.
 *ban - Ban a user from interacting with the bot for a specified period of time
 command - Manage command mappings. Use 'command help' for details.
 help - Alias of 'command list'
 invite - Invite the bot to join a room. This can also be done through the chat web interface.
 *leave - Ask the bot to leave the room. Room owners only.
 
@kelunik Cancelling?
 
holy shit. you guys actually worked.
 
@Trowski he means closing
 
6:40 PM
!!blame PeeHaa
 
@kelunik Closing would probably vary from stream to stream, ranging from "I don't care" which would just ignore further bytes, to closing a socket or file handle.
 
Jon Skeet' credit cards have no limit. Last weekend, he maxed them out.
 
@Jimbo it doesn't work like that, you give it github repo slugs
(case sensitive)
 
Ahh
 
6:41 PM
(and only makes sense for repos with currently failing builds)
 
3 messages moved to Trash
 
!!caniuse blame
 
No, I don't recommend using blame, have you tried using a hammer instead?
 
@kelunik Thanks!
Is this (github.com/sebastianbergmann/global-state/blob/…) still the best/correct/only way to check whether an object is serializable?
 
6:54 PM
Do all serializable internal classes implement Serializable?
 
Wes
@DaveRandom no
 
A lot implement __wakeup
 
Wes
god what a mess
 
So if they implement __sleep and __wakeup methods or the Serializable interface ?
 
Wes
serializable has precedence
 
7:03 PM
Just from looking at lxr.room11.org/xref/php-src%40master/ext/standard/var.c#865 there are probably quite a few that have a custom handler and you won't be able to know that from userland
 
That makes sense to me
 
!!blame amphp/amp
 
it shouldn't have done that :-/
 
@DaveRandom Yes, you should definitely work on DnsLib or cancellation for Amp. :P
 
7:12 PM
wait... does that mean a PDO object will pass a method_exists call on __sleep but cannot be serialized ...
 
@Orangepill yup
@kelunik OK. If you see me here again in the next hour or two, shout at me.
 
So the only way to see if something is serializable is to try and serialize it and see if it explodes?
 
@DaveRandom Yay! Not. :-(
 
@Orangepill Which is totally fine.
 
no because __sleep can affect state
 
7:14 PM
@Ocramius does that everywhere to forbid serialization.
 
sigh
Why do some things have to be so hard?
 
@SebastianBergmann I think it's because the repo is called "global-state"
 
@NikiC :-)
 
Oh, regarding global state:
Apr 24 at 17:35, by kelunik
phpdbg -qrr vendor/bin/phpunit --coverage-text --process-isolation --debug
PHPUnit 6.1.1 by Sebastian Bergmann and contributors.

[PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 559416998969376 bytes) in /home/kelunik/GitHub/amphp/amp/vendor/phpunit/phpunit/src/Util/GlobalState.php on line 166]
 
@SebastianBergmann do we need to have the "birds and bees" talk?
also, phrasing
 
7:20 PM
@kelunik Do you have global backup/restore turned on? Because it's off by default in PHPUnit 6.
 
@SebastianBergmann Could be the case, let me have a look.
 
Nevermind, that's probably not related. Only now saw that you're using process isolation and that code is also used by that.
Oh, what I would give if I were allowed to remove the whole global state backup/restore mess as well as process isolation from PHPUnit. That would make things so much simpler.
 
Dunno what it does, went with groups for now.
@SebastianBergmann I think it only happened with --debug, without it it crashed because of a Closure that's not serializable, I wanted to know where.
 
@kelunik Weird, as --debug only prints the name of each test.
Most tests of that suite are skipped because I am missing ev, uv, and event.
 
Anonymous
7:25 PM
Evein
 
@kelunik Since you just mentioned PHPDBG and code coverage. Whom do I need to bug about github.com/sebastianbergmann/php-code-coverage/issues/514?
 
@SebastianBergmann Yes, and uv has issues when it's enabled and the event loop is replaced.
@SebastianBergmann @bwoebi
That's why we use separate processes now. github.com/amphp/amp/blob/master/.travis.yml#L33-L38
 
@kelunik or is phpdbg making issues with forks?
 
my phpStorm academic license is expiring. Any suggestions of other IDEs to try?
 
@bwoebi It's fine without --debug.
 
7:31 PM
Okay
 
Wes
@SebastianBergmann SOME? that's the php way :P
 
@BoanergesAleman-Meza PhpStorm is the only PHP IDE that deserves to be called IDE, IMO. Everything else is inferior at best and only gets in your way at worst.
6
 
@SebastianBergmann Sounds like a good idea, but it will be more expensive to filter while recording. And if you filter only at the end... well then you can also just remove it yourself
 
@bwoebi But while collecting, data you're not interested in is not held in memory, for instance. And filtering in C should still be faster than filtering in PHP.
 
recording really is just writing a very few bytes upon each opline
@SebastianBergmann array_key_diff will do it for you
hmm, perhaps.
I'm iterating internally over the recorded oplog and then could probably skip tons of array inserts...
but I still don't expect the perf diff to be very big.
I need to try and bench.
 
7:41 PM
For Xdebug it makes a difference, AFAIK.
Then again, for Xdebug I do not need code like github.com/sebastianbergmann/php-code-coverage/blob/master/src/…
 
@bwoebi The executable marker here is btw. uninuitive: coveralls.io/builds/11273356/…
 
@SebastianBergmann how much of a difference?
@kelunik What are the line numbers of the opcodes there?
 
@bwoebi That would be a question for Derick.
 
@bwoebi No idea.
 
@SebastianBergmann It depends also a lot on how they're internally stored
 
7:46 PM
Other way round is coveralls.io/builds/11273356/…, I'd probably expect the first and last line to be marked as executable.
I have a weird report with } being marked as dead code, but can't find it right now.
 
Well, it depends on the line numbers of the opcodes... What should be the used lineno? The one with the function keyword?
 
8:01 PM
@bwoebi return probably.
 
8:33 PM
@BoanergesAleman-Meza Komodo Edit is decent for a IDE but is far inferior to PHPStorm
 
idea: generics but with no new syntax
php already lets you pass around types in variables
formalise it
new List(MyObject::class);
new List(int);
List::concat(MyObject::class, $list1, $list2);
 
@Andrea That makes things harder, not simpler
 
i'm not getting it... would type information have to be supplied to every instance a method is called?
 
@NikiC does it?
@Orangepill no, you could store it in a property
 
@Andrea Depending on how exactly you mean that of course, but it smells of dependent typing to me
Because now your types can also be runtime values
 
8:38 PM
Then how would a typed parameter of a method signature look?
 
@NikiC the fact they could change could be… annoying
@Orangepill I guess like function someMethod($typeVariable $variable) which would be… interesting
@NikiC Nothing in particular stops you from using such values for type declarations, but it wouldn't be particularly fast…
hrm
brb writing my first new and useful RFC in a while
(class type declaration, à la callable)
 
I prefer c++ style generics... though java style wouldn't require additional keywords
 
something that probably influenced me here is that I watched a talk by Simon Peyton Jones on the Glasgow Haskell Compiler's intermediate representation, which has type arguments on functions (because it's a simple way to handle generic types)
it's not a language you're supposed to write directly, but it's interesting as an approach nonetheless
Here's a question for you. So, I'd add a class type for parameters and return values which would work like callable does (accept a string pointing to a class, autoload it). Naturally, an interface type would make sense too. But what if you want to accept both? What should that be called? classlike?
@NikiC Do you have an opinion on names? :p
 
8:57 PM
@Andrea I call those class or classlike
In most cases class is understood to include interfaces
 
@NikiC internally they're the same structure!
 
classlike is to satisfy the pendants who don't get that an interface and a class are the same thing
 
I could make class a superset of interface, but it feels… weird.
My first thought is “but you can't instantiate an interface!”… but you can't instantiate an abstract class either, and an interface is really a glorified one of those.
 
exactly
 
making class accept interfaces would be consistent with the rest of PHP, if slightly weird
 
9:02 PM
In my mind class is a subset of interface...
 
hmm. should class $foo = null be permitted, or only ?class $foo? I could force the latter, but being consistent is probably better, so I guess I'll allow the former.
 
how do you explode each line of a text file?
 
@Hello explode("\n", $content)
 
Anonymous
@Andrea No. Never!!!
 
would I have to assign an array to hold each line?
that was exploded
 
9:07 PM
@Hello explode generates an array
 
@Andrea Btw hack uses classname
 
@NikiC hah
I could copy Hack
but I don't want to
 
Wes
i am genuinely scared when @Andrea has a new idea :P
3
 
@Wes good
 
Wes
what happened to your "destroy php" avatar :P
that always fits :P
 
9:10 PM
perhaps :p
 
Wes
i'm totally pro generics tho
 
See they'd be neat, but implementing type variables, arguments and parameters would be a lot of work.
 
Wes
as in, like c#'s... with variance allowed only on interfaces
 
and I realised now that they don't need to be separate things, theoretically
 
9:12 PM
i am genuinely scared when @hikari_no_yume has a new idea :P
 
Wes
what's actually far more scary is that i have the same ideas andrea has...
 
nope, that's totally expected, you are both insane, bound to be some crossover
did the twitter random unfollow thing happen again at some point? I could swear blind I was already following @Andrea
oh right she has n accounts, where n is very large
 
@DaveRandom I may or may not have moved Twitter account again, then swapped the names of the accounts
@DaveRandom ^^
 
Wes
@Andrea
$class = HashMap(Int_(), String_()); // HashMap<Int, String>
$obj = $class(["a", "b", "c"]); // new HashMap<Int, String>([....]);
$class->classifies($obj); // $obj instanceof HashMap<Int, String>
@Andrea this i have done. got lost implementing unions and variance
methods will be changed from:
function method(/** T1 */ $obj){} to
function method($obj){ assert($this->getClass()->getTypeArgument("T1")->classifies($obj), new TypeError...); }
 
$ php -r 'interface foo {} var_dump(class_exists("foo"));'
bool(false)
what
@Wes cool
 
Wes
9:23 PM
would be cool if i finished it :B
 
ZEND_API zend_bool zend_is_class(zval *class) /* {{{ */
{
again:
    if (Z_TYPE_P(class) == IS_STRING) {
        zend_class_entry *ce = zend_lookup_class(Z_STR_P(class));

        if (!ce) {
            return 0;
        }

        if (ce->ce_flags & ZEND_ACC_TRAIT) {
            return 0;
        }

        return 1;
    } else if (Z_TYPE_P(class) == IS_REFERENCE) {
        class = Z_REFVAL_P(class);
        goto again;
    }

    return 0;
}
/* }}} */
I like how simple this is
 
Wes
@Andrea what if MyObject is generic too? MyObject<A, B>::CLASS?
 
No need for that else though (maybe)
 
@Jimbo it could be a separate if, that's true.
 
I got something right? :D
 
Wes
9:27 PM
i like it with the else :B as it's an alternative to the first if, not a completely different if :B
 
Guys i have a question
 
shit. I must be sick. Just now, there was a laravel question, and I wanted to answer it, because it felt like I could, and someone did before me, and I felt bad. now, I feel even badder.
 
@FélixGagnon-Grenier answer my perl question instead!
 
hmm
 
9:32 PM
though accepting interfaces in class would be the PHP way, the cleanest thing would be to have three types: classlike, class, interface
 
@FélixGagnon-Grenier Bleach is the only solution.
 
@Jimbo you're suggesting suicide, or the anime?
@Dereleased hey that's actually interesting
 
@FélixGagnon-Grenier Haven't asked a question in 2 years, it might as well be
 
Please Never Use That Capitalkization Again, K?
:D
 
Talking about my question title?
 
9:37 PM
indeed
 
I suppose it depends on whether you consider that element to be a title or a sentence. I believe title, since the question (many sentences) is stated below. But if you want to flex your edit muscle I have exactly nothing invested in editing it back to preserve capitalization.
 
yeah, I totally already did. sorry.
 
Wes
@Andrea if code was any good i would show it to you.... in fact, also the unicode things i'm doing... sooner or later...
 
still friends?
 
Wes
i just want to quit everything and do just open source work :B
 
9:42 PM
open-source is where I try to contribute a small change in a pull request and nobody reviews it
 
Wes
:P
 
@Dereleased actually, I did not think titles were supposed to be capitalized like that. is that an english rule I have been overlooking all my life?
 
10:01 PM
Fate-chan:php-src ajf$ sapi/cli/php -r 'class A{} interface B{} function foo(classlike $c) {var_dump($c);} foo("A"); foo("B");'
string(1) "A"
string(1) "B"
Fate-chan:php-src ajf$ sapi/cli/php -r 'class A{} interface B{} function foo(class $c) {var_dump($c);} foo("A"); foo("B");'
string(1) "A"

Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type class, string given, called in Command line code on line 1 and defined in Command line code:1
Stack trace:
#0 Command line code(1): foo('B')
wait, this proposed hierarchy becomes hell once you consider traits ._.
oh, static members in traits aren't directly accessible, okay
classlike, class and interface types patch (no tests, no inheritance handling, no new ext/standard functions, no ext/reflection stuff, but it works…)
 
10:29 PM
I think I got a bug, might already be found. I can do:
use X\{Y, Z};
use T;
But I can't do:
use X\{Y, Z},
    T;
Yet I can do:
use X,
    T;
 
@Jimbo that might be intentional?
 
i'm trying to read a file's lines into an array, and then explode each of those lines so I can access the individual pieces of data
if (file_exists("comments.txt")) {
        $file = file("comments.txt");
        for ($i = 0; $i < count($file); $i++) {
            $posted_comments[$i] = explode(",", $file[$i]);
            for ($j = 0; $j < count($posted_comments); $j++) {
                echo "Name: " . "<a href = {$posted_comments[1]}>" . "{$posted_comments[0]}</a>";
            }
        }
    }else {
        echo "File does not exist!";
    }
am I at least doing the right approach?
 
@Andrea How come? I can do it without grouped namespaces, why should grouping make a difference?
 
@Jimbo whoever implemented it (I forget now) wanted to avoid the complexity of it, maybe?
@Hello probably
 
10:46 PM
aw I get Array to string conversion error notices on the echo line
 
@Hello $posted_comments is an array of arrays here
do you not mean maybe for ($j = 0; $j < count($posted_comments[$i]); $j++) { ?
and echo "Name: " . "<a href = {$posted_comments[$i][$j][1]}>" . "{$posted_comments[$i][$j][0]}</a>";
@Hello also you could make your code a bit simpler and more readable by using foreach instead of for
 
ah
 
@Andrea you're really just messing with your twitter accounts, to confuse us, right? ;-)
 
i couldnt think up the nested logic for foreach :D
lol
 
@bwoebi I carefully documented the changes, actually :p
 
10:50 PM
@Andrea nobody is going to read the changelog, you know ;-)
The changelog is for us so that we can actually tell our users what changed if they report breaks :-P
 
@Hello what do the lines look like? what's an example?
@Hello also, if this is a CSV file, you might want to use PHP's CSV functions
 
yep, comma separated values
but its a text file
 
ah okay
 
yeah
Im trying to make a page that lets you view all of the names and comments
just having trouble with the logic
 
Wes
$RC->getFileName() // E:\a\b\c.php(3) : eval()'d code
-__-
 
10:57 PM
if (file_exists("comments.txt")) {
    $file = file("comments.txt");
    foreach ($file as $line) {
        list($name,$email,$comment) = explode(",", $line);
        echo "Name: ";
        echo "<a href=\"", htmlspecialchars($link), "\">", htmlspecialchars($email), "</a>";
        echo nl2br(htmlspecialchars($comment));
    }
} else {
    echo "File does not exist!";
}
Something like this should work.
 
Wes
is there a way to know if a class is declared in an actual php file, ie, that is not internal and not created through eval() nor with "new class{};"
 
@Hello I would recommend using fputcsv and fgetcsv instead of implode and explode, because they can handle escaping and quoting (they'll work properly if someone uses a line break or a comma in one of the fields)
 
Ohhhhhh
 
@Wes ReflectionClass might tell you
 
Ill try to implement that now - thanks a lot Andrea
 
Wes
11:00 PM
isInternal() ok, isAnonymous() ok, there is no way to distinguish between file and eval, tho, right?
 
glad to help ^^
 
if you could, can you explain what your version does differently? never seen n12br or the purpose of htmlspecialchars($link)
:D
 
@Wes does it tell you the file?
 
@Wes is the source file exposed?
 
Wes
@Andrea $RC->getFileName() // E:\a\b\c.php(3) : eval()'d code
of course i could check if getFileName() contains "eval()'d code" but i would rather not do that :B
 
11:01 PM
@Wes so… match against this eval()'d code
@Wes that's the way though ;-)
 
Wes
@bwoebi * the bad but only way
 
@Hello htmlspecialchars replaces characters in text that HTML handles specially. so it replaces < with &lt; and > with &gt;, and your browser shows &lt; as < and &gt; as >. you want to do this so that these characters show up properly, and also to prevent a cross-site scripting attack where people use <script> tags in comments
 
because, that's the only actual difference between eval and file … it's a special source.
 
ah i see
 
@Hello nl2br replaces line breaks (which would otherwise show up as spaces in the browser) with the HTML <br> tag (which shows up as a line break in the browser)
@Wes it's a magic string, and this is indeed how you check :p
…though you could theoretically make a file with that name :D
 
11:04 PM
thanks Andrea this makes sense
 
:)
 
Wes
there should be a isEvaluated()
because that sucks
 
<3
 
Wes
in fact i think i'll do file_exists() instead
@bwoebi if i do preg match, i know that "eval()'d code" bit will change in every php version released from now up until i continue to use that preg_match :B i did a reg exp on an error message once, i swear they changed the error message (was a js lib) like ten times. and every time i had to update the regexp. eventually i gave up with that solution :B
 
hehehe
 
11:29 PM
need guidance from the gurus here ......how shall i pass information using a radio button . i have a table with rows and collums; i have radio button at the end of the row..
I am trying to pass the entire row value to a different page on which the raido button is selected
 
updated my patch to unbreak reflection and opcache, and I added a (complete?) test
Now to write an RFC?
 
Wes
11:55 PM
i'm even more scared now :P
 

« first day (2385 days earlier)      last day (2559 days later) »