« first day (1557 days earlier)      last day (3394 days later) » 

12:05 AM
@marcio free will free the string even if it's shared with other places (refcount > 1)
release will decrease the refcount and only if it's unused it will be freed
Usage: Always use release. Free is an optimization for cases where it's known that a string cannot be shared.
 
@NikiC oops, ended up posting before see your reply stackoverflow.com/questions/28035694
 
:21051125
If not even less.
 
@NikiC so basically if I update a zval that I know is not a reference, I can just zend_string_free the old value instead of zend_string_release?
 
@PaulCrovella It's slightly less entertaining when you suspect they have literally lost their minds, and are in the early stages of a literal mental breakdown.
@crypticツ You've got some 'splaining to do I think: NSFW china news
 
why exactly are you browsing "horse-news.net"? ... don't answer that
 
12:16 AM
@marcio by "reference" do you mean & style reference, or rc reference?
 
@PaulCrovella I think the real question is why you claim not to be browsing horse-news.net.
 
@NikiC I meant & which is the only way I "know" to cause a zval reuse from userland code (+ I guess literals parsed from source would never be reused). But maybe it's all misconceptions from my part.
 
@marcio php shares zvals all the time, even without & references
look up the "copy on write" concept
 
12:33 AM
@Danack "Dash stands at 5 foot 9 inches tall" so the way too happy guy posing next to it is what 4ft tall? Also, why does it look like it would shop at Wal-Mart O_o
 
@NikiC ok, understood. It's almost only safe to zend_string_free strings you somehow zend_string_alloc yourself as tmp variables. Thanks.
 
Is threre is any solution for this problem?
 
I recompiled php with --enable-fd-setsize=999999 and changed max system open file to the same number and I face the same problem :/
This warning appear after 1024 connection has connected
 
did you reboot?
 
12:44 AM
yes
Maybe the number is very big so system skip it and set the default ?
 
Dunno :/
sounds like some UNIX thing
 
@NikiC git.php.net/… is that related to pear issues? And the implicit issues with PECL then?
 
1:00 AM
Oh, what's this? Default constructors votes... 17:10? It's dead? :D
 
@AndreaFaulds Yeah, room 11 rules :-D
6 no votes… from room 11
 
Room 11 is the cancer that is killing PHP :p
 
:-D
 
still 5 more days of voting. don't jinx it.
 
@PaulCrovella it's usually a really hard job to reverse leading no-votes on a 66% vote
 
1:15 AM
@AndreaFaulds I was holding my vote to see if it needed it, apparently not :-)
 
@Goku Can you look in the config log for what it's actually set to - apparently it doesn't just depend on the flag but other unknown things.
@Goku Also can you comment on bugs.php.net/bug.php?id=43269 to say that it would be "totally amazeballs" or whatever equivalent you prefer...to be honest it sounds like it should be implemented, but for a PR have multiple anecdotal evidence of it being good, would be good.
 
@ircmaxell It may be needed yet.
 
@AndreaFaulds I'm watching, don't worry
I don't want to pull that card unless I have to
also: This is a conference weekend!!! YAY!!!
 
Guys - even though I think that default constructor RFC is not awesome, it's not appropriate to take glee like that.
 
1:31 AM
True :/
 
@Danack I think not awesome is an euphemism…
 
Also we shouldn't be coordinating the death of an RFC
 
we're not
we're not asking people to vote for the death of it
everyone here was/is free to vote their own way
we just discussed the RFC
 
I didn't say that - I said that:
....
gleefulness isn't appropriate.
 
True
By the way, I'm wondering about a scalar type hint. It'd be unlikely to pass, but it's still more useful for error checks than no scalar hinting at all. I think it's an idea that's been rejected previously.
 
1:33 AM
@bwoebi It think it would be good for simple cases, and bad for complex cases - which is always the wrong way round. Simple stuff is simple enough, you want feature that make complex stuff easier. And that people voting for it have only really thought through the simple cases.
@AndreaFaulds strict int/float/string/bool or 'proceed yonder'.
 
