« first day (1781 days earlier)      last day (3161 days later) » 

Abe
2:03 PM
@marcio could do that as well though. what i just realized that operands are a set. i can write any expression with each operand appearing only once
 
Guys
i need advice
I am about to launch my social network, and make billions
2
but I am not sure what to call it
 
@Matthcw vaporware would be my suggestion
or snakeoil
 
@NikiC yes, you're right. Just create a normal closure object.
 
hahahahahaha
@PeeHaa i had to research that term vaporware
 
@bwoebi ok, I'll do that tomorrow if nobody gets there first
 
2:06 PM
posted on September 01, 2015 by nlecointre

/* by domster */

 
@marcio That doesn't handle expressions though does it? e.g. if ($a) {return $b;}
 
@Feeds LOL!
 
I am starting to think coding is becoming a trend instead of an action
 
@Danack to have a call graph in this case you'd need to assume $a is both true and false (since we have no memory about $a history and what it could be)
 
I meant that analyzing the call graph doesn't actually tell you anything about what is happening to the return value, and whether or not it is invariant to any of the inputs to a function, when the return statement is an expression.
 
2:13 PM
found reason 8400347509437 for YAML being a shit config format
@Jimbo ^
 
@Danack you'd need to combine other stuff to have a complete analysis like this, but in the case Abe presented, he basically just wanted to prove that if ((baz && foo) || foo) {} === if (baz || foo) {} and therefore warn about it.
 
find the bug.
 
@kelunik Yeah, this was considered for the RFC, but we decided to keep it simply at first, especially as ??= would be harder to implement. But I think there's a good chance we'll see it in the future
 
Anonymous
@Ocramius composer:// ?
 
@marcio Or just brute-force it....which would take 5 minutes to write the code for and have a very high level of certainty of detecting invariant conditions for all possible code.
 
2:15 PM
@samayo nope
 
Anonymous
hmm
 
@Ocramius white space vs tabs or something invisible?
 
Anonymous
ah ` reference`
 
@Danack noooope :)
 
