« first day (2826 days earlier)      last day (2119 days later) » 
00:00 - 15:0015:00 - 00:00

 
1 hour later…
2:10 AM
Argument unpacking: Add support for associative arrays – #76613
 
2:31 AM
Hey, does anyone have experience with gcov? What is this actually reporting? gcov.php.net/viewer.php?version=PHP_HEAD
Surely we don't have 151 broken test in master right now...
 
2:42 AM
nn
 
it looks like the environment running tests has some problems around extensions
 
2:58 AM
@LeviMorrison
> Also, I am determined to make generics happen. I really think this should have a type parameter associated with the interface; I would reject one that does not.

What do you mean by a type parameter exactly?
 
In this declaration class C<T> {} the bits between <> are the type parameters.
 
Of course of course, sorry I thought you meant comparable or whatever should have a type parameter..
So I think I misunderstood.
If you want any help with generics let me know?
 
3:31 AM
interface Comparable<T> {}
class MyClass implements Comparable<MyClass> {}
^ That's what I mean.
 
But that's not something I can add now in any way, would land alongside generics surely.
Actually hold on.. where would T be used?
compareTo(T $other) ?
 
I find that a bit strange. I don't expect anyone to ever typehint there.
squinting intensifies
 
I expect it to be common. Types are often comparable only with the same type.
 
Would this mean that it'd have to wait for generics to land first to avoid bc break?
 
3:36 AM
No, if it's there before generics then when we add generics we would do this:
interface Comparable<T = mixed> { /* ... */ }
Then all existing code will default to mixed types and they can update it to be more restrictive as they care to.
 
Otherwise changing the interface from compareTo($other) to compareTo(T $other) wouldn't implementors need to adjust? Ideally we could just change it to Comparable<T> with compareTo(T $other) without affecting existing code. If the generics proposal can achieve that, hats off.
Ah nice, that makes sense.
 
However, I prefer it to not be defaulted. The default would only be there for compatibility. So if we define new interfaces/classes after generics they should usually not have defaults.
Make sense?
 
Wouldn't mixed be the universal default? ie generics are completely optional?
 
Why would we want them to be completely optional?
They effectively offer no type safety that way lol
Also, due to variance I'm not entirely sure it would work as well as you would think.
function acceptBox(Box $b) {}
acceptBox(new Box<int>()); // TypeError: Box<int> is not compatible with Box<mixed>
 
Isn't Java's optional? I can't remember. ArrayList a = new ArrayList() isn't valid?
 
3:50 AM
Type parameters are by default invariant, and for something like Box where theoretically can read and write then it must be invariant.
 
(not saying Java is right every time)
Yup that makes sense.
But I would be able to write an interface that isn't generic. And if it is generic, there shouldn't be a default. Same page I think?
 
Yes, except where those interfaces already exist and you want them to become generic.
 
Agreed, sorry with you now.
 
4:11 AM
@NikiC I know spare brain cycles are hard to come by at the moment with everything going on, but do you have any ideas about how to technically perform the type-checking of generic arguments/returns? Right now these things are static and they need to be made dynamic.
This is one reason I started with generic traits: I copied the signature and altered it. This is fine because the copy happens anyway. Doesn't work for non-traits.
 
MYSQL_ATTTR_* definitions define all values as "integer" – #76614
 
4:36 AM
What does EXPECTED and UNEXPECTED do?
Also when should internal functions use zend_ prefix in the name?
 
branch prediction optimizations
 
When should I use it? For example.. when I expect something to be the case most of the time?
Let's say.. array_filter with callback would almost always return a bool, so I can use if(EXPECTED(Z_TYPE_P(z) == IS_TRUE)) { ?
Morning o/
 
morning
you should only use it in high frequency code, where you are certain your predictions are correct ...
 
Thanks :)
 
executing code that was compiled with branch prediction optimisations where those optimisations are wrong is slower than executing the code without predictions ... so you must be sure ...
 
4:44 AM
Cool cool, was curious.
is there a hard rule for when to use zend_ prefix in say.. zend_operators?
 
