« first day (2827 days earlier)      last day (2118 days later) » 
00:00 - 18:0018:00 - 00:00

12:02 AM
oh no, I absolutely agree that there aren't enough to warrant them in userland... particularly this userland. Not even for comparison operators.
my point was just that $datetime1 < $datetime2 doesn't piss me off
 
@PaulCrovella sure, and $diffTimeSpan = $thenDt - $nowDt; and $then = $now + $timespan; and maybe even $intervalTimeSpan = $totalTimeSpan / 4;
none of that works afaik btw
 
behold, a bad idea: register_comparator('int', 'DateTime', function(int $a, DateTime $b) { return $a <=> $b->getTimestamp(); });
 
I used to have a kick button... didn't really miss it until now
 
:D
 
try pressing this:
 
12:13 AM
somewhat therapeutic, but it opens a new tab which is annoying
 
[tag:foo]
but if you want to play, please go to sandbox (room#1) :-)
 
okie dokie, artichokie.
 
12:33 AM
@pmmaga Honestly though that's probably a better idea (though still really bad) than the rfc... there are a lot of things that many people assume are innately and trivially ordered that aren't, e.g. letters. Usually what you really need is an outside comparator that understands the aggregate.
 
1:22 AM
@PaulCrovella indeed, I definitely get the impression that almost, if not actually, all cases where people think they want this are really just driven by encapsulation concerns that could be solved equally well with package-level visibility and/or just using an interface at an api boundary
I'm really not a fan of the friend thing but I'm not sure we're going to get "internal" member scoping any other way :-/
 
well, we're not going to get it the friend way either
(which is for the best, imo)
 
I've mentally kicked around something like namespace Vendor\Package\\Sub\Ns\Stuff; where internal things are accessible to anything with a scope that matches the lhs of the \\ but I don't like it
(or some other designator than \\)
fucking markdown
 
indeed
but without modular AOT compilation I just can't see any other way to express package boundaries to the engine
 
technically we can already do namespace level visibility, but it's a total hack..
 
1:30 AM
?
 
I sorta don't even want to say how, for fear it might infect people
think of the worst way to do double dispatch in php, also magic, and that's it
 
largely irrelevant tbh because NS+children scoping isn't actually that useful, I would guesstimate that at least 50% of my usage of internal in .net is the other way round
@PaulCrovella I'm thinking cocaine with a heroin chaser?
 
bingo
 
kk, let me go experiment with the ratios
 
@DaveRandom it's probably a lot more than 50%
in a way I like python's approach.. a simple gentleman's agreement to visibility
it's simple and seems to be mostly effective there
 
1:52 AM
I'm not so keen, however I only wrote first line of py 2 days ago and historically when working with js or php4 for long periods (when the Stockholm syndrome sets in) I have swung round on it
 
php 4 isn't that bad, tbh.. just most of the shit written in it was
 
it's mostly by-val that will really hit you where it hurts
a missing & in a foreach and you're debugging shit 8 layers down
 
it's mostly by-val that we also miss today
 
@DaveRandom your or you're?
 
ty
that would have annoyed me
anyway
/me sleeps
nn
 
2:01 AM
ciao
 
 
2 hours later…
3:35 AM
nn
 
 
1 hour later…
4:44 AM
Hello
 
Wes
5:39 AM
le morning
 
6:07 AM
is there any service which stores video and these can be fetched to my website.Condition is it will be played in my website only and there should be api to differentiate each video.S that I can categorized them in groups
 
mornin ppl of phpverse
 
6:33 AM
what is the use of this function -
private function getHomeCategories($categories)
    {

        function buildTree(array $elements, $parentId = 0)
        {
            if($parentId !==0){
            return $branch;
			}
        }

        return buildTree($categories);
    }
and when can I use it?
 
Wes
thats terrible
a global function defined in a method
 
6:47 AM
unable to validate select box .jsfiddle.net/hearthacker/3sx27rwz/9
 
One of my coworkers just told me this little gem;
> I've deleted the phone numbers of all the Germans I know from my mobile phone. Now it's Hans free.
@mega6382 can you teach that to @Jeeves, pls. You seem to be able to remember the syntax.
 
lol, sure
 
3 messages moved to Trash
 
please help me how to validate the select box.i tried but it doesn't works...jsfiddle.net/hearthacker/3sx27rwz/15
 
please give more details. what are you expecting and what not?
 
7:01 AM
validation works for text field but unable to validate select box.so i placed my code in fiddle.
 
which jquery version you are using?
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
but i'm using pure javascript for validation
 
change this-
<select id="mentor_name" name="plant_name" id="plant_name" class="form-control">
<select id="plant_name" name="plant_name" id="plant_name" class="form-control">
to
and reload
 
ya i changed but still it doesn't works...
 
and if(plantname=="") to if(typeof plantname=='undefined')
 
7:19 AM
o/
 
and is it require to write window.onload=function(){} ?
 
ya i changed its displays select box error but if i select any values into select box.still the error displays.
 
7:44 AM
@Exception you might check out brightcove
 
8:00 AM
vitiate to impair or weaken the effectiveness of.
 
\o
 
o/
 
Wes
nobody is born cultured, so no need for fucks, no sakes, or any other east asian beverage
\o
@Exception window.onload contains a function that is executed when the page loads. it is preferable writing window.addEventListener("load", function(){}); instead, as with that you can have multiple functions executed when the page loads
 
8:11 AM
lol
 
Wes
@mega6382 do i amuse you?
 
Well, everyone amuses me, and I think pandas are fun. :P <3
 
Wes
youtube.com/watch?v=75ifn39Y8V0 . nsfw language warning
 
everyone loves that movie... I've tried but I can't stand it
ray liotta is a terrible actor and joe pesci is just irritating
 
8:23 AM
@PaulCrovella I watched it for the first time when I was about 14 yrs old, I didn't understand more than half of it but I still loved it. :P
But yeah, I'll agree I don't really like Ray Liotta
 
8:34 AM
I think he does a good job at the role
both of them actually
pesci is really great playing this complete asshole
 
Yeah I really like joe pesci too
 
he's a character actor.. he plays joe pesci
 
Hmpf… I forgot to pack my shoes for the gym twice in recent weeks. So today, when I packed my bag, I was almost proud that I remembered to put them in… now the wife just texted me and asked whether I forgot my sports bag intentionally? Gah!!! >.<
2
 
8:49 AM
hahaha
 
@Gordon perks from working from home: you don't go to the gym
 
Wes
9:06 AM
@PaulCrovella i'm not a great fan of it either
 
10:03 AM
moin o/
 
Wes
i don't even have a passion for the godfather tbh... reminds me of my family a bit too much :B or the sopranos... it's exactly like that minus the crime :B
 
10:19 AM
I don't have a passion for any movie, but rather like both godfather films
 
10:45 AM
@FlorianMargaine that's… not a perk?
 
11:13 AM
@tereško If God willing, we have a small celebration in the next Friday for launching the project formally .. The celebration contains Lamtakam's team members. (I know it is almost impossible you come here for that celebration, I just want to be sure), Can you be be present in the celebration?
 
there is no way I could actually be able to do that (even if I had time)
 
you need one of these doublerobotics.com
 
@tereško now == no ?
 
@tereško fix now to no, or he is gonna assume that you are coming. :P
 
sorry, fixed
 
11:15 AM
ah ok .. I just to be sure about that.
 
:)
 