@AndreaFaulds as part of a complete set of type hints, along with a generic "object" type one, yes
 
@Danack my words.
 
Yeah. It could also be a workable stopgap if we don't get proper scalar hints, is what I'm thinking
 
@AndreaFaulds I don't think it's a stop-gap at all
meaning it solves almost none of the use-cases individual scalar hints would
 
I suppose ensuring scalarity isn't actually that important for scalar hints
It's discriminating between specific scalar types
 
1:39 AM
yup
also: yay, my heat at home is working again :-D\
 
I bled about 10 liters of air from the system
 
@Danack After some tests I found what I expected is correct, the number "999999" is bigger than a number in UNIX system ( which I don't know what is that number ) and tried to change it to 6000 --enable-fd-setsize=6000 and compiled php again, and modified /etc/security/limits.conf by adding this lines:
* hard nofile 6000
* soft nofile 6000
root hard nofile 6000
root soft nofile 6000
then finally managed to establish 6000 connection, Now I'm trying to make a test of 100000 connection
 
1:54 AM
100000 is many connections.
 
Yes I know, I want to make sure that project will afford that number
 
100000 simultaneous connections is really a lot…
 
So my laptop will explode :D ?
 
you're using an event reactor, yes… well… the issue is not the pure connection number, but working with all the input coming from these.
 
100k simultaneous connections is much for anything
 
2:05 AM
hello
 
yes, there are a few systems that could do that, but no, don't
 
2:33 AM
> Bob would volunteer to implement that feature.
 
i have .csv files where every second the data updates in the .csv file so how i can show this that every second in web browser with out refreshing every second , any one please help me
 
3:04 AM
Hi php folks. I have a problem that could be a PHP bug. I'm using PDO::ATTR_ERRMODE = PDO::ERRMODE_EXCEPTION and for the very same error i get two errors. First a Warning Warning: PDOStatement::execute(): MySQL server has gone away in and then also a PDOException is thrown too `PDOException, SQLSTATE[HY000]: MySQL server has gone away. This doesn't look to be the correct behavior but i might be wrong... what do you think?
ah, so i wasn't wrong bugs.php.net/bug.php?id=63812
 
3:46 AM
@PeeHaa any opinion on this pr? Overriding the font-family wholesale seems like it'd be a bit much, but I'm mostly dealing with Arial either way so it doesn't really impact me. I'm very slightly leaning toward rejecting it, but... ya know what I just don't care. This one I'll leave to you.
 
 
1 hour later…
4:56 AM
@sectus, did you also used mpdf in creating reports in your projects like generating invoices...etc.
 
5:12 AM
@Jimbo One sets up the internal state, the other is a user-facing method that takes arguments
 
zan
5:33 AM
moin
 
5:56 AM
Morning and have a nice day peeps
Hope you have/had a great bday @tereško and my condolence to you =]
 
@RonniSkansing so how was the first day?
 
great thanks g2g ... day 2
ttyl =]
 
dear god pdo is a mess
i am getting exceptions from the past!
$pdo->beginTransaction(); // line 1
echo "transaction started <- this get printed"; // line 2
$pdo->exec("..."); // line 3
// mysql goes down, pdoexception on line 1. WHY
3 hours spent wasted debugging this
 
user3949359
6:17 AM
what is a "sharded cluster" in Mongo?
 
@JecebahnYaledimacOndestal nah, you are just an idiot
 
zan
ya ya go ahead , so what wrong you are doing
 
6:55 AM
Instead of adding () ==>, we could just get rid of having to return
That'd benefit all function declarations:
usort($arr, function ($a, $b) => ($a - $b));
class Foo
{
    private $foo;
    public function setFoo($newValue) => ($this->foo = $newValue)
    public function getFoo($newValue) => ($this->foo)
}
 
oh god no
please
 
@PaulCrovella why not?
 
why that? @AndreaFaulds
 
It avoids a lexer hack and it's familiar. But it lacks all of the brevity of () ==> and it wouldn't have implict use...
 