no hard and fast rules, what you working on ?
 
Splitting out comparison context between equality and natural ordering. Baked into compare_function atm
Just want to get it working, but WIP is:
ZEND_API int ZEND_FASTCALL zend_do_comparison(zval *op1, zval *op2, int *result, int context)
 
if it's in /Zend and is exported it should have zend_ prefix, if it's in /Zend and forms/extends an internal (zend) API it should be prefixed ...
that's fine ...
 
Why is compare_function, is_equal_function etc not prefixed, or should they actually be?
 
history
 
4:48 AM
np
 
imo they should be ... but no rules, so do whatever :D
 
5:18 AM
Does *result *=1 make sense for an int* arg?
(*result) *= -1 I think
 
@JoeWatkins any chance to get nevis up and running?
 
5:42 AM
morning
 
Wes
6:29 AM
@Danack i didn't play football in 20 years, i weigh 100kg, i earn like 1/100000 of what kane earns. i would've scored that one :B
 
@Wes "in 20 years" means you never played soccer in your whole life.
 
Wes
i am probably older than you @Gordon. i am 32
 
I've never played football, but put me on the field I would've done exactly as well as the Browns last year.
 
@Wes I am turning 42 this year
 
Wes
i was exaggerating. but yeah i am sure i didn't play football for at least 10 years
@PaulCrovella american football?
 
6:41 AM
correct
 
hi all am new here ,i recently asked a question is stackoverflow
but it is flagged as duplicate ,but a dont think so...
please if you have time do me a favour
pls check this https://stackoverflow.com/q/51298401/6562458
ok thanks a lot
 
@Sumithran yeah 'cause you screwed up your question. Phil already reopened it.
 
somebody removed that
@PaulCrovella yup
 
@Wes ouch
 
Wes
6:45 AM
double miss
the second is even more ridiculous, as he shoots on the pole, from a 50cm distance :B
 
some shit luck there
 
morns
 
Wes
but tbh it's fair that way... croatia played better than england overall
 
@Sumithran usually the default user for PostgreSQL is "postgres"
@Gordon Is that 42 years or 42 eons? :P <3
 
7:04 AM
@mega6382 it's somewhere between older than all of you, but younger than @Danack
 
Yeah,thats it..
it work for me..
if you dont mind pls post is as answer
thanks
 
@Sumithran Actually there are a few questions about this already, so, I will suggest that you rather delete the question.
 
bt why people are still downvoting that question
@mega6382 :'(
 
@Sumithran look at this question, stackoverflow.com/questions/32723995/…
its an exact duplicate
 
Wes
@Gordon ?? danack can't be older than 42
 
7:09 AM
@Wes Why not? I am sure that even his beard is older than 42 :P
 
ypz
 
Wes
he is a bit gray but that's just because of php
 
@Gordon you are literally twice my age
 
@mega6382 I don't envy you.
 
:P
 
7:28 AM
am I being trolled? I'm being trolled. who votes for that shit
 
It's 2018. Are table prefixes still a thing we should do?
Also, mornin'
 
Does anyone know how I can use \Phake::partialMock() without invoking the ctor of the mockee?
I want the default answer of the mock to be to delegate to the parent
I can use \Phake::mock to provide a default answer, but it doesnt accept the delegate to parent strategy because it wants some sort of container class
 
8:00 AM
eggbeater Slang. a helicopter.
 
@Sean when were we supposed to be doing them?
 
8:18 AM
@PaulCrovella Back when you had to pay per database schema, fun times
 
Hello
 
Wes
can't work today because i am too angry because of work
 
8:33 AM
What's getting you angry? D:
 
work. aren't you listening?
 
Wes
i have cursed for 3 hours. i thought i would stop eventually but i am still cursing
 
@LeviMorrison what do you mean by static/dynamic here?
 
@PaulCrovella Fun fact time! My favourite thing to eat is food
 
8:39 AM
 
@Sean lol
 
@Sean I too enjoy food, fellow human.
 