11:55 AM
One does not invite @tereško to the celebration on Friday 13
 
I (finally) received the new motherboard as replacement from the manufacturer, and rebuilt my computer. gods, that was long.
 
Is there any specific event on Latvia in Friday 13 ?
 
oh .. alright
 
morning
 
12:03 PM
o/
 
\o
 
\o
 
12:25 PM
@AlmaDo he said "next"
besides, I dont believe that bullshit about "evil numbers"
 
superstitions bring bad luck
 
12:47 PM
I'm refactoring code. There's a method, All($class), that is overridden as All(). 39 overridden methods, and only 21 calls. None of them call the original method.
 
@PaulCrovella it itself is a superstition I guess :P
 
@Shafizadeh that's the joke
 
ah ok :-)
 
a tautology, I believe no, I'm wrong
 
Hey guys, using phpstan for static analysis, got the following code:
$this->validate(); // throws exception if `$this->obj` is null, which it could be

new X($this->obj);
Where X has: __construct(Obj $obj); // note it can't be null
PHPStan is complaining about this, even though we are SURE at this line that it is not null because we would've thrown an exception. What am I missing?
 
12:54 PM
Just saw a question on quora: "Why is Germany’s economy so good?" and one of the answer was "The primary reason is that Germany is full of Germans.". lol
 