@AndreaFaulds implicit returns are evil.. evil
 
7:01 AM
@PaulCrovella This isn't implicit, it's explicit
I don't like implicit returns either
 
what's a lexer hack? :P
 
@JecebahnYaledimacOndestal a particular implementation detail involving parsing
 
i mean what's wrong with { and } ?
(and return)
 
@JecebahnYaledimacOndestal function foobar($a, $b) use ($c) { return $c[$a] - $c[$b]; } is too long
versus ($a, $b) ==> $c[$a] - $c[$b] say
 
@RonniSkansing thnx
 
7:06 AM
i see, but it's not really important, no? @AndreaFaulds? i'd focus on class properties instead (get/set)
 
@AndreaFaulds "Instead of adding () ==>, we could just get rid of having to return" - when you say things like this it's frightening
 
@PaulCrovella Look carefully at the syntax
 
I see the syntax. What does setFoo return, null or $this->foo?
 
it should't return anything
@AndreaFaulds what about
public function setFoo($newValue) { $this->foo = $newValue; }
public function getFoo() {= $this->foo }
function(){=$this->field}
 
@PaulCrovella It'd be $this->foo in that case, assignments result in what you're assigning. So $x = ($y = $z); sets $x to $z;
@JecebahnYaledimacOndestal ...weird, what?
 
7:10 AM
@AndreaFaulds how is that weirder than yours :P
 
@JecebahnYaledimacOndestal Well, it just looks odd. = is used for assignment, normally.
 
i just applied this <?=$var?> to that function(){=$this->var}
 
But = there is echo
 
@JecebahnYaledimacOndestal awesome
 
@AndreaFaulds it's not the assignment I question
 
7:12 AM
Oh. => ($foo) would be a shortcut for { return ($foo); }, to make lambdas more concise, is what I'm suggesting
 
@tereško apsveicu :)
 
i just wrote a comment on php.net and an instant after that i realized i was totally wrong
 
morning
 
morning o/
 
7:25 AM
lol
 
i have a question. i'm often and more often writing code that makes the "type" useless, since i'm not keeping the instances always in a valid state, but instead checking the validity using an isValid() method. say i have two dependencies, one or the other must be set, but not both:
$a = new A($dep1, null);
$a->setDep2($dep2); // puts the instance in an invalid state
$a->setDep1(null); // now it's valid again
$a->isValid(); // true
i want to avoid setting both fields with the same setter. what should i do? what am i doing wrong? :D
 
posted on January 20, 2015 by kbironneau

/* by Minute Papillote */

 
moin
 
good morning
 
@AndreaFaulds I don't use short enough lambdas often enough that saving ~8 characters would be meaningful to me. I'm also averse to an overgrowth of syntactic sugar. Something like this is nowhere near my wishlist.
 
7:43 AM
@JecebahnYaledimacOndestal why are dependencies able to invalidate the state of your object at all?
 
well that's what i'm asking i guess
 
let's start at the beginning. What do you want to achieve?
 
world domination
 
Oh. I see. Then I guess optional Dependencies are not the way to tackle that.
 
7:56 AM
@ThomasDavidPlat atm i'm just out of curiosity. i don't have any meaningful example
 
8:09 AM
Switching dependencies on the fly is a requirement?
 
@PaulCrovella I think I will merge it most because subjectively I like it better personally :P
Morning all
 