9:26 AM
Hi guys
currently I am reading diff between lambda function and Closure .But I don't any specific difference between them.Instead,Closure can access outside variables when passed to it..
Can someone provide me details over this?
 
@Exception a lambda function is an anonymous function such as in php $bar = function(){return "foo";};. But a closure is function that closes around the scope of its parent. Meaning all the definitions available in its parent will be available in the closure.
 
@Exception lamda function is the general computer science term. Closure is how they are implemented in php.
 
But in php closures are a bit different. In php you have to use use() to get variables from the parent scope. php.net/manual/en/functions.anonymous.php#example-165
 
Wes
@PaulCrovella that quickly turned into a steve miller band joker remix
 
10:05 AM
@Danack So how that exactly works?
@mega6382 Yeah! I saw that.
 
@Exception I don't understand what you're asking.
 
if lambda and Closure functionality is same then can PHP team be able to manage it in lambda function?
 
I understand what you're asking even less now
 
I'm so confused. It is too early for my brain to hurt this much.
 
@Exception maybe just write your question in your native language?
 
10:13 AM
@Exception lambda functions and closures are synonyms.
Unless you are in a specific context, there is no difference between the terms.
 
Cool
thanks :-)
So, as per my research, `A closure is a lambda function, but a lambda function is not a closure unless you specify the use keyword.`
So if you provide `use` keyword then that `lambda` function will be `Closure`
This is just minor difference in between these two.. because if we want to access outside variable inside anonymous function then use use keyword and then this lambda function will be turned into Closure..
 
If you're using PHP, just forget the word lambda, and use the word Closure.
 
They all get turned into Closure objects. When you utilize the use keyword the difference is purely in what variables are available within the scope of that anonymous function. Also what Leigh said.
 
There is no concept of both, and one becoming the other
 
synonyms
 
Wes
10:28 AM
all you need to know is: in php closures are not closures :B
 
haha this is new terminology?
 
Wes
also Closure is the wrong type name, a function is a closure only when it captures automatically the scope in which it is defined... the type should be Function or Lambda
 
How come that wasn't picked up in the RFC for anon function support?
The only thing they capture automatically is $this and superglobals, right? Does that make it qualified to be called a closure?
 
Wes
and the global scope, but not variables
$c = function(){ return strlen("a"); }; // strlen is captured automatically
@Sean well, closures in php can optionally capture with use() but for me is crucial that a closure does it automatically and by-ref
that is, like in javascript
 
@Wes that's different though, the function and class symbol tables are global, scoping is dealt with by fully-qualified naming, but they are static definitions. You can't have fully qualified naming for variables, because they are dependent on the current state of the stack
"closure" is the wrong name, but you can't describe constant symbols as "captured", they are just global, it's not really relevant to whether it's a closure or not
 
Wes
10:48 AM
maybe. but don't care :B
also about the name... closure is ok. it's a bit stupid but ultimately it doesn't matter
i am still so angry. i am not sure if i am angry at myself or... i've basically sabotaged my own work and lost money just to make a point
 
eat something. have a good meal.
 
Wes
i am sucking pleasure from the opposing part's misery, but ultimately i am angry because this shouldn't have happened, and because i lost money
 
Wes
\o
 
o/
 
11:32 AM
@Wes that's what I said
the mid part
 
Wes
i wasn't disagreeing
 
@DaveRandom I believe instead of "capture", the right word would be import or inherit
 
well not really, they are global
there's no scope inheritance for global symbols, they are just universally available in the same way, everywhere
 
oh, yes, you are right
 
PHP != JavaScript
#protip
 
11:36 AM
lol
 
```
function foo() {
$errors = ['asdsd' . rand(100, 200)];
return $errors;
}

$bar = [];
$bar = $bar + foo();
$bar = $bar + foo();
$bar = $bar + foo();

var_dump($bar);
```
array(1) {
[0] =>
string(8) "asdsd194"
}
 
yeh, that's how + works
 
out of all the things that are trivial to do in PHP.......why is concatenating arrays not one of them?
and is there an built in thing for concat'ing them that isn't array_merge?
 
