« first day (2290 days earlier)      last day (2658 days later) » 
00:00 - 15:0015:00 - 00:00

12:38 AM
$ yum search php | grep ocramius
Redirecting to '/usr/bin/dnf search php' (see 'man yum2dnf')

php-ocramius-instantiator.noarch : Instantiate objects in PHP without invoking
php-ocramius-code-generator-utils.noarch : A set of code generator utilities
php-ocramius-lazy-map.noarch : Lazy instantiation logic for a map of objects
php-ocramius-proxy-manager.noarch : OOP proxy wrappers utilities
php-ocramius-generated-hydrator.noarch : An object hydratork
@Ocramius ........but why is that stuff Fedora's repo?
 
Wes
@Ocramius i'm not sure what you mean with identity. my definition of identity could differ from yours :P evenings all
if you have obj1 of class A and obj2 of class AProxy extends A, they will have different identity anyway. if you mean the variable handle id
 
@Danack no idea: remi likes packaging pretty much anything
I couldn't care less or their own distribution shite
I'm more and more or project-local dependencies, and huge binaries
@Wes in a (decent) ORM, you usually only have one mutable instance per identiier, and identity is checked by object address
so $a === $b && $a == $b, basically, for every decent ORM :-P
unless immutability is in place, which makes things a bit simpler, but harder to write in PHP
 
Wes
12:56 AM
can't you do that with virtual proxies too? you only pass around the decorated instance
the only problem is when stuff return $this; (where $this is not the wrapper but the wrappee) as you said, for fluent interfaces
 
@Wes not possible, as you may have API which unwraps the proxy
a lot o bad shit can happen with the visitor pattern as well
so you basically have to have one single object in memory
in addition to that, ghost objects are the most efficient proxies (in PHP)
so memory usage stays decently low there
 
Wes
can you write me a simple example? i've understood what the problem is but not sure if there is any advantage for solving it by using ghost objects. i'm a bit confused
 
public function approveRequest(InvoicingSystem $invoices) {
    $approval = new Approval($this);
    $invoicingSystem->approved($approval);
}
example is a bit rough, but this is basically passing $this to an Approval instance (possibly to also be managed by the ORM)
now the ORM needs to check all proxies and all real instances too
This also breaks not just on ORM, but also i the instance passed to Approval is compared to the proxy instance
so a lot of code relying on === is broken
 
Wes
so you are saying that code should pass to Approval the $this that is decorated, but that is instead the raw one. correct?
what i'm missing is, isn't that a problem for both wrappers and ghost objects? the identity is different in both cases
 
$this is the proxy for ghost objects, whereas it is not a proxy for virtual proxies
no, in ghost objects the identity is the same
 
Wes
1:09 AM
aw not understanding :P
 
I suggest you to read the generated code then - simpler
 
Wes
i mean, you got to do some magic anyway in both cases
i remember that
 
yes, but in one case you pass an existing instance, in the other one the instance is created for you
 
Wes
can you point me to the relevant code in proxy manager? thank you very much :B
 
in the first example, you populate the properties of the proxy. In the second one, you produce a "real instance" that is going to be the wrapped one
 
Wes
1:34 AM
@Ocramius :( i (think i) get what you are doing but not the purpose... is the goal avoiding that other instances apart the proxy itself are created? in that case, why aren't you doing
class FooProxy extends Foo{
    function init(){
          $this->wrappee = new Foo();
    }

    /* ... */

    function someMethod(Foo $foo){
          $this->initIfNecessary();
          $foo = $this->unwrapIfNecessary($foo);
          $return = $this->wrappee->someMethod($foo);
          return $this->wrapIfNecessary($return);
    }
}
 
Because that's an assumption
PHP is not a strictly typed language, so I have no way to:
 
1) figure out whether an interface is fluent
2) figure out whether an interface is immutable
3) figure out if strict interface boundaries are intended, or if something completely new is retrieved
in addition to that, I will NOT modify the AST of the methods without a safe way to do so, and in PHP there's nothing like that
Forgot about this detail, but it's an interesting one: lazy loading ghost objects work with APIs that use a dynamic number o parameters, whereas all wrapper proxies don't work with it
In general, the ghost object is a much better choice in basically every scenario
but requires complex initialization procedures
Meanwhile, reading about GHC.IO.Unsafe :D
 