@PeeHaa k. you can probably get rid of the div.cp font-family bit then (though check, I don't know if there's anything in between that'll try to screw us)
 
@PaulCrovella Will check it out
 
8:24 AM
\/_
 
good meurning!
another fine day to be programming while you're so ill ><
 
thats sed
 
@JecebahnYaledimacOndestal paste.jesse-obrien.ca/1v9v
However can't tell if that's a good solution
But personally I wouldn't do it like that. It also makes type hinting the dependencies impossible.
 
that's the problem :D
also validate() should throw an error if both aren't set
 
You didn't tell your exact requirements
 
8:30 AM
> one or the other must be set, but not both
got the problem?
 
hah sorry. Yeah but that's details. Should be easy to alter the validate method
 
yes, but you can't validate it automatically, unless you have a setBothDependencies($a, $b) method
 
@JecebahnYaledimacOndestal It'll be a lot easier pointing you in the right direction if you had a vaguely real-world example
 
i know. i'm trying to think of a good example. the fact i didn't sleep tonight is not helping
 
> yes, but you can't validate it automatically, unless you have a setBothDependencies($a, $b) method

^ invalidated
however I still don't like that the dependencies cannot be type hinted
 
8:39 AM
@ThomasDavidPlat eval.in/245030
 
Why would you want to allow to have an object with an invalid state at any given time? That makes no sense for me.
 
i don't want to allow it, but i can't have a setEverything($a, $b, $c, $d, $e) method
sometimes i can set just one and leave the instance invalid for a short period of time
and then complete it with all required dependencies
 
> sometimes i can set just one and leave the instance invalid for a short period of time
imo that's to be avoided. But here are developers who are over ninethousand times more experienced than me. Maybe someone is willing to help :)
 
I am agree with all. Why would you want to have an object in a non initialized state?
 
nobody can help anyone "properly" implement class A. it's clear what's being done isn't right, but what is right depends entirely on wtf is actually being attempted
 
8:49 AM
@JecebahnYaledimacOndestal xy problem
 
> This can lead to frustration by people who are trying to help you solve the problem
 
i am trying to think of a good example
 
I am not emotionally attached to my code! Nope, Nope, Nope
 
marning
 
We0
8:59 AM
Hey people
 
Morning
 
We0
array (size=7)
6 => string '' (length=0)
5 => string '' (length=0)
4 => string '' (length=0)
11 => string '' (length=0)
10 => string '' (length=0)
9 => string '' (length=0)
8 => string '' (length=0)
array (size=5)
6 => string '1' (length=1)
11 => string '' (length=0)
10 => string '' (length=0)
9 => string '' (length=0)
8 => string '' (length=0)
array (size=12)
0 => string '' (length=0)
1 => string '' (length=0)
2 => string '' (length=0)
3 => string '' (length=0)
4 => string '' (length=0)
5 => string '' (length=0)
 
what i have now are bad examples that you guys would destroy in a second :D i will ask again once i have one
 
We0
3 arrays, trying to merge the first 2, the 3rd one is the results of array_merge()
 
yay huge wall of data
 
We0
9:01 AM
Sorry :(
 
We0
but I just want the existing keys of both array and the value to be replaced by the second one if there are matching keys
obviously array_merge doesn't work for this, anyone know of a function that can do this?
 
btw guys: what's your preferred method of storing verification email hashes? Own table or column on users table?
 
@ThomasDavidPlat you will use that only once for each user, so yeah, storing in a different table is a good idea
 
We0
9:04 AM
@ThomasDavidPlat what wat?
 
I've always used the former because database design and shit. But I think I'm getting lazy
 
@We0 can't compute "existing keys of both array" "both" implies two, but "array" is singular
 
We0
arrays*
 
@SergeyTelshevsky thanks for not allowing me to be lazy :D I'll keep sticking to it
 
We0
SO I want the keys from both arrays and where the keys are the same, it must keep one of the arrays values
 
9:06 AM
exactly. That's why I just thought about using a nullable column on the users table
 
@ThomasDavidPlat sorry, misread, today is a harsh day
 
We0
4 => ""
5 => ""
6 => "1"
7 => ""
8 => ""
9 => ""
10 => ""
11 => ""
 
We0
OMG
no ownder I can't find a function
I don't need one
Thanks
 
9:08 AM
and to cap it all I'm nervous as hell. Job interview tomorrow :<
 
We0
Worse part is I think I have asked this before, thats why I specifically thought there was a fucntion for it :(
 
@ThomasDavidPlat good luck then
 
Thanks :)
Maybe the naked man works for job interviews, too?
I think I should try that tomorrow.
 
@ThomasDavidPlat videos or it didnt happen
 
9:20 AM
hi all
 
PHP guy loses fate in himself on an interview, goes naked man. Reddit's gonna love this
 
can anybody tell me how can I send array of form data in form submission along with file uploaded in angularjs
http://paste.jesse-obrien.ca/1vaq
data: {form: $scope.formData, files: $scope.files} line contain formdata and uploaded file data
 
@Gordon sorry but you'll have to buy my book "How to be successful in job interviews" - The bonus DVD will contain videos on how to successfully pull off the Naked Man
damnit. Removed it by accident
 
$scope.files is an array but why $scope.formData cant be an array
I am using PHP as server side language
where I am catching these parameters using
print_r($_REQUEST);
print_r($_FILES);
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
9:36 AM
if anybody from this group know about the solution
 
posted on January 20, 2015 by kbironneau

/* by Rou Lee */

 
moin
 
Anybody here knows Stronghold Crusader?
 
10:00 AM
Anybody here who can tell if Phinx is worth it's salt?
 
Hello everyone, Is it possible that I can get current date's post of user from facebook using graph api
 
gosh. I sound kinda spammy today.
 
Hello! Pass parameters as a hierarchy of directories in a URL has a concrete name? I want to name a function but I don't know what name to give it :(
 
@AndreaFaulds Does the user not define the internal state?
 
@ThomasDavidPlat What's the actual job in hand? Or just investigating tools for shits and giggles?
 
10:05 AM
@Jimbo To an extent...
 
@DaveRandom actually just for fun. But it has a serious background too. I found Laravels Migrations to be pretty convenient, but it's too much of an overkill for simpler stuff.
 
Ahh OK. Then I have no useful opinions :-P
 
What would you've recommended if I had an actual job :-)?
 
Well it would depend what the job was - I guess idiot check to make sure that "a tool" and not just "a script" was what was required
y'know, "I want to make a one page static site, which PHP framework should I use" kinda thing (not that I think you'd do that, but even good people get into wrong mindsets sometimes)
 
understood
I want to see how far I can get by pulling in only the stuff I need. And the packages I want to pull in shouldn't bring 90% of SF2 with it :D
 
10:22 AM
I'm at a loss for words seeing this
 
@ThomasDavidPlat If you are pulling stuff in using composer you are getting 50% of packagist packages either way :P
 
@PaulCrovella Ditto.
 
@bwoebi Not just PEAR, the change in general is probably too strict
It means that pretty much any static call to a method not marked "static" will fatal if it happens from a method - but will be only E_STRICT if it happens from somewhere else
Which is weird and probably not in the spirit of the original RFC
I'll write a followup mail about how to best handle it
 
LOL. Just found that docblock in legacy code I wrote a year or so ago:

> /**
* @todo:
* refactor that. Extremely bad
* method to set default images :(
*
* Bro do you even refactor?
*/
 
10:44 AM
@NikiC Someone suggested just doing a static call in that case, sounds good to me
 
@ThomasDavidPlat :)
 