array_push($bar, ...foo())
that's what you really mean anyway
it might be nice if $bar[] = ...foo(); worked
3
not sure about that though
+ with arrays actually isn't an array operation, it's a map operation
 
also this can work, but i doubt, that that is what you want:
$bar[] = foo()[0];
$bar[] = foo()[0];
$bar[] = foo()[0];
 
11:41 AM
@Danack array_push() is what you really want though 3v4l.org/l5eVv
 
Is it what I really really want?
 
I dunno, I was under the impression you may also want to zig-a-zig-aahhhhh
Not sure how getting with my friends will assist with you becoming my lover
never was really clear on that, they had some sort of peer-review process in place I guess
 
That's alright. I'm in Bristol; everyone's me lurver.
@DaveRandom amulet of sexual prowess maybe? www.oglaf.com/prowess/ NSFW
 
@Gordon I have seen something like that before
 
11:52 AM
cant find them packagist though
 
12:05 PM
PHP max memory limit not respected on pdo_pgsql – #76616
 
"No QA required / I feel lucky, punk!" - On a ticket that just broke a production app.. :/
 
10/10
 
Good Morning!
 
\o
 
Happy Rebecca Eve!
@Gordon ^ See- I remembered.
 
12:23 PM
@StatikStasis Sorry, its "Happy Prebecca Day" :P <3
 
Crap
I like Rebecca Eve better though.
 
thats cause you are a weirdo
 
@mega6382 Aren't we all.
 
I am totally normal
 
freak
 
@DaveRandom problem with array_push is it doesn't like it if it's given zero arguments. that caught me out recently…
 
@StatikStasis I am maybe a bit weird but I am not weirdo :P
 
weirdo = do weird. If a bit or a lot you still are one. =p
 
@NikiC ah, sorry, I took a break :p
 
@Andrea fixed in 7.3 apparently 3v4l.org/fcnLo
dunno why that can't go back into 7.2 tbh
 
12:38 PM
@DaveRandom Warning: array_push() expects a thumb war
 
@DaveRandom 😍
 
@NikiC Consider this:
class Box<T> {
    function put(T $t);
    function get(): T;
}
When these methods are called we need to check based on the type provided at runtime.
Right now it will see if T is loaded, if not it errors and if it is then it checks against T, and here I literally mean a class/interface/trait named T, not a type variable.
 
ok
first you assign every type parameter an offset (and handle this correctly in inheritance)
then you store type parameters on the object at this offset, after the properties
 
Right, so we use an int offset into some linear buffer.
 
And compile the type annotation to also refer to that offset
and then you look up and check
or something :D
 
12:48 PM
Seems like that might cause trouble for things that get object properties and whatnot, having those types in the same array.
 
12:59 PM
class Collection<T> implements IteratorAggregate<CollectionIterator<T>> {
    function getiterator(): CollectionIterator<T>;
}
^ another example to think about.
@NikiC On 32-bit PHP are we out of bits for zend_type or nah?
or zend_type_info or whatever it is called.
 
don't think so
with typed properties we are though :P
 
Oh, can you link me to the new repr?
Oh wait, I misunderstood.
I see two options: make a more complicated type, or separate the tag from the data.
 
Wes
1:57 PM
 
is twitter down?
 
Oh yah
I'm hiring again directly for my team - come and work with me on a mediterranean island! https://www.linkedin.com/organization/404429/campaign/238cda98-89ad-44e6-844f-dbe62b6c0355/ #php #symfony
 
@mega6382 Nope
 
then probably a problem with my account, cause it seems to be working in incognito too
 
@Jimbo If only it wasn't ballerman island :D
 
2:05 PM
@Jimbo if only the pay wasn't so bad
 
xD What's "ballerman island"?
 
but... you get to work "on a mediterranean island!"
 
@LeviMorrison Yep, brb going swimming in the sea in 30 minutes
 
@Jimbo balneario. we call it ballermann in german. the whole story is de.wikipedia.org/wiki/Ballermann_6 but its in german.
 
