« first day (3392 days earlier)      last day (1539 days later) » 
02:00 - 14:0014:00 - 23:00

2:57 AM
I love that php is most searched on Google in the state of Utah.
What makes Utah so special?
 
 
2 hours later…
4:28 AM
 
o/
Nice. Having an early morning recording session?
 
I was, now listening ... I don't get to listen when I play really, it's been coming out like this for about three days now first thing in the morning, so I thought I'd hit record ...
it's not an arrangement so to speak ... I don't know what I played, I don't remember
I mean obviously, I know roughly what it looks like, but I remember none of the details of what I just played ... I have to listen, which I don't really do much ...
 
More fun than my morning writing test cases \o/
 
4:45 AM
yeah, now to normal stuff, walking dogs and hassling kids to get up ... lata ...
 
4:59 AM
The US is #76 on the list for search volume "php" over the last 5 years 😲
The top are: China, Nepal, Armenia, Tunisia, Latvia, Sri Lanka, Philippines, Estonia, Bangladesh, and Pakistan.
Who knew.
And apparently Nepal and Myanmar have seen explosive search volume for Laravel over the past two years.
This is either a botnet that's looking for Laravel exploits or those guys really like Laravel.
 
5:54 AM
We don't have a method to detect if a property is defined but unset do we?
 
@MarkR isset() works
 
Unfortunately it also returns true if it's null, as does property_exists
 
That's the definition of unset.
 
Ah yes, sorry I meant uninitialized
 
To PHP those are the same thing
 
5:59 AM
Not with typed properties they're not.
 
I don't know nothing about typed properties so ... unless something has fundamentally changed under the hood, PHP has no concept of variable declaration. Thus, uninitialized, and not set, are one and the same.
 
It has changed (or more accurately was brought to the fore) with typed properties. Attempting to access a typed property which has been defined but not initialized triggers a fatal error
 
I'm sure that's a compile-time check.
I don't see how it affects runtime in any way
 
Nah, runtime.
The PHP engine doesn't perform compile time checks against property accessors, only their definitions to meet LSP
I think I'll have to bodge it and just use docblocks to hint it as X|null|false and initialize to false so I can do an explicit check
 
The fact that that doesn't trigger an error tells me nothing has changed about how PHP handles variables.
 
6:05 AM
You're using isset() which looks up the table directly
 
And?
You asked how to check if it was unnset.
I don't see what the problem is.
 
> Ah yes, sorry I meant uninitialized
 
7 mins ago, by Sherif
To PHP those are the same thing
 
They're not.
 
They are, but perhaps you're looking for property_exists?
 
6:08 AM
I don't think we ended up adding a 'check if initialized' method.
 
If it exists and is null then it's uninitialized.
 
That's no longer the case in 7.4
 
I don't know what to tell you. You seem to live in a world where the rules of PHP are made up. Sorry, I can't help you further.
 
I'm looking at the C source code for it right now
 
Morgens
 
6:13 AM
Moarning
 
Specifically, the ZVAL has an additional flag on it called IS_PROP_UNINIT, the comment is:

/* Properties store a flag distinguishing unset and uninitialized properties
* (both use IS_UNDEF type) in the Z_EXTRA space. As such we also need to copy
* the Z_EXTRA space when copying property default values etc. We define separate
* macros for this purpose, so this workaround is easier to remove in the future. */
Morning Peehaa o/
 
o/
 
I can't tell if this guy's scamming or what
Seems legit. Looks legit. Sounds legit. But his emails are totally outta whack
 
7:06 AM
@MarkR yeah! Isset kinda works, also i added ReflectionProperty#hasDefaultValue last week, but property_initialized also sounds useful /cc @NikiC
 
@beberlei So property_exists() && isset()?
 
@beberlei I'm sure it would have some uses, although with 8.0 and typed unions I wouldn't be trying to pull the workaround of wanting to use PROP_UNINIT as a quasi-union type to see if I needed to initialize a property which could be a null
 
@Sherif no this is still true for private $foo; which has a default value of null
 
@beberlei how can null ever mean isset() == true?
 
Ah i mean its false
 
7:15 AM
right
 