Wes
figure out whether an interface is fluent > why? if you wrap / unwrap as appropriate anything will just work... :\ sorry for the many questions...
 
@Wes btw, most of the stuff above is tested by various scenarios in the proxymanager test suite
 
Wes
1:41 AM
still missing what's the point of that
 
@Wes no, wrapping/unwrapping introduces assumptions that the thing you are wrapping wasn't passed on to something else (example above)
class ThisIsTheEntity {
    public function approveRequest(InvoicingSystem $invoices) {
        $invoicingSystem->approved(new Approval($this));
    }
}
how do you make approveRequest pass the proxy to the Approval?
assuming that ThisIsTheEntity is the proxied entity?
(rewrote it for simplicity)
The only solution here is to rewrite the AST in the proxy, but that's a very risky operation that requires a safe language first
 
Wes
well, in that case you should override the method so that $this doesn't get unwrapped, no?
 
"you should override the method so that $this doesn't get unwrapped, no?"
how?
function replaceAllThisUsages(AST $ast) : AST {}
but that's a huge mess, and doesn't include scenarios where include, get_defined_vars(), eval() and so on are used
 
Wes
sadly rewriting the same thing entirely, i think. not really convinced of what i'm saying though... :P
 
I cannot write a code generator for that that I can consider "reliable" within the next 10 years
the current solution of simply getting rid of $proxy !== $this - that works perfectly
 
Wes
1:49 AM
have you tried doing $reflectionMethod->getClosure()->bindTo($anotherThis, ...) ?
 
getClosure() is a mess and fails with so many different scenarios
I also think that bindTo for that specific scenario was disabled at some point, but I need to check
It also would still break the func_get_args() approach
and cause massive overhead too (which the ghost object got rid of)
@Wes I don't understand why you are so bothered by ghost objects here. Anything specific?
 
Wes
honest answer: i need some proxing whatever tools and i'm very confused by your proxy manager :P but i'm starting to understand why it looks so messy
especially the ghost object part..
 
All I can tell you is that the thing has 624k of sources and 1.2M of tests for good reasons :)
So go with something that fits your use-case 1:1 first, then report issues if you find any. Unless it's something very weird, it is probably already in the test suite
 
@Ocramius Other than running up a github score?
 
I wish - PM's domain is a bit complex, so it's likely a week of thinking or each dozen commits
The project even started on paper :'D
(then I rolled the paper with some weed)
 
Wes
2:02 AM
tl;dr problem: php should have overload for equality, including identity (for "transparent" proxies)
 
@JoeWatkins have you heard anyone who knows what they're doing when it comes to building PHP for RPMs complaining about the build process writing to the root?
   /.channels/.alias/pear.txt
   /.channels/.alias/pecl.txt
   /.channels/.alias/phpdocs.txt
   /.channels/__uri.reg
   /.channels/doc.php.net.reg
   /.channels/pear.php.net.reg
   /.channels/pecl.php.net.reg
   /.depdb
   /.depdblock
   /.filemap
   /.lock
I guess that's the pear builder running pear and it writing some data to the 'current' directory?
 
@Wes NO, PLEASE NO.
that is such a mess :S
 
Wes
lol, i was expecting it..
 
@Wes I'm for fixing root causes, rather than symptoms ;-) Fixing symptoms is much like fixing cancer with aspirin
yes, the headache may go away for a few hrs :P
 
Wes
that for me is a root cause :P
equality overload is standard in any language that makes sense
 
2:11 AM
Nah, the root cause is the lack of property accessors here - being able to bind to access to a single property would remove the need for the proxy here
the proxy is the closest solution to implementing the accessors
overloading is scope creep to me
It's basically adding an operation to a class/type, yet keeping the original name (smell)
alright, off to watch some more haskell talks
laterz
 
Wes
\o thanks for the talk, very enlightening <3
 
 
1 hour later…
3:20 AM
@Jeeves heylo
 
@littlepootis <html>
 
 
1 hour later…
4:39 AM
@NikiC @bwoebi Include statement bodies or not?
Doing final prep to move to discussion soon.
 