@NikiC not sure… why exactly would it be harder to implement? (except that we can't use the current VM helpers for that as they throw notices…) … we'd just have to expand that to $a = $a ?? $b; on AST level?
 
2:16 PM
@samayo nope
 
Abe
@Matthcw always start with a niche: shredded-cheese-experts-facebook.com
 
@Danack this brute force approach is not sustainable for this specific kind of analysis he wants to do. You could do it of course.
 
....
 
This is reason 8400347509437 for YAML being a shitty configuration format: https://goo.gl/bcxk4e Now also proudly affecting app security.
 
How is it not sustainable for his use-case?
 
2:19 PM
yaml is shit for anything
 
@Ocramius what does . mean?
@bwoebi double eval
 
@NikiC it's a floating point number, no?
because PHP arrays totally support that :P
 
@Danack because he probably wants to analyze and report useful information about larger codebases, not simply if ((a && b) || b)?
 
@NikiC Just asking because I saw it on Twitter for Dart? I don't really remember which language it was, not that I even had the idea to have something like that in PHP yet.
 
@NikiC so, not AST level, but at VM level we can do the fetch and use the same VAR twice?
 
2:21 PM
@bwoebi I don't think it's quite so simple
Think about something like $foo->bar ??= $baz
In the simplest case here we could do a FETCH_OBJ_W and conditionally assign to it
 
@NikiC yep… we'd then issue a write fetch first and then do the coalesce/assign?
yes
 
However, magic properties will not correctly support BP_VAR_W mode
 
anyone wanna help?
http://stackoverflow.com/questions/32333738/multiple-counts-sql-statement?noredirect=1#comment52541920_32333738
 
So I guess we'd have to implement a new set of OBJ and DIM opcodes specifically for ??
 
@NikiC ehm… how is then e.g. $a->b += $b; handled with magic properties?
or is there called once __get, once __set then?
ok, yes…
 
2:25 PM
@bwoebi Probably via a reference? Or maybe get+set
 
@bwoebi Yeah, I think it's probably a very similar logic.
 
@Ocramius do you know graham campbell?
 
@NikiC We still have the issue with magic properties and ?? anyway, right?
@PeeHaa I know that name.
 
@PeeHaa not personally, but on Github, yes
 
2:28 PM
also, I'd wonder if ??= should be __isset or __get…
 
Why does he think he need to make useless comments on every single php commit on github? github.com/FriendsOfPHP/security-advisories/pull/…
6
 
@bwoebi __isset, but that's the problem with magic things... currently it's __get.
 
@PeeHaa he's young, resourceful, opinionated and sadly wasted on Laravel stuff, but be patient with the younger folks
@PeeHaa not like I really care. Did he just ruin your day because of that or are you just pissed on your own?
(think carefully)
 
I'm not pissed
Just noticing something
 
yeah, he tends to do that, but I don't mind. He's an actually very helpful reviewer
(when he's reviewing)
 
2:30 PM
@PeeHaa And submits useless PRs like this: github.com/amphp/amp/pull/32/files :P
 
@Ocramius kk
 
@Ocramius what's not so cool is the random emoji email notification
 
Side note: phpunit's code confuses me
Side note 2: I was working in my vendor dir instead of the actual repo :P
 
@PeeHaa I do that on purpose quite regularly.
 
@PeeHaa That thing just should be rewritten from ground up…
 
2:33 PM
Hey guys. Anyone with Openfire, Converse JS experience. Please help to resolve this problem stackoverflow.com/questions/32334337/…
 
@kelunik Ah yeah, forgot about that issue
 
hello guys
 
@kelunik Yeah I did too for testing, but I wanted to send over a PR and kept working in the wrong one thinking why it didn't work :P
 
sorry i should have not sent the whole code
 
@bwoebi Yes it probaly should, but that will be a shit ton work I'm afraid
 
2:34 PM
here in chat
ok here is the php part
<?php
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$host_name="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$database_name="ediary"; // Database name
$table_name="diary"; // Table name

// Connect to server and select databse.
mysql_connect("$host_name", "$username", "$password")or die("cannot connect");
mysql_select_db("$database_name")or die("cannot select DB");

date_default_timezone_set('Asia/Karachi');
$title = mysql_real_escape_string($_POST['title']);
 
@PeeHaa not arguing :-P
 
@PeeHaa That's not an issue at all when you --prefer-source. As I split the chat into more repos, I always edit the base repo in vendor and commit from there.
 
my problem is that i'm using it in same file "Add.php"
 
@HassanZia please, use gist or a pastebin :)
 
which is used to save user diary entry into database
sorry how to do that?
 
2:35 PM
@kelunik Does it actually clone an complete working repo when you do that?
 
Moorningsyoos
 
@marcio how to use git here?
 
I always thought it would do an "export"
 
@PeeHaa I think Sebastian did a rewrite already in very few LoC for about half of the features.
 
2:35 PM
@RonniSkansing o/
 
@PeeHaa Yes, does the same with dev-master versions, which is pretty nice, because it can use git pull then.
 
ah TIL
 
@PeeHaa depends on what you're doing. If you have dev-branch versions, then it clones.
 
That is actually useful
tbh 80% of composer stil confuses the hell out of me
 
2:37 PM
well simple is that i'm having problem in modifying the header
 
Without it, doing any changes would be harder, because I can't test them live then, but would have to commit and pull them.
 
symlink them :P
 
it wasn't there before i use $_SERVER[HTTP REFERE] as flag for adding some elements in my page
 
user image
2
 
2:39 PM
@Sara how far are you people with php 7 compatibility?
 
<?php
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$host_name="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$database_name="ediary"; // Database name
$table_name="diary"; // Table name

// Connect to server and select databse.
mysql_connect("$host_name", "$username", "$password")or die("cannot connect");
mysql_select_db("$database_name")or die("cannot select DB");

date_default_timezone_set('Asia/Karachi');
$title = mysql_real_escape_string($_POST['title']);
same result with git
 
$algorithm = chain(
    filter(function($x) {
        return $x % 2 > 0;
    }),
    map(function($x) {
        return $x * 2;
    }),
    sum()
);

var_dump($algorithm([1,2,3])); // int(8)
Compared to:
$algorithm = chain(
    filter($x ~> $x % 2 > 0),
    map($x ~> $x * 2),
    sum()
);

var_dump($algorithm([1,2,3])); // int(8)
I think the short closures help but it's not so helpful here as much as the fact that the functions I'm using have readable APIs.
 
BTW someone wanted to implement algebraic types in PHP? Or only unions?
 
Yes, me.
 
Guys who is the smartest programmer of all time
who can program in PHP C++ Machine code
2
And knows every thing about programming
 
Abe
2:48 PM
@nikita2206 also ircmaxell wanted to
 
every library
and every plugin they know how t use
 
I think we'll want function composition operator then
And monadic composition shortly after
 
that'll be a fun topic on internals
 
yes
 
@Matthcw no such person exists
 
2:51 PM
lol
I wish I had more kickable stuff
 
@nikita2206 What is function composition?
 
what do you have that is not kickable
 
dogs, kids, a misses ...
there's nothing I can kick and it wouldn't be illegal, or really expensive to fix ...
 
so you need more politically correct stuff to kick
 
yeah
I think my life is shortened every day I have to work on apcu ...
 
2:55 PM
@JoeWatkins I have one of those soft squishy stress balls on my desk that I tend to kick around a lot.
 
like, considerably ...
 
Abe
@bwoebi pipelining?
 
ah…
 
@PeeHaa I can just work in the vendor directory, no need for a symlink ;-)
 