@Gordon I was in Munich last week, and Bavaria + Austria. Near freilassing. Love that place, the mountains are just awesome
Paragliding, got lucky with the weather too!
 
2:09 PM
@Jimbo google image search ballermann
 
@Jimbo I read it.
 
@Patrick Ah, luckily it's not like that :) There are two main places concentrating both the british and the german scum and villainy, they're magaluf and arenal. Avoid those, it's much nicer. I'm actually glad they exist because it stops them going to the nicer places
 
@Jimbo out of curiosity, what's the pay?
 
@Patrick "Competitive" is what the company says. Make of that what you will (actually in Mallorca / Spain it is)
But it's usually based on skill - I don't need geniuses, more team players with good knowledge they want to share
Aiming at mid-levels
 
I once tried applying for trivago, I remeber @Jimbo giving me a link to a portal, but I never bothered, because it was very complicated and asked too many questions.
 
2:13 PM
@mega6382 We try many different things here, I'm actually pushing to avoid that stuff as it's too heavy :)
 
@Jimbo But spains economy is horrible... So that translates to "laughable" compared to Switzerland? :(
 
@Patrick Of course it's laughable to switzerland, so is UK, germany and tonnes of other places. But then the low~ish rent + quality of life makes up for it
Switzerland is supposed to be good salaries no?
Shit even my English is becoming more Spanish
 
@Jimbo From what I know, agencies pay somewhere around 80-90 usually. If you get a good job as a senior then I would say 100-130 is more like it. Outside of PHP it goes quite a bit higher (banks, insurance companies etc)
 
... hmm ... twig/extension seems to be discontinued
 
2:30 PM
Hello! Any WordPress hosting expert here?
Would appreciate if any suggestion provided.
 
@AT-2017 "wordpress expert" is bad enough and you are looking for "wordpress hosting expert"
 
Yes.
 
is there an actual question there?
 
Just ask your question instead of polling for people
If it's generic php somebody may be able to help you. If it's WP the only real suggestion you may get is: don't use WP
 
Guys, files will not be uploaded on the server (Linux, ubuntu 16.04) by php. The same PHP code works well on the localhost (Windows OS) .. Any idea?
 
2:32 PM
@Shafizadeh check permissions
 
Noted that the owner of the whole project on the server is www-data and I set 777 for the whole directory
 
Please see the image first.
 
@mega6382 Actually I did (somewhat). The strange part is uploading returns true and no error exists in the /var/log/apache2/error.log, and the file isn't exist on the server
 
@Shafizadeh then make sure you have the correct path
 
2:35 PM
@mega6382 I tested both \ and / for the path ..
Odd really ..!
Oh wait ..
Oh got it ..
thx
 
I've already installed a WordPress website in the public_html folder. Now one of my team member has created another domain where he wants to create another website. That should be independent. Unfortunately that doesn't work and redirects somewhat like this.
 
How great I am :P feel good :-)
 
@Shafizadeh why? What was the problem?
 
Now we want the new website to be in the new domain and as well independent. Can we make it work without keeping it in the public_html folder?
 
2:38 PM
@mega6382 I should replace C://xampp/htdocs/project/public/img with \var\www\html\project\public\img ..! The great part is my project has a config file contains all those paths .. I can simply manage them all
 
@AT-2017 well of course, just contact your hosting provider to ask how to point the new domain to another folder. Or google it.
@Shafizadeh That doesn't really look like an improvement really, using full paths is good but generate them dynamically
 
Yeah .. recently I just use __DIR__ ... I wrote that code when I was young
 
2:51 PM
@Patrick I considered banks, insurance companies... but from what I know they use aged technology and you don't have much say in learning, tech stack and it's very bureaucratic etc. Not sure that's my thing even for that money :)
 
@Jimbo Where are you now, still in Mallorca?
(checking just in case... I'm in Madrid tomorrow, Barcelona on Monday)
 
00:00 - 15:0015:00 - 00:00

« first day (2826 days earlier)      last day (2119 days later) »