Wow, how many PHP conferences are there?
 
@AndreaFaulds many ^^
 
> I am writing you today in my role as a member of the advisory board for this year's International PHP Conference - Spring Edition that takes place in Berlin, Germany June 7-11 2015.
> We would be thrilled to have you as a speaker for the conference. Would you like to speak, maybe on PHP 7? If so, please send me title and abstract for your talk as well as a bio and photo of yourself.
 
@AndreaFaulds I got that one as well ^^
 
10:50 AM
@NikiC heh
 
According to a slide in the keynote of the 4th tri-annual CPHPC (Conference on PHP Conferences), there are bajillions.
 
And because I live in Berlin, I'm likely to take that offer. Don't have to fly anywhere for that
 
inb4 Anthony suddenly decides to go to this conference ;)
I recognise two of the speaker names
Bergmann, seldaek (Jordi Boggiano)
 
Hmm 7th of June
Were you guys already speaking at some conferences?
@AndreaFaulds @nikic
 
nop
 
10:56 AM
I've never spoke at a conference and only ever attended one
Nikita hasn't attended a conference, but if he ever did, he would immediately draw at least one visitor from the other side of the world. ;)
 
@NikiC Are we finally going to see your face :-)
 
do you think you are going to try it at this Berlin conf?
 
Berlin is nice, I went there briefly on holiday last year ^^
Though where a conference is held might as well only matter in terms of time zone and distance
You're ultimately going to spend your time there in a conference centre
 