@bwoebi when you send output of one function to input of another
 
2:57 PM
lol
 
heh
 
haha
 
@nikita2206 you mean like a() :> b() :> c() ?
 
@marcio no I meant like $func3 = $func1 . $func2; where $func1 returns A and $func2 expects A as first argument
 
Abe
maybe function composition (declaration) is not actually the same of pipelining (call chain) :P
 
3:00 PM
itsn't is like a(b(c()));
 
It is the same in the end
it is
@Orangepill it's basically it. But it's useful when you need to pass your function somewhere and this function should be composed of more than one functions
 
@ircmaxell which "applied cryptography" book should I pick?
 
@nikita2206 you mean $func3 = (...$args) ~> $func2($func1(...$args));?
 
@bwoebi yes, that would be the same... Without types being verified
 
@marcio Did you just make that syntax up, or is that from another language?
 
3:02 PM
@nikita2206 the types are verified wen $func1 is called…
 
@nikita2206 but the result would be another function that would have the composition of the functions baked in, right?
 
@tpunt the "chicken operator", I think it was just made up.
 
@bwoebi So if you pass your $func3 somewhere and they call it and $func1 happens to return B instead of A (which $func2 were expecting), their code will fail. But what should have failed is actually your code because you composed non-composable functions
 
@marcio Ah, just wondering since Elixir has the |> operator: a() |> b() |> c()
 
@Orangepill yes
 
3:05 PM
@nikita2206 yeah, it's doing run-time verification instead of compile-time…
 
@Sajad nice to know it
 
But for that to be actually useful we'll need tuples in PHP
At this point I think I should really just switch to Haskell or something
 
@nikita2206 Arrays?
I know, I know. They aren't typed.
 