Wes
i'm not sure about the syntax. feels like it should be simpler, as i told you before. have you considered letting people vote which syntax should be used?
 
Yeah. RFC by voting isn't very popular though.
I mean, what if I put it to vote with 3 sub-votes and the community manages to pick the worst ones in each set?
 
Wes
you only propose solutions that you equally like @LeviMorrison
return ($x, $y) {= $x * $y; there are infinite (well... pretty much) combinations of two characters that could be used... using 4 feels a bit unnecessary
{=
{>
{{
i like { particularly because it resembles visually a function
but anything 2 characters is fine for me
 
Leading with ( will not work
The prefix must be unambiguous.
 
Wes
because it requires look forward?
 
4:49 AM
It requires arbitrary look ahead.
 
Wes
yeah that. forgive my lack of terminology :B
 
It's fine to require finite look-ahead, even if large, but arbitrary fundamentally changes the way our parser works.
 
Wes
i see
 
fn (parameter_list) expr is unambiguous; we don't need =>.
 
Wes
in that case there's nothing much you can do. fn seems a valid prefix, as function would be too long and make the whole thing pointless
why not that then?
 
4:56 AM
But if you use a return type... fn (): array [1 + 2]
 
Wes
ah, right
 
It just looks weird.
 
Wes
it looks weird but i wouldn't care personally. i rarely use types with closures...
 
I believe we'd need to move to a GLR parser, which is doable (and not even difficult) but it's not desirable.
 
Wes
but even if i did actually it's just about getting used to it, after all there is a space that separates
 
4:59 AM
Currently we are LALR(1) or LALR(2) or something.
 
Wes
fn(Int $x, Int $y): Int $x * $y;
yeah i like this.
 
I think we might be able to form really painful and horrible grammar rules and avoid it but when I say painful and horrible I mean it. It's really difficult.
 
Wes
:(
 
I started doing it just to make sure that it was as difficult as I thought. It's definitely horrible.
If we had a hand-written parser we could do arbitrary look ahead in this one case and that might not be quite so bad, but it's still not desirable because anyone who wants to parse the language now has to move to a more powerful grammar parser.
Basically you have to explicitly write all the partial rules out by hand starting with (
And then you have to write matching suffix rules.
And I think the only way to know if it is possible is to have successfully completed it.
 
Wes
are you referring to () {> ? or fn($x, $y):Int $x * $y
 
5:11 AM
If we were to drop the prefix altogether and do (parameter_list) => expr
 
Wes
the prefix could actually be better. we read from left to right and that's definitely more clear than "something in the middle" that exists at some point later in the line, or even in the next lines
 
One question: every day I want to start codding on my project (we are a team), I update my local directory by git pull origin master ..! Now I want to know, is what I'm doing correct?
 
Wes
return foo(($a, $b, $c ............................ {>
           ^ dunno what's this till i reach    this ^
return foo(fn($a, $b, $c
           ^ i immediately know what it is
 
In this case though it would be nice to match JS/C#/Dart.
 
Wes
so maybe getting rid of => rather than the prefix could be better. again i wouldn't mind
fn(int $a): int $a;
if($a)
    echo $a;

while($this->x())
    $this->bar();

fn(int $a): int
    $a;
it's not too unusual, imho, if you watch it from this perspective
dunno...
 
5:21 AM
But those forms never have : type after them...
And they usually do multi-line...
Short closures want to avoid multi-line...
 
Wes
can you make => required only if there is the return type?
or the opposite, => optional if there is no return type, in a second rfc?
 
Yes, you could require => with return types but optional if you don't do a return type.
 
Wes
i think i wouldn't hate that :P but again i don't often do these things. maybe having an unambiguous syntax that always look the same is more important
 
You tend to like complicated grammar rules ^_^
 
@LeviMorrison I don't understand this part:
fn(int $a): int
    $a;
Can you please rewrite it by a basic syntax?
 
Wes
5:26 AM
you don't understand because it doesn't exist @Shafizadeh
 
It is theoretically equivalent to this:
 
Wes
ignore it... :P
 
function (int $a): int {
    return $a;
}
 
@LeviMorrison ah I see .. great thx
 
But it isn't accepted syntax.
 
5:28 AM
@LeviMorrison "it isn't accepted syntax". "it" refers to either that one or yours ?
 
ah ok :-)
 
Wes
last issue, would it make sense to change => ? it's two characters, could be one, and looks like => of arrays (maybe matching other languages is more important?)
$c = fn(int $a): int { fn(int $b): int { $a + $b;
$c = fn($a){ fn($b){ $a + $b;
 
@LeviMorrison can you please give me the link of your syntax in the documentation? you know, I've never seen : after a function so far.
 
Wes
apart from this i'm convinced that fn()=> is the only option :P
 
5:32 AM
@Shafizadeh It's called a "return type"
 
ah ok, I'll search about it
@LeviMorrison thx
 
Wes
fn()> also looks cool
fn(): Int > 22;
 
@LeviMorrison is this just belong to php7? or it been exist in the old versions?
 
@Shafizadeh It's new in PHP 7.
 
ah good :-)
And my last question in this hour: In English, "or it been exist in the old versions?" is correct?
"the" is redundant, right?
 
5:35 AM
Yes.
 
alright :-)
 
"or did it exist in older versions?" is more correct, though.
 
ah ok
 
Wes
i'm totally convinced about the fn prefix though. it's defintely better than likely to happen couple of opening parentheses whatever_func(($param, $param .... )
function array_values_from_keys($arr, $keys) {
    return array_map(fn($x)> $arr[$x], $keys);
}
this is how i would write it, i'd try to save spaces
but if it had the return type, i would write it fn(int $x): int > $x;
 
morning
 
Wes
5:42 AM
thoughts about this?
hey linus
 
Hi Wes
 
user895378
@Shafizadeh @LeviMorrison is responsible for the addition of return types to the language ;)
 
Wes
@Jeeves you only speak html today?
 
@Wes <html>
 
Wes
indeed
 
5:52 AM
@rdlowrey :)
 
user895378
Poor @Jeeves ... he doesn't know what to do when his best friend, CleverBot, is unavailable.
 
@rdlowrey <html>
 
When I pass a very large array in nested anonymous functions using "use" keyword does the array get copied each time?
e.g func() use ($largeArray) { func() use ($largeArray) { .... }}
 
Wes
@codinginsane no
 
great!
 
Wes
6:00 AM
copies happen when scope is changed and only before you actually modify the thing
basically you can pass around the array and as long you don't modify it it will always be one copy only. but if you try to modify it then the copy will happen @codinginsane it's said "copy on write"
it's the same for strings though. although one doesn't usually modify strings ($str[5] = "a";)
 
posted on January 22, 2017

New Cyanide and Happiness Comic

 
6:20 AM
What is the problem in my str_replace ?
str_replace("\\","\\\",$shareit2);
I need to replace \ with \\
 
!!dad
 
Why did the scarecrow win an award? Because he was outstanding in his field
 
 
1 hour later…
7:29 AM
Guys, can anybody understand the point of this image? ^
what's the meaning of "show off" exactly?
 
brag
 
what's brag mean aye
 
boast
 
so the image means "purple color is great" ?
 
7:53 AM
\o
 
Wes
8:23 AM
Mae Jemison there is either ironic or daltonic because purple is an awful color :B
mornings
 
8:49 AM
mornin
@kelunik you were thinking about asynchronous streams like they are in C# ? msdn.microsoft.com/en-us/library/kztecsys(v=vs.110).aspx
With async and with await keywords even ?
 
@brzuchal That's the end goal.
 
Nice, I like it.
I'we read on this docs that there were at the begining obly Async and Await methods like BeginRead and BeginWrite etc.
So those new keywords actually stands only for streams?
 
I'd just make the internal functions return promises and await generic like our current yield coroutines.
 
Nice.
 
Wes
@kelunik morning. earlier i needed:
class Foo            { function bar(){} }
class Qux extends Foo{ function bar(): int{} }
will you do that soon? :D
 
9:08 AM
@Wes It works already.
 
Wes
wut? :o
 
!!> class F {function x(){}} class G extends F {function x():int{ return 42; }} var_dump((new G)->x());
 
Wes
holy shit. i thought it only worked in certain cases, like iterable
 
[ 5.6.0 - 5.6.30 ] Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/RbWKU on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
[ 5.6.0 - 5.6.30 ] Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/bAbHY on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
 
Wes
9:18 AM
so now the next step is full variance :B
 
morning
 
9:36 AM
O/
 
9:50 AM
@Wes In PHP 8 then, yes.
 
Wes
kill me :B
@PeeHaa @Leigh almost tempted to write a program that just draws a line on the screen and that is a bit see through youtrack.jetbrains.com/issue/IDEA-99875
how hard can it be..
 
10:08 AM
hiii
 
mornings
@Wes I know...
 
mornign
 
10:24 AM
@Jeeves is cleverbot still blocking us?
 
@PeeHaa <html>
 
damnit
 
10:38 AM
Perfect.
 
it's really not :P
Now I will have to fix it
 
@PeeHaa Did you ask for an unblock?
 
Nope. I don't think there is much use because they don't actually actively support scraping of their bot :-)
 
11:04 AM
\o
 
yojoe
 
yo
@NikiC can you make a PR (with test) for #73960 please
 
@PeeHaa Suggestion: Use a bunch of different bots (or different instances of bots) and rotate between them so that the scraping would be distributed
 
also thanks for figuring it out ... I didn't even try yet ...
 
i.e. not just Cleverbot, but also other kinds
 
11:08 AM
Hey all, .htaccess file isn't working for me in a certain directory. Scary enough, the uploads folder. I checked vhosts.conf, httpd.conf for any overrides, and nothing. It's working in /public_html but not public_html/uploads O.o any ideas?
 
@MadaraUchiha yeah, but I am bad
 
public/uploads is forbidden, cool, but .mp4 files in there are still opening up.. I had order deny, allow deny from all. There any config files in base installations i'm overlooking?
 
23 hours ago, by PeeHaa
Not sure if I implemented pandora yet
I didn't :P
 
Hello, native English speakers, are you there?
 
sunny, dry, bike out ... lata
 
11:20 AM
@JoeWatkins Please be careful. If not for us do it for the coming PHP releases :P
 
From loads of English movies, I notice native Speakers tend to play with the word "yet". Sometimes native speakers won't instantly append the word "yet". There will be a pause and then they suddenly utter "yet".
 
yeah, so?
 
It's not present in Chinese and I find it cute.
 
oh god lol
 
Anyone know how to get PHPDBG for PHP 5.6 and PHP 7.2 on Travis?
 
11:23 AM
This point wouldn't be taught in class.
 
Alternatively, pull requests to fix travis-ci.org/sebastianbergmann/php-code-coverage/builds/… would be more than welcome ;-)
 
@SebastianBergmann Might do that today
 
@SebastianBergmann The issue on 7.2 is xdebug missing, not phpdbg missing.
 
You may find it so usual a thing. But to us English learners, there's a little surprise.
 
ThW
morning
 
11:28 AM
I don't think too many English learners notice this.
 
Day 2 of Fedora experience; machine is dead and refuses to boot after installing updates.
 
Zhengquan, "yet" is mainly used in books and movies/shows. I don't know any people that would normally use it. It's for "dramatic" or suspense like parts, or to show confusion while thinking.
Normal use is "I didn't do it yet"
it's weird if it's like, "I couldn't do it, yet, I will find a way"
 
Yes. I notice its particular use when there's something dramatic going on. I do kinda feel it's not a usual "yet".
 
No offense at all, you just reminded me of this video. youtube.com/watch?v=nN93Jz7N4Xw&t=6s lol
 
I notice it in movies. But I'm not a native English speaker, but sometimes I feel it's not a usual usage when a character say it. From what I can tell, it causes a bit of surprise or a particular feeling.
 
11:37 AM
"The english learner" haha jk.
no clue, what ethnicity you are, no matter, just the thought came to mind.
it's a pretty interesting video though
 
@Darius God, your video is so funny. I'll watch it till the end.
 
11:52 AM
@SebastianBergmann and you don't really want phpdbg on 5.6 … it doesn't have coverage there or such
@LeviMorrison leave it in future scope for now - if someone wants it they can add it later.
 
made it to the end
@Darius The speaker mainly focused on two points. 1. Friendship is based on shared hobbies. Don't use me as a language learning tool just to practice English and say something I'm not interested in. 2. Northern Chinese people are easier to get along with than southern people.
 
Yep! that's what the video said.
it was interesting for me to hear too, because I'm planning a trip to China with my girlfriend this year.
so been curious about the culture there.
 
I bet there will be something impressing you and you'll have a great experience.
 
yep, looking forward to it.
 
12:08 PM
I admit that I'm an introverted guy and don't have too many friends. But I won't grab a foreign guy and keep talking to him things he's not into.
 
@Danack should have installed Arch
 
@Darius There's something I haven't make out yet. When the video is played till 2:23, what does the speaker say?
It sounds to me something like
"The speaker are language and the society right?"
Can you help me please?
Btw, how come I reminded you of that video? I was just seeking help from native English speakers. That's a good thing. English will be more accessible to and widely used in other non-English speaking countries.
 
Just asking about english in general, seeking to learn. No other reason than that.
I can't find that part that you mentioned in 2:23, anyway, lets get back to PHP talks here before we get kicked off.
 
12:23 PM
okay
 
right?! haha
 
@Danack Sounds about right
 
@MadaraUchiha "about" means "almost" in here?
 
@Shafizadeh Close, yes.
It means "about", or "pretty much"
 
12:37 PM
ah ok
 
"more or less"
 
got it
Oh, today is @tereško's birthday ..! Great :-) ..! Happy birthday buddy ;-)
 
@Shafizadeh 3 days ago, but still 😛
 
really!? too bad :-( ...! btw, are you on the phone? @MadaraUchiha
 
12:46 PM
then how did you make this emoji? 😛 (copy/paste from elsewhere?)
 
1:20 PM
@kelunik Right, my bad.
@bwoebi True, thanks.
 
Wes
@PeeHaa if i find the strength to compile wxphp i'll do it. or i could do it with java
i think i know how to do it with java. it's a swing window with no frame that is one pixel wide and takes the whole screen's height, and it's transparent. then a form to customize the position
must be about the same with wxphp
 
hello guys
 
@Wes That would be great
 
Wes
actually i could use the thing @JoeWatkins did
 
What's that?
 
ah
 
Wes
poorman solution would be make a pic, open a chrome window, make it full screen and then use 7 taskbar tweaker to make the window always on top and semitransparent :B
if you are on windows...
 
That sounds awful :P
 
Hello guys need help with this please its urgent. stackoverflow.com/questions/…
 
Wes
trying with java. at least with java i have a vague idea on how it's done. i once even did a tray icon with awt :B
it was particularly hard at the time because it wasn't supported natively
240kb/s pain
 
1:42 PM
@Wes I feel for you
But over half a gig for an IDE is... wow.
They've gotten fat, really let themselves go.
 
Wes
1:56 PM
download time is going up rather than down...
 
Wes
2:08 PM
@PeeHaa how often you resize the project view panel in phpstorm?
 
Hey guys, mind taking a quick look?
http://webmasters.stackexchange.com/questions/103087/spam-subdomain-in-russian-in-my-website (Spam russian subdomain in my website)
 
check your DNS records for a subdomain cName
if it's not on your server, maybe it's pointing to a different server.
A record, cName, I forget. one of those
 
I already did, it's clean there
at least in cPanel
if it's not in my server, how could they hijack my domain like that on Google?o.O
 
check domain registrar, but unlikely to be there.
If it's a vps, and you have access to it, check for a manually created vhost entry
maybe it's something cpanel isn't picking up
 
Hello
$_SESSION['var3'] = $nome;
	var_dump($_SESSION['var3']);
and i have that output
string(6) "squash" string(6) "squash" string(6) "squash"
and in another page
$nome = $_SESSION['var3'];
var_dump($nome);
string(6) "squash"
the output don´t need to be same?
 
Wes
@PeeHaa i just realized i suck with gui oop design. not sure how to organize the components :\
 
00:00 - 15:0015:00 - 00:00

« first day (2290 days earlier)      last day (2658 days later) »