@mega6382 It's not like they have any plans to take over the world... right?
 
Wes
@Jimbo static analysis is not bulletproof
 
I thought it was supposed to be ;)
 
Wes
i mean, other languages in this case would do casting.
 
I think I found Tiffany's hiding spot (gotta look closely to see her)
 
Wes
12:56 PM
but there is no such thing in php. try adding assert($this->obj !== NULL); just before that
 
@Machavity lol
 
@Machavity replace them with kittens cats and you'd be spot on (kittens would be using their claws too much, it'd be painful)
 
@mega6382 or more precisely, it is full of working age Germans: indexmundi.com/germany/age_structure.html
 
hmmm, could be
 
1:17 PM
@Jimbo receiving the $obj in your constructor is not a guarantee that you will assign it to $this->obj
 
@pmmaga $this->validate is in a different object. I did a small example: 3v4l.org/WkL0Y
 
@Jimbo you're missing setting it as a property in the other class?
try that with a docblock for the property which says it won't be null.
wait....what?
 /**
 * @var T|null
 */
phpstan is a static code analyzer not a dynamic one...
 
@Danack Well this is correct, at initialisation time it is null
You have to set it
With this method call anyway, it requires it to not be null
That is not to say that the object requires it to always not be null
 
but that's the point. You've declared the type as nullable, yet the method isn't. And you don't have any guards to prevent it
 
@ircmaxell The $this->validate() check it's not null, that's the guard?
 
1:30 PM
no
 
@Gordon I've done this twice but it was socks. I wear dress socks to work so I just close my gym bag up and take it as a sign to go eat a burger instead of working out. I work out during lunch usually and skip lunch.
 
not in terms of most static analysis engines I've seen
 
Wes
it is, otherwise that line would've thrown
you need a cast. as i said assert($obj->whatever !== NULL);
and if that doesn't work it should work
 
@Wes The line doesn't throw, the code works. But when I run static analysis on it, it says it could be null when it, in this case, cannot
 
A static analysis failure only indiciates that there "may" be a problem. There is 100% valid code a static analyzer cannot check. But if a static analysis passes, it in theory says taht the code is correct (from a type standpoint at least)
 
Wes
1:32 PM
or like danack said, @var Foo $obj
 
Nope, removing the |null now states that the is_null check will always evaluate to false
It's doing much more basic checking than I thought it would
I assumed that a tool like this would be using the AST (I haven't checked the source btw)
 
Wes
it uses the ast
but probably doesn't implement that yet
 
Your assert worked Wes, but not in the validate function, it has to be in the same function as the objects injection xD
 
Wes
code?
 
most likely it's the exception that throws him off? I guess doing a if(!is_null(...)) {... would be fine for the stan
 
1:46 PM
 
Wes
    // assert($this->t !== NULL); works here xD
yes that's exactly how you would put it. i mean, there you would do upcasting in languages that support it
 
Yeah, but if it's in validate(), which is just 1 function call away, it doesn't work
 
Wes
that's not how static analysis work
the type information must be self contained in that scope
in other words you don't want to rely on method B doing its job when statically checking method A
 
Should it not take into account the context, a private method call to validate is not an uncommon scenario
This is like having unit tests vs integration tests
 
Hi guys, I'm debugging a strange bug and I really don't know, what's going on. We have an ecommerce project where we extend a class multiple times, like this: articleObject > articleObjectWithSpecialFeature > anotherarticleObject
We have a magic __call method in our parent class (articleObject) which only throws an Exception (method not found blabla)
The child-class articleObjectWithSpecialFeature defines a new method which I want to call, but that does not work. I stepped into the code with xdebug and I see, that php goes into the __call method. Evaluating the following code in phpstorm/xd
Method-Name is getWeightFactor and I can call that method in my magic __call method like $this->getWeightFactor()
I do not understand, why the __call method is called
I'd expect, that php calls the method directly
any ideas?
 
1:56 PM
is getWeightFactor public?
 
yes
wait, no
it's protected
 
then I guess you are calling it from somewhere where it is not accessible. from the docs:
> __call() is triggered when invoking inaccessible methods in an object context.
 
I feel so stupid
I think I need a break
thank you very much
 
yw :)
 