@LeviMorrison yeah :(
 
3:19 PM
@nikita2206 Sounds like you want Haskell or modern C++
Or perhaps Erlang.
 
@Sajad if you were asking whether that anything you would need to know, when buying VPS from digitalOcean - I have no idea.
you should ask someone who's using it
I vent with a different and a bit more expensive solution
 
@LeviMorrison yeah, that's what I thought, maybe I shouldn't want to make haskell out of php
And just use haskell instead
 
I think algebraic data types could be useful in PHP, though.
They are essentially checked dynamic behavior.
Static meets dynamic, you know?
 
tbh no, I don't know :P
 
:D
Take union types:
D can be either A or B. It's static in the sense that D is restricted to a finite, known set of types. You could type-check that.
 
3:25 PM
Yes
 
But it's dynamic because there are situations in which you can't know which it is until runtime.
 
Oh, if that what you meant then yeah, I understand this :D
 
I think intersection types are the coolest feature out of enum, union and intersection types but the least likely to pass.
type Map = ArrayAccess & Traversable & Countable;
function some(array | Map $m) {
    // do something with an array or array-like
}
 
^ this
 
3:28 PM
This way code doesn't have to implement an interface Map – anything that is ArrayAccess, Traversable and Countable is automatically a Map.
That's very dynamic but it's also static in the sense that you can prove that function some only uses features of the Map or array.
(depending on what you actually do array | Map might not be desirable, since arrays are passed by value and Maps would be references)
(but at least some of the stuff can be done this way)
 
Yeah, that's pretty cool
 
For me an insanely common one would be Traversable & Countable.
 
Especially if you add | array
 
Abe
@LeviMorrison have you considered how that will affect a future support for generics variance? the two features should be designed at the same time, imho
 
@Abe You've said something like this in the past yet I still fail to see why they need to be designed at the same time.
 
3:32 PM
@tereško ok, can you tell me what time is it ? (in your country)
 
18:30
 
ok
 
@Abe I see no problem with generics, you'd just implement them like this:

type Map<K, V> = ArrayAccess<K, V> & Traversable<V> & Countable;
function some<K, V>(array | Map<K, V> $m) {...}
 
Abe
@LeviMorrison it's just a feeling, let's put it this way. i have the feeling that if they aren't designed at the same time, some nasty thing will come up
 
@Abe that's not going to happen because we'll never have generics in PHP
 
Abe
3:35 PM
@marcio is that your personal opinion or? :D
 
@tereško you will be online tomorrow at 14:00 (in your time) ?
 
@Ocramius I can't go to that on my phone it tries to call it as a number lol
 
yeah, there can be problems when you have or for different generic classes like function foo<K, V>(A<K> | B<V> $bar) {} - you have to always pass both K and V to foo() (unless php would infer generic variables by itself)
anyways generics are not going to happen, most probably
 
@Jimbo nice :D
UX fail
 
@Sajad probably
 
3:37 PM
ah ok.
@tereško when I bought a VPS I will install ubuntu on it, is it fine ?
 
Abe
@nikita2206 my problem with that is only about generics variance. (like K in A being covariant and K in B being contravariant) i didn't find the time to wrap my mind around it yet
 
(of course if digitalocean support it)
 
that's your choice
 
but, yes, digitalocean support ubuntu
 
3:39 PM
@Abe there's no variance at all
 
digital ocean sucks
 
@tereško good. I asked you because I need to your help ! I can not install php and mysql on my server singly
 
Abe
@marcio the good thing about generics is that if you want, you can not use them. so "Personally I would hate to see this anywhere near PHP" is not a valid argument
 
there are other ubuntu users here
 
@marcio oh haha
 
Abe
3:41 PM
@nikita2206 why not?
 
I was like, young
That was when I had my first or second job in office :D
 
I am not familiar enough with latest ubuntu to be able to talk you through blindly
 
@Sherif ...
Program received signal SIGSEGV, Segmentation fault.
0x00007f8fb4f534f8 in _erealloc (ptr=0x0, size=79, __zend_filename=0x7f8fb51b5da8 "/usr/src/php-src/main/spprintf.c", __zend_lineno=246, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/src/php-src/Zend/zend_alloc.c:2404
2404            if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
(gdb) back
#0  0x00007f8fb4f534f8 in _erealloc (ptr=0x0, size=79, __zend_filename=0x7f8fb51b5da8 "/usr/src/php-src/main/spprintf.c", __zend_lineno=246, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/src/php-src/Zend/zend_alloc.c:2404
guess where that is ...
 
Hi, I have a problem with hashing.
I store a hashed password and when I retrieve it from database, password_verify doesnt return true.
If I do this
password_verify($password, password_hash('password', PASSWORD_BCRYPT, array('cost' => 12)))
it returns true
Only passwords from database doesnt work
 
@tereško yes, but I want to chat with you, I'm familiar with your morality, method and ... !
 
3:42 PM
@JoeWatkins The debug?
 
yep
 
@tereško shit, so can I install freebsd in my server ? digitalocean support it ?
 
:)
 
@Abe generic types + variance = earth explodes
 
@Sajad there are enough guides on the internet
 
3:43 PM
not only does it crash, but it hits it ...
 
@Poyatoo Check that the field you're storing the hashed password in is large enough to store it, otherwise by default MySQL will simply truncate the value (read up on sql_mode to have MySQL error instead when values are too big for a field)
 
@Abe it's not exactly because of discussion quality internals are usually praised for:
> Please no. If you need Java, you know where to find it. Java has a set
of great tools, great books, great community. And it's completely free.
Anybody who needs Java can just do it. I see no need to turn PHP into Java.
 
@JoeWatkins Makes sense why it didn't segfault for @bwoebi then. I'm guessing he didn't have it compiled with debug
 
@tereško ok, but I'm sure I will stuck in it :(
 
Abe
@marcio ahahah
 
3:44 PM
there are ubuntu users in this chat room
 
@Sherif I have --enable-debug … You usually have to extra ask me for non-debug ^^
 
if he had zts on it would have crashed before that ... slowly making it more sane, it won't do ...
 
@tereško ok thanks.
 
@bwoebi Right, my bad. I guess you still have to set the constant or whatever.
 
@JoeWatkins wait… you did enable-zts and signals?
 
3:45 PM
yes
 
vultr is cheap vps, and the performance is better than any others ive tried (IMO)
 
@nikita2206 Oh, that's you! I thought this thread was started by the other Nikita
 
@marcio only two Nikitas here :D
And Popov wouldn't start it like this, he would write implementation first probably
 
Abe
@marcio discussion is of 2012. maybe they changed their mind as @nikita2206 did :P
 
@tereško ok, I checked digitalocean, it supports centos, do you know about centos ?
 
3:50 PM
@Sajad please stop. Make your own choice. Not based on what your friends at home or random people on the internet tell you to use.
 
@Abe I didn't really change my mind, I'd love generics in PHP, but I don't have enough time to implement it with my knowledge of engine
 
@tereško I did not worked with none of them, how can I choose ?! I just need to a helper for implementing my server !
OS does not important for me
even If digitalocean support freebsd, I'm fine with that
 
Abe
@marcio php picked a direction which is dictated by their users, not by php implementors/designers. either you implement your users' wanted features or they will actually move to another language. guess whose loss it would be?
 
"I've never tried your X, but my Y works for me, therefore your X is wrong." 2015 might be the year when I learn to dodge such discussions.
2
also relevant to today.
 
Abe
yes :P
 
3:56 PM
has anyone every sat there and looked at dos prompt during a mirgration and wondered, if i press enter right now, will it destroy everything ive created? (obv i have backups)
 
@Abe again, for many people this is not an issue: chat.stackoverflow.com/transcript/message/25440637#25440637
 
Started adding docs to my Algorithms repository.
 
By the way, what do you (everyone) think about this syntax for partial application: $f = array_map("intval", ...); then I could call it $f(["2", "1", "4"]); and get [2, 1, 4] from it
 
When sending a PR on github, can I still do a git push -f? Because I did and the PR still shows my unsquashed PR :P
oh nvm
github is just sloooow
 
anybody know about ubuntu or centos here ?
 
4:05 PM
@NikiC done… had a quick 20 mins…
 
10.00$ USD. what is "USD" ?
 
@Sajad please, google is in the next window
 
I got it. tnx
 
@Danack killer argument.
 
4:11 PM
Good book?
 
@bwoebi That's an excellent point
 
@ircmaxell feel free to bring that point up, the next time you reply to internals… I don't feel like replying again to that argument.
 
@JoeWatkins So php-src was fixed so zend-signals works with pthreads?
 
@Trowski It's about apcu…?
 
@Trowski yes
 
4:14 PM
@JoeWatkins Alright, I'll pull master and rebuild everything and see how that goes.
 
zend_signals are still crap ...
gonna fix that ...
 
No disagreement, but at least I don't have to rebuild php on travis just so pthreads works :-)
 
what was the point of zend_signals at all…?
 
LGL
@Orangepill Thanks for the GROUP BY method, it seems like is working fine.
 
Abe
@Sajad you made dracula angry coz he thought to be the best in the world
 
4:20 PM
@bwoebi as to symbol choice, it appears that the currently proposed semantics are identical to HHVM, no?
 
@ircmaxell mhm, Sara said something, but I might have been a bit confused here…
 
well, before we weren't going to auto-bind IIRC
 
@bwoebi Isn't this more or less the same way Scala does shorthand for closures?
 
but reading the docs, it appears that the semantics are the same
@Sherif it's more or less the same way that every language does it
 
22 hours ago, by Sara
@bwoebi Also, after much discussion, we'd probably prefer if PHP used its own syntax. Then we can keep ==> as we like it.
@ircmaxell no, I didn't change anything there.
 
4:22 PM
@bwoebi I believe to avoid situations like a process that has created a lock in APCU from being interrupted while that lock is still active, and so making the whole server lock up.
 
@Danack kill -9 … woops… deadlocked the whole server!
 
@bwoebi its like a critical section for signals implementation ... so that signals aren't delivered while you are doing some particular thing ...
 
@bwoebi I believe (I haven't used this myself) that it's for sighup, which some software (like nginx) uses to trigger a reload of config. You don't want that to happen while resources are still locked.
 
I'm not convinced any of this is needed
well, that's to say there is probably a bettr way, for apache, and we control everything else, and should come up with a better way
 
@JoeWatkins The better way would be to make sure resources are freed properly in their respective shutdown handlers rather than trying to wrap the entire signal handler, I suppose.
Which you would think should already be happening in the MSHUTDOWN, no?
 
4:45 PM
$userid = $_SESSION['id'];
$mysql = new MySqlConnection();
$mysql->createConnection();
$query = $mysql->getConnection()->prepare("SELECT `access_level` FROM `user` WHERE `id` = ?");
$query->bind_param("i", $userid);
$query->execute();
$query->bind_result($accessLevel);
$query->fetch();
$query->close();
$mysql->closeConnection();
Why am I getting an error in wher bind_param is? This error "Call to a member function bind_param() on boolean...."
 
@LGL Good ... I just wish I understood why it was necessary, you where already grouping by the primary key... adding the other values to the group by was kind of superfluous
 
@Poyatoo you ought to get better at googling error messages.
 
@poyatoo because $query is false because there is something wrong with your prepare statement.
 
LGL
@Orangepill cause when you use aggregate query and use ORDER BY, I believe you have to tell which time by even tho the other table (votes) don't have time.
It kind of make sense
you don't need posts.title, just posts.time
 
@LGL I figured that would have been resolved by switching ORDER BY time to ORDER BY posts.time
 
LGL
4:52 PM
@Orangepill I think the query confuse the server when is aggregated. Oh Well it's solve. Thanks
But now i can't bind it lol I will figure it out why lol
 
OH, Talking about @3v4l_org: "wonder what exit code 153 stands for” "gosh, that @ocramius guy again, need holidays"
bwahaha
btw, who is the maintainer of 3v4l.org? And how do I ship beer to him?
 
What if he wants money instead of beer?
 
@LeviMorrison I can arrange a kidnapping or something
Terrorists be resourceful.
 
@Ocramius he actuallys hangs around in this room
"Sjon" or something similar
 
Abe
@Ocramius @Sjon, he hangs around in this room sometimes
 
4:55 PM
ic :)
 
Abe
the guy who trolled us with Output for FRIDAY @Ocramius :D
 
Aye =D
 
@Ocramius he accepts gratipay
5
 
@Orangepill how do you know it's him?
 
4:58 PM
I just hope he accepts our sincerest apologies for the shit we put 3v4l through
 
@FlorianMargaine Because he said so ;)
 
@PeeHaa ok :)
 
@FlorianMargaine linked from the 3v4l.org page :)
 
@bwoebi $func = (int $x): int ~> $x * $x; Would this be implementable for parameter and return types?
 

« first day (1781 days earlier)      last day (3161 days later) »