So you cant differentiate between it and private int $foo(;
 
@beberlei Sure you can
 
array_key_exists(‚foo‘, $reflectionClass->getDefaultProperties()) is the only way I believe and its espensive
 
@beberlei 3v4l.org/lfpJG
I really don't see what the problem is
‾_(ツ)_/‾
 
Try it with ?int
 
7:19 AM
Don't need to.
I already know what it does.
 
And what does it do?
 
Exactly what it's doing now.
 
How? isset() will return false on the null even though it has been initialized.
 
If it's null it's not initialized.
 
I don't think you're familiar with 7.4 initialization flags.
 
7:21 AM
But if you insist, you can add a check for propterty_exists and === null
Has nothing to do with 7.4
 
@sherif i want a function that returns true if and only if its uninitialized property
Your case is wrong for private $foo;
 
@beberlei No, it's not: 3v4l.org/XSJHV
boring problems are boring
 
If you check for === on uninitialized property it will throw exception
 
Yes
Tell me something I don't know
 
wiki.php.net/rfc/use_global_elements - why? I mean, it would maybe make sense to have built-in functions be "superglobal" (i.e. strlen, in any namespace is always \strlen() (namespace overrides are horrible hacks :-D))
but a declare? naaah
 
7:28 AM
no more declares please :(
 
I'm not sure how I'm going to vote on that one yet
 
This code „works“ but its expensive and not easy to use everywhere, this is what mark says for many messages bow, there is a function missing
 
@beberlei No more expensive than how a built-in function would do it.
But whatevs... I'm not one for solving non-problems. I'll leave that to the takers.
 
It should be in the order of msgnitudes faster for the case where the exception gets thrown
 
On account of all those extensive benchmarks you've done?
I don't know that it would be faster. But if you can prove it great.
I'm all for faster implementations.
The Big O in me, however, suspects you're wrong.
Everything about this code scales linearly, so I see no reason to suspect an order of magnitude in difference anywhere.
 
7:38 AM
Benchmarks @ 1 million iterations on 7.4.2:

Try / Catch on failure to access uninitialized property: 0.372 seconds
Property read (near identical to a helper function) : 0.007 seconds
So not quite an order of magnitude... just 5x slower
 
Not sure how you wrote a C implementation so quickly and bench marked it, but I'll take your word for it
 
I didn't have to, I just hit zend_std_read_property instead. The mechanism involved would be functionally identical. The only difference would be the past the uninit_error label
 
this comes directly from my work on hasDefaultValue
0.039167
0.002249
 
@MarkR No it's not. property_exists is the most expensive part of this check.
Because it's O(n)
 
???
@Sherif you rub me wrong this morning i don't know with the way you reply it feels very rude to me, but you forget that the difference between PHP and C is an order of magnitude, independent of I/O or anything else. please be a little more kind.
 
7:46 AM
@beberlei There's a button for that :-)
 
@beberlei That implementation is checking if the value in the CE is uninitialized but not if the value within the object is initialized, right?
 
@MarkR ah yes
 
I was thinking more along the lines of pull the property offset, pull the zval and check if the uninitialized flag is set.
 
@beberlei Please don't make assumptions about my knowledge and I promise not to make any about yours :)
 
@Sherif i don't make assumptions, its a fact that property_exists is not O(n), it is a hash lookup inside the engine: github.com/php/php-src/blob/master/Zend/…
 
7:57 AM
Facts are provable
It is worst case O(n)
 
@Sherif yes it loops al entries in "one" bucket. which is usually of the size 1, so it doesn't loop at all. please read up on how hash maps work before lecturing me: en.wikipedia.org/wiki/Hash_table
 
And you think I'm rude
I'm gonna disengage now. This conversation is no longer constructive.
 
Toodles.
Me: Changes one thing in a zend .h file
CLion: I have now decided that I want your CPU to die.
 
8:16 AM
I'm torn, but I don't think I can get behind arbitrary order resolution order for class vs function lookup, unless I missed something in that RFC? I think having them different is just confusing.
 
what happened to the package level declares idea?
 
Still unresolved design issues with regards to how it would be done
 
I see
 
8:49 AM
@MarkR hhow would you handle the case property_initialized(Foo::class, 'foo');?
 
That would be checking the default properties of the CE like you already did.
 
ok
 
But if it's an object instance then it would need to check the object itself
 
just looking at the read propery handler
 
@beberlei I haven't seen a compelling case made for it yet
 
8:51 AM
@NikiC It was me asking if we had something like it. I was trying to use uninitialized as a third state of a typed nullable property.
 
@NikiC i suppose metaprogramming that iterates over object properties
evrything is useful for ORMs :p
 
@MarkR That sounds like a questionable hack, not a use case :D
 
```
class {
private ?Type $value;

public function getSomething(): ?Type {
if (is_unintialized($this, 'value')) {
$this->value = doSomethingReturningNullOrType();
}

return $this->value;
}
}


In the end I removed the typehint and did Type|null|false and initialized it to false.
 
fwiw I use array_key_exists very rarely as well. You have a much better time if you don't try to fight the isset() semantics
 
Hi
 
8:55 AM
@MarkR ctrl+k is your friend there :-)
 
I tried 3 edits with the fixed-font button to no joy, oh well
 
Well... someone make a PR, we can consider it :P
 
how about testing things in __get? (just making things up now) gist.github.com/beberlei/8946f14ffb96744669b290c79cf4cbfb
 
I am using google translate to translate from english to spanish using following URL pastebin.com/wJ1vbZjd but using curl and file_get_contents() it is not working.. any suggestion?
 
@Exception maybe google looks at User-Agent's and only allows humans to access the page
 
8:58 AM
Ohh then how to achieve this?
 
i just said maybe, what does the response of the call say?
but they have an API in google cloud that they probably want you to use cloud.google.com/translate
 
that looks like its working though
 
@beberlei I know this actually but it comes with cost
@beberlei yeah when paste that URL manually in the search box
 
You can change the user agent like this: curl_setopt( $ch, CURLOPT_USERAGENT, "foobar" );
 
9:01 AM
I looked at using the standard read property but on an unitialized error it's delivering back the global uninitialized value from executor globals, so would have to copy-pasta the entire function and return the flag instead
 
if thats it, they could also do whatever magic and send tokens as header variables to authenticate or some kind of magic
 
@AlfredBez pastebin.com/jibDrkHD still no luck
 
hwats the response from that call?
 
@Exception you just need to mimic the exact request you make in the browser
Possibly multiple requests if extra data is needed
 
@Exception your code is wrong, you shouldng curl_exec twice. make it $response = curl_exec($ch); then check if ($response === false)
 
9:05 AM
But how can I achieve that?
 
@Exception Open your browser's dev tools. Look at the request tab. Make the same request in php
 
you need to look in chrome network tab what happens, what headers does the request have that gets send to their backend
 
Or use guzzle and make things so much easier \o/
 
Also in your case you are better of using the API as @beberlei suggested
 
yeah google is winning this over you, if you need this to work for a long time, then it will be a lot of work to adapt to all their measures
 
9:07 AM
You struggling building it and struggling with consecutive fixes because the thing changed is more expensive than just doing it right
> $20 per million characters* with $10 free doesn't seems that unreasonable
 
@PeeHaa pasteboard.co/ISbChMW.png like this, right?
 
Or look whether there are other free apis
@Exception That is one part
You need all the headers too
And possibly need to first make different calls to get your hands on tokens
 
is there any available free api for this same task? I have searched a lot but didn't get it
 
When I google I get plenty of results
 
but when I searched and used then nothing worked for me
 
9:17 AM
Why not?
 
most of the APIs needed access token and others were failing to return the data.
 
So get an access token?
 
but getting an access token requires cost which I want to avoid
 
Weird. The first result I see on google claims to be free
 
That's just an advert for you mum
 
9:26 AM
My mum's adverts are blocked on adsense
 
Whose mom got it going on?
 
Anyone have any guesses on why Wordpress won't run a scripts.js file in a HTML5Blank theme? I have a feeling it has to do with the functions.php file, but I've checked the script enqueues many times and can't find the culprit.
 
is the script not loaded into the page?
 
I can see it in the developer tools sources and <head>.
 
if you see it in the <head> element, the wordpress side is done and the js was loaded.
So what do you expect the js file to do?
aka how do you know is not "running"
 
9:37 AM
21 hours ago, by DaveRandom
🎵 @PeeHaa's mom has got it goin' on, she's all I want and I've waited for so long... 🎵
 
Well, I hope this isn't the wrong place to talk about it, since it's JS, but it contains this pastebin.com/j1rb1k66 script and nothing happens.
 
you didn't invoke the functions
you defined them in expressions without calling them
(function ($, root, undefined) {
    // ...
})();
// ^ missing this
it needs arguments as well
presumably window.jQuery and the root arg doesn't seem to do anything
 
that function definition is what's known as IIFE: medium.com/javascript-in-plain-english/…
 
Ahhh, that makes sense.
I had modified the default HTML5Blank script without checking if I didn't miss anything important. The default is very different from what I had.
Thank you very much! And sorry if this wasn't the right place to ask.
 
Make it up to us by asking a php question in the c++ room now :P
5
 
9:42 AM
Oooo you sadist
 
9:58 AM
I think we should just delete the ability to declare constants and functions at namespace level /watches burn
 
@PeeHaa at least it's not a JS question. That'd be even worse.
 
In the cpuspus room?
Surely they don't care about any other languge than c++ in their. Hell I am pretty sure they don't care about anything you say and just want to tell you your face is bad and you should feel bad :P
 
@PeeHaa yeah well, they shall be left alone with their weird double-ampersand references and consts
 
:-)
 
toady: a person who behaves obsequiously to someone important courtesy of @StatikStasis
 
10:10 AM
awesome
 
@bwoebi I used to think I was missing something about C++, now I'm pretty certain it's just that it genuinely is completely insane
awaits incoming "moved to Lounge<C++>" and subsequent flame war
(please don't)
 
What's wrong with C++ ?
:D
 
We're not allowed to use it in the core D:
 
@SorinNunca A few things, but I think at this point it's mostly the language complexity
 
10:28 AM
It's quite hard to write readable code unless you treat it as simply "C with classes"
(imho)
 
C with classes with operator and constructor overloading is the best part of c++
Then again I've not used it properly in about 8 years
 
@DaveRandom it's tempting ...
@NikiC yeah, you get pretty quickly to the point where you are confused with copy ctors, move ctors ... then you start to sort of understand what they do, but you still don't know when to use them except the compiler yells at you ... and then at some point you get that as well - at least that was sort of what I had most issues to cope with.
 
10:45 AM
You don't need C++ to write "object oriented code".
 
no, but it in theory the simple syntax sugar of the implicit this arg should improve readability
 
Being able to hide the internal state saves a lot of headaches, and those lovely operators and inheretance chains
 
operator overloading is overrated
 
@Derick Writing object oriented code is the last thing I would do with C++ ...
And object oriented code in C is even worse
At least if by "object oriented" we mean "virtual function dispatch"
 
yes, I do agree. I didn't say to use "C" to write object oriented code ;-)
But some patterns do make sense - i.e,, have a data-structure with operations on it.
 
10:57 AM
It's all about encapsulation of state, that's the shortest possible definition of my understanding of "OO". Everything else is just detail which is open to interpretation and doesn't have a Right Way To Do Itâ„¢
 
When I was designing a scripting language from scratch for my thesis project, I remember having this moment when I added the overloaded assignment operators to my Variant (equiv of zval) class... and everything became so much neater.
 
Encapsulation of state is just sanity
 
you say that as if it's implied, which cannot possibly align with your life experience
:-P
 
@NikiC I have text transcripts of the podcast episodes now... I am wondering what to do with these. Publish them somewhere? But then, where?
 
@Derick Uh, on the page of the podcast? ^^
Below the show notes I mean
 
11:10 AM
yeah, maybe. It's all timed though, I wonder if it's possible to make it sync with the audio
 
@Derick that's sounds like a subtitled video, just turn them into a srt file and make a video with them burned in, ffmpeg can do it, vlc gives you a GUI that prevents you having to build the mad-ass command line yourself
 
it's audio, not video
 
@Derick Would probably be quite a bit of work to make those accurate. Not sure how useful the raw ones are
 
It's not raw... it's edited already
 
well yeh but how are you planning to display them "synced"?
 
11:13 AM
there are very accurate timings for each word in the JSON
 
google speech and text matching :-)
 
@Derick Heh
 
I think I am being stupid
 
            {
                "start_offset": 583680,
                "end_offset": 895200,
                "speaker_model_label": "0",
                "transcript": "I thought I'd start with something else then I did last year. In any case, and wanting to talk to you this morning about something that happens to PHP seven f
                "id": 4929059856,
                "alignment": [
                    {
                        "word": "I",
                        "endOffset": 1,
                        "start": 0.0,
(As an example)
 
11:37 AM
Morning!
 
orming
 
grmo
 
I'M HILARIOUS LAUGH GOD DAMN IT
 
ha ha ha
 
damn straight
 
11:50 AM
               b
               |  _,
   _______ ,_:D|_|_/\, ___
 
12:07 PM
I think someone of you knows this gif where a guy wants to change a lamp and then nothing does work and he ends up repairing his car. I'm not able to find it right now, can anyone help?
 
@PeeHaa exactly, thanks a lot!
 
np
 
Hi! Does anyone happen to know, when I have an \public_html\.htaccess file and then a sub-folder has another one \public_html.htaccess\subfolder\.htaccess, does the subfolder's htaccess replace the other one "completely", or are only the directives I specify the subfolder, replaced?
(does my question even make sense? i've been staring at this screen far too long) 😜
 
There is an entire section about your question
 
12:20 PM
Thanks -
 
@DaveRandom That is... so you!
@PeeHaa King of the memes!
 
All hail me \o/
:D
 
@PeeHaa I think it will probably melt before it gets there but I'll try
 
Just get one of those organ containers
 
12:34 PM
a church? how will that help?
 
That took you sooo much longer than we all expected :D
 
I'm doing actual work (for once)
 
@AlfredBez Check this replacement.
 
@DaveRandom I like it.
 
12:37 PM
I think that probably qualifies as laughter in german, I'll take it
 
@DaveRandom Have some Luxembourgish non-laughter from me.
 
@DaveRandom you could repent for voting yas to trailing commas in fcalls :-P
 
lol
 
I'd rather burn in hell
 
12:53 PM
@PeeHaa oooohhhh, setting "php_flag display_errors off" in .htaccess basically overrides my usage of ini_set('display_errors', '1'); within the .php file, for example if I forget a [damn] semicolon somewhere.
(or I suppose it's actually that my PHP file isn't runnng at all (because of the missing semicolon), so ini_set('display_errors', '1'); isn't running at all....(returning only a blank page)
so i can't see that type of error if i want that folder to default to hiding errors. i think i get it now.
 
1:16 PM
I receive my huge cat wheel today, I ordered it Monday. That was quick.
My cats are fat and need more exercise than I can give them
 
@ashleedawg php cannot do anything when there are parse errors
So it can never read your ini_set call (assuming it is the same file)
 
@NikiC Whom can I contact (via email) at JetBrains about PHPUnit and PhpStorm?
:48455659 Cheers! And greetings from Arne and Stefan who are sitting next to me (in a coworking space in Berlin).
 
o/
 
@SebastianBergmann Are you going to the symfony user group today?
 
@NikiC You deleted your reply before I copy/pasted the address. Can you send it to me to sebastian@thephp.cc? Thans!
@NikiC Unfortunately not, but I am speaking at the Symfony UG in Cologne tomorrow.
 
1:53 PM
probably stupid idea: a way to say "this namespace is fully declared"
or "this namespace may not declare any more functions"
as a way to optimise function name lookups
 
"sealed"
or final
 
yeah, something like that
 
not sure about it, sounds like a way to shoot yourself in the foot
namespaces are literally just naming constructs, I dunno if it makes sense to apply open/closed to them in the same way as classes
ymmv
 
that's why I avoided giving it a name, to avoid that comparison
the motivation is not about closing them to extension, it's just "I promise not to declare any functions in this namespace"
as an alternative to the declare(blah='global') RFC
 
@NikiC wijll you be at the ug in berlin? would be nice to see you again :)
 
1:57 PM
it is moving them more towards "packages" than "name prefixes", though
I think that's the direction we're going though - either namespaces become packages, or we get first-class packages
 
if that is a thing, the former please :-P
 
02:00 - 14:0014:00 - 23:00

« first day (3392 days earlier)      last day (1539 days later) »