@Wes have you ever had an issue with phpstorm and writing to your drive in Windows? I try to create a new file in phpstorm, but it says it can't modify a read-only drive. I can create new files and save them into the drive from VS Code. It's happening to at least two mapped drives. Only thing I haven't tried yet is unmapping them then remapping.
 
Wes
2:02 PM
nope
 
blargh
 
@Tiffany try using phpstorm as admin
 
@mega6382 no dice
remapping didn't work either. one forum post I'm reading says it could be antivirus related, and I know antivirus has been installed on various servers recently, so possible correlation
 
@Tiffany go to folder's properties and make sure read-only box is not checked
If it is, then uncheck it and make sure the changes apply to subfolders and files too
 
I was about to protest that it shouldn't matter with a mapped drive, but the folder did have read-only for some subfolders, which is enough to be an issue.
 
Wes
2:15 PM
@Ocramius @Danack who is working on the php-doc spec now? twitter.com/WesNetmo/status/1017774065422159872
 
@Tiffany so, did it work?
 
@mega6382 still testing, but so far no
 
@Wes ask in the FIG ML?
 
Wes
maybe the best way to document "upcasting" would be creating a new variable. so basically not this:

$foo = $this->getFoo();
/** @var Foo|NULL $foo */
if($foo === NULL) throw new Err();
/** @var Foo $foo */
but this
$nullableFoo = $this->getFoo();
/** @var Foo|NULL $nullableFoo */
if($nullableFoo === NULL) throw new Err();
$foo = $nullableFoo;
/** @var Foo $foo */
cc @Jimbo
 
Wooo, thanks Stas for breaking BC on a patch release
 
Wes
2:22 PM
what's that?
 
hmm ... my teamlead will be hating me in about 30 minutes
I sent him a merge request with something like 120 commits
 
I'd hate you too
 
@tereško does he need a reason?
 
@FlorianMargaine which commit?
 
@tereško I would've assumed he did already. :P <3
 
2:28 PM
@tereško I wouldn't mind much if it were just that you changed your mind A LOT about a specific line in the diff, but it's still a 3 line diff :P
 
> Showing 188 changed files with 2165 additions and 757 deletions
 
I'd force you to split it in smaller chunks :P
 