But you are living in Germany as well as Nikita right?
 
No, I don't live in Germany
I've been there more than once, though all of those bar one were just Frankfurt Flughafen on a connecting flight :p
 
11:02 AM
I was going (am going) to go there for rockamring fest so that's why I asked if you guys are gonna go to this conference, I'll probably skip the last day of the fest to see the conference
 
Also
>Spring
>June
Someone tell them that June is not in Spring
It is most definitely Summer...
 
Maybe there's something like a "fiscal spring" that goes to october?
 
Yeah, but who names conferences after that? Maybe it's a metaphorical spring.
Like the Arab Spring (which was named after the Prague Spring that was actually in Spring)
 
^^
 
The PHP Spring, where the community rises up against the dark forces of Zend and internals, embracing HHVM and dethroning the evil Rasmus Lerdorf?
6
 
11:07 AM
I'm picturing more of a slinky on an escalator.
 
The Spring Framework is an open source application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the framework does not impose any specific programming model, it has become popular in the Java community as an alternative to, replacement for, or even addition to the Enterprise JavaBean (EJB) model. == Version history == The first version was written by Rod Johnson, who released the framework with the publication of...
?
Hmm
Instead of adding enum Foo {} syntax, maybe we should just bundle SplEnum or something like it
 
You mean just basic enums or some kind of tagged enums?
 
@nikita2206 Oh, I guess only basic enums could be done that way :/
I like tagged enums, they're similar to algebraic data types...
In a sense all values in PHP are tagged unions, because PHP is dynamically-typed
I'd love to be able to do this:
enum Maybe {
    Some($thing);
    Nothing;
}
 
11:28 AM
^ Maybe ? MaybeNot ..
 
@SergeyTelshevsky paldies
 
@AlmaDo It's what optionals are called in Haskell
More specifically:
data Maybe x = Some x | Nothing
So:
 
enum Maybe {
    Some($thing);
    MaybeNot;
}
 
enum Maybe<T> {
    Some(T $thing);
    Nothing;
}
(with generics)
 
Yeah, but without match it's not useful. And now we come to a lot of other functional features that would be cool but impossible to get through internals
 
11:30 AM
@nikita2206 Heh
 
Although something like function composition....
I can dream
 
I don't think "internals" should be referred as a blocker here. It has downsides, but .. at least, language is stable and not affected by "wow, it looks cool! let's add it!"
 
@AlmaDo unlike Hack
 
(:
 
I mean, there are a lot of cases where you want to pass something like strtolower . ucfirst to array_map or something like this
 
11:32 AM
where's hack and where's php :p
 
callable(strtolower)->compose(callable(ucfirst))
...ew
($x) ==> strtolower(ucfirst($x))
 
I like composition more :P
But short function syntax would be cool as well
 
composition would be cool, yeah...
Oh, I know...
So, uh
I've wanted some way to get a closure from a function
 
There was, I think your, RFC about referring functions as callbacks. Like strlen::function
Or something like that
 
What if a constant doesn't exist and there's a function, it's the function?
Like:
$x = strlen; // closure of strlen()
But that's kinda hacky.
Every syntax I've seen has its own problems
I wonder if we shouldn't just allow new Closure('strlen') and new Closure(['SomeClass', 'someMethod'])
 
11:38 AM
Maybe like you just suggested with callable
it's already a keyword
So it could even be used without quotes
 
11:55 AM
@NikiC that looks like not strict enough and not too strict…
 

« first day (1557 days earlier)      last day (3394 days later) »