you really cant :(
the project's structure is too fucky for that
besides, it actually is not THAT bad, since a lot of that is unit tests
 
yeah, that helps
 
and the code has something like 90% coverage
oh, and there are also Twig templates
all in all, the real code is under 800 lines, I would estimate
 
2:55 PM
@Jimbo If you want PHPstan to understand your code, you have to write it in a way that it can understand. I suspect that having a 'ValidatedBuilder' class that the validate method returns, is in your future if you want phpstan to understand that.
 
!lxr compare_function
 
@Wes wasn't it people you were picking fights with?
 
Wes
uh?
 
Can anyone tell me what this block is for?
https://lxr.room11.org/xref/php-src%40master/Zend/zend_operators.c#2114
 
@Danack Thanks, but I don't think I'll be doing that. I don't want to have to write valid code in a way that suits a specific static analysis tool any more than I want to write my code differently to fit an ORM like doctrine
 
2:57 PM
@rtheunissen its double !! exclamation points
 
Oh right, thanks @mega6382
 
@rtheunissen ... converted is always false, so this code is weird.
 
I think it's set somewhere? It's just a strange block, I can't tell what it's trying to do because it's passing the result in as well.
 
@rtheunissen well, the whole thing is in a loop, so first time converted is 0, if the branch is entered it's set to 1 so it's not entered again next run
 
That part I'm okay with, it's the conversion itself that I'm not sure about @bwoebi
Like.. what case requires that?
 
3:04 PM
@rtheunissen comparing an int against a string?
 
@rtheunissen any case that wasn't covered before, like array vs int for example
 
So will attempt to convert both op1 and op2 to numbers, got it, so why do we also pass the result to zendi_convert_scalar_to_number?
Ohh okay I think I get it. Looking at the header for zendi_convert_scalar_to_number it's op1, holder, result, silent. So we're re-using the result zval. What's "holder" in this case?
!!lxr zendi_convert_scalar_to_number
 
[ /Zend/zend_operators.c#272 ] `#define zendi_convert_scalar_to_number(op, holder, result, silent) `
 
i think these can never be hit. and at least gcov seems to agree
 
Maybe just not tested?
 
3:12 PM
No, there is no branch that doesn't return here so I don't think it can ever be reached
 
Because that block is the only one that uses op1_copy and op2_copy, can we declare them at the top of that block? Or do they absolutely have to be at the top of the function?
 
@rtheunissen C89 compilers unfortunately...
 
I am fairly certain it's top-of-block, not top-of-function.
 
@tereško where do you set up the connection to the database via PDO in github.com/teresko/blank?
or is that not included in the project?
 
@tereško Interesting podcast about medical history. Maybe you'll like it. maximumfun.org/shows/sawbones?page=23
Synopsis: Dr. Sydnee McElroy and her husband Justin (that's us!) are thrilled to welcome you to Sawbones: A Marital Tour of Misguided Medicine. Every Friday, we'll be digging through the annals of medical history to uncover all the odd, weird, wrong, dumb and just gross ways we've tried to fix people over the years. Educational? You bet! Fun? We hope!
 
3:25 PM
@LeviMorrison that's what I thought too.
 
Easy test, run GCC with -C90 -pedantic.
 
@StatikStasis like actually you and your wife?
 
No- the shows creators.
=p
I wish I had a doctorate without the work.
 
it doesn't say "that's us!" in the description I'm guessing you copied it from, that's why I was asking
 
3:33 PM
I was hoping that wasn't it
 
heh, why :D
 
wanted to see an example of PDO connection being defined and how it's used in a codebase
 
@tereško There is just too much yaml in that project
 
refactoring code, and I'm not sure if an error I'm encountering is related to it not using the $connection object that I've defined in the config file, or something else entirely. reason I thought it might be the $connection object is that phpstorm is saying it's undefined in a different class
 
why? how it would help?
 
I have a test file that I'm also trying to do it manually, but I need to add error reporting to it because I'm not sure if I'm doing it correctly in there either, or if it's working...
 
I mean, sure, it's a valid bug fix. Just not nice in a patch release.
 
@FlorianMargaine ah, indeed, it should have landed on master only
 
3:47 PM
coming from someone who complains all the time about BC, it's a bit ironic
 
Every change is backwards incompatible, it's a question of how much you care
 
semver is fundamentally broken for that reason
 
I don't think it's fundamentally broken, there's a case to be made about "sensible" backwards incompatibility
For example, adding a new function, while technically backwards incompatible, isn't likely to affect anyone using the current version of the code.
 
suddenly breaking all the builds of people running tests but not necessarily checking them for all the extensions is not a nice thing, either way
 
4:01 PM
Could someone have expected that a call to that function result in an error? Sure (especially in a language like JS, where you can literally catch syntax errors)
It's just not very likely.
 
@NikiC the mystery is that it compiles a function header (push,pusb,sub,mov) for POST_INC (the function size is now nearly double)
 
@MadaraUchiha semver isn't so much broken as it is a myth, as it doesn't allow room for that nuance "PATCH version when you make backwards-compatible bug fixes."
 
Of course semver has to be taken with a grain of salt
Even if everyone plays nice, bugs happen, regressions happen
 
Anyone have access to reopen an issue on github? github.com/php/php-src/pull/2672
 
npm used to be "pure" semver, that is, every time you npm i, you'd get the latest possible version as defined by your semver
For every dependency in the dep tree, all the way down
 
4:04 PM
what everyone doing semver is isn't semver, it's an application of the idea behind semver done practically
 
For non-trivial applications, builds would break weekly, if not more often.
Now npm (and yarn, its competitor) generate lock files that lock version dependencies in place all the way down, until you upgrade a package.
So If you said you wanted ^1.0.0 you could get 1.0.9 now, but if 1.0.10 came out, you wouldn't get it until you explicitly opt in to it
 
yes, like composer has been doing since basically day one
 
How does composer handle these things?
 
@NikiC reason: zend_verify_ref_assignable_zval accepts more than two parameters...
 
@FlorianMargaine Neat
 
4:07 PM
npm is waaaay out of date w.r.t. this
they waited until npm 5 to get the lock file
it's a joke
 
No, they wait until yarn came out and starting being a serious competitor
 
heh. a npm lover colleague kinda ripped my head off when I dared propose our php's package manager was much nicer to use
 
I don't even like poking fun at npm anymore, I just feel bad for them
 
@FélixGagnon-Grenier Your npm lover colleague never used npm > 4 with 100+ top level dependencies
 
4:09 PM
we generally try to keep it under 50, yes ;)
 
Because had he, he'd known that back then, builds would break on an almost daily basis
 
Because think that you rely on dependency A@^1.0.0
And A would rely on B@*
Because A is misbehaving
Every time you'd npm i, you'd get the same version of A (as long as 1.0.1 hasn't come out yet), but the version of B would be "whatever"
 
@StatikStasis you do know, that when you ordinarily post a url in chat, that not the whole url is visible? there is always ... at the end of long urls. better luck next time :P
 
4:11 PM
Now imagine this sort of behavior all the way deep into the dependency tree
And imagine that tree with 100 starting dependencies at depth level 0
Madness
 
yeah, that's... a mess
 
People would commit their node_modules directory to git to avoid npm iing
 
@mega6382 it's a typical noob error.. we might want to add it to the guide
 
lol
 
I try...
 
umm.... I'll pass.
Ok I couldn't resist. Glad I clicked.
 
4:38 PM
Largest hornet nest I have ever seen. youtube.com/watch?v=QJ8ls5oN3ps
 
o_O
what's he spraying?
 
whatever it is I'd want it in something more than that tiny can
 
after he removes the nest, the amount of hornets flying around the camera drops drastically
 
@Tiffany Not enough.
@PaulCrovella Exactly.
 
that's what the suit is for :P
 
4:44 PM
I would consider the whole building a total loss and just set it on fire.
 
5:01 PM
Is it possible to set an internal function typehint to "self" ?
 
@bwoebi ugh
 
@rtheunissen internal function? just provide the pointer to the appropriate class (“self” is just a shortcut for that really)
 
Ah of course of course. Thanks @Andrea
 
np
(wait, do internal functions use class pointers or class names for typehints? might be the latter, it's been a while)
 
I think *ce
 
5:16 PM
@NikiC bad reason sorry … the actual reason is that var_ptr may still be used afterwards and needs to be backed up
gcc is not that clever yet
working on it
 
Wes
5:47 PM
evenings
 
o/
@Tiffany @PaulCrovella A doc about Africanized Bees (killer bees). youtube.com/watch?v=luszv798bYc
Very interesting.
 
00:00 - 18:0018:00 - 00:00

« first day (2827 days earlier)      last day (2118 days later) »