« first day (3435 days earlier)      last day (1738 days later) » 
00:00 - 14:0014:00 - 00:00

14:00
Cheers :)
@Sjon Anything like this in mysql?
@DemCodeLines nope
@Girgias it's 99,9% what you've written so far. I won't be able to do much with it at least this week. But if the write-once stuff will let me, I'll also try to extend it later :)
Sure, I'm not planning onto putting it on the list yet, just wanted on the wiki but that seems to have been taken care of :p will try to fix some formatting for the code as well DokuWiki markup is different then markdown
@MátéKocsis Edited slightly with minor re-Englishification, fyi
14:05
@Girgias yeah, I tried to adapt the formatting, but there is some left-over for sure
@DaveRandom Nice! Thank you
Hum having an interesting question thrown at me
throw it back like it's a game!
Registering a constant using define() can be optimized by OpCache/the Engine right cause it's a runtime declaration (or am I wrong there too?)
(side note probably should update the constant page in the doc cause so many people don't know you can use const in the global space)
So now I'm going down the rabit hole of how PHP constants work
If it's in the constants table when encountered
@MátéKocsis I proposed deprecating setlocale before, because it's not thread safe, and also insane. There's a thread safe version that can be used instead.
You might want to look at the non-sensical responses on the list.
14:29
@Danack What's the read safe version? intl?
@Danack we saw that thread when I was researching previous talks about that
Also @NikiC I suppose I can merge this now github.com/php/php-src/pull/5220 ?
@Girgias yes
Great will do rn
14:37
@NikiC I didn't even get to the good bit yet....
function processSomeEvent(SomeEvent $se): SomeEvent & SecondEvent
{
	$bar = new class() extends $foo implements SecondEvent {
    	function SecondEvent() { }
	}

	return $bar;
}
@Girgias And the status of the PHP 7.4 deprecations RFC can now be set to Implemented \O/
Erf
Still acouple of things missing IIRC
I believe this was the last. I double checked them a couple of weeks ago
Oh they are from other RFC you're right
The ternary order one and the curly brace offset one are separate RFCs
14:45
Just realised something, is there a point to php.net/manual/en/function.constant.php ?
@Girgias dynamic constant name
But why would someone due that? Isn't the point of a constant well to be known in advance? :(
question... I committed this revision but forgot to mark a bug that's associated to it. Can I retroactively add the bug to it, or do I need to manually do it, now that it's after I committed it?
rather, add a comment to the bug that it's been completed
I wanted to be cool and have a comment "Automatic comment on behalf of tiffany" :(
Minor Service Outage
Just add it yourself :D
14:55
alright
nevermind
@Tiffany Which PW manager? :'D
I was in the wrong tab
1password
I see :) I was just curious since I am a dev of LastPass :D
ahh, cool :)
most people I talk to about password managers, they use LastPass
@Danack Nope: we don't test against php-nightly yet.
15:04
@Tiffany Most probably because the free version of it is still ok for 99% of use-cases of individuals :)
that makes sense... shrug, I started using 1password a few years ago, and have grown used to it
former employer used zoho because they could set up an "admin" account that controlled everyone's access, so if someone left, access could be removed easily
that's fine! (to use what you're accustomed to). The most important is to use one ^^
agreed :P
@MátéKocsis wait what lol I actually use LastPass xD
@Girgias yaay! :)
15:31
Incident on 2020-03-12 15:31 UTC
"incident"
Minor Service Outage
Incident on 2020-03-12 15:31 UTC
"A bird flew into the window at the office and all the devs are standing at the window looking down at the ground, but the window doesn't open so the angle isn't right, we have dispatched an intern to the lobby to find out whether it hit the ground"
Minor Service Outage
@PeeHaa I feel like this ^ is not behaving as expected :-P
15:38
Incident on 2020-03-12 15:31 UTC
blame github :)
@salathe woopsy
@Tiffany don't elaborate, let him sweat
are you on the doc mailing list?
I used to be but don't seem to be any more
15:42
@DaveRandom I rewrote my variance page, committed it this morning, missed a rewording in a spot, he caught it
Minor Service Outage
All issues have been resolved!
WTF
16:02
has anyone heard from Wes in the past few days?
I figure he's taking a break from the internet, but I'm concerned about him with the outbreak in Italy
@DaveRandom Let's just say correlation -- Kotlin makes me eat bugs.
16:22
@Ocramius What would your comment on bugs.xdebug.org/view.php?id=1761 be, I mean, catching Exception architecture wise?
16:34
isn't that how all debuggers work? It's certainly how the ones in visual studio do
@Derick AFAIK debuggers "stop on exception" have always worked by operating on throw, ignoring any context around it (also JS debugger in the browser)
...the point being, you may want to step through and find out where it is handled/rethrown etc
This is probably also where the "don't use exceptions to control flow" came from, and how AppDynamics also logs exceptions internally
Yeah, I'd expect it to stop on the throw statement anyway :shrug:
PHP already breaks on unhandled exceptions all by itself, with an E_ERROR :-P
in order to "break" at the point of throw in that case you'd have to play through and let the exception bubble to root, and then rewind
@Ocramius Yeah, that's exactly what is happening here too. I think the issue here is that the dev uses exceptions for code flow...?
oh, you just said that :D
16:40
> This invariably happens when I open phpMyAdmin. Just turn on the 'Everything' checkbox and open it
Yup :D
^ problem is definitely pebcak there :-P
Exceptions as goto is basically goto with lots of added stack frames :D
and breaking breakpoints :D
a thing you could each xdebug pro, a list of "known exceptions" to skip :p
16:51
:-þ
uninitialized typed property cannot accessed in __get magic method ・ Class/Object related ・ #79373
@AsyncBot why would __get be triggered on a property that exists?
17:12
cloooosed
17:29
Why XMLReader can't open a resource? It would be great...
@VeeeneX that's an ambiguous question ...
"I dunno, you tell me"
s/resource/stream/
e.g. File is stored on remote storage and get by request stream via HTTP
And I can't use that streaming, I need to download the file and then read it
the answer is "because nobody implemented it", possibly with a side helping of "libxml2 is not reentrant so it's liable to leak/explode if you try to plug in the PHP stream abstraction"
I suspect the latter tbh, mostly because afaik none of the libxml extensions have interfaces with streams
So sad... :(
17:37
libxml2 is a big ball of sad... it's quite a nice thing but it really needs some love :-/
@DaveRandom It looks like there is a xmlReaderForIO() function that accept callbacks, so it's maybe possible to implement it
While currently it uses xmlReaderForFile()
@NikiC possibly, but I suspect there will be thread safety issues
Would be pretty stupid if there were...
I have banged my head against that particular wall (different bits of it) in the past
there is a similar issue using zend mm
it can get bits of tagged data mixed up in multi-threaded envs :-/
I think the difference there is that the allocator has to be replaced globally
while this function uses local callbacks
17:40
I might have a bugger about with it because it would be quite useful
being able to load DOM docs without having to write them to disk or slurp them all into memory as a string first would also be nice
Maybe @cmb would also be interested, as he did something similar with curl recently ...
Though maybe after that experience he doesn't want anything to do with it anymore :P
18:11
i wish there was something to replace libxml2 with, though realistically there is nobody that would or could do the work replacing all this
the memory allocator thing bugs me the most, scary things going on there, would like to have zend mm support
47
Q: XML Parser for C

coderCan you suggest some of the best XML Parser for C ?

God the madlad
An XML parser in Assembly
@beberlei I have occasionally wondered if there's a middle ground there, it would obviously be best to have zend mm but the most important thing it doesn't have atm is respect for memory_limit... I dunno if it might be possible to implement that without actually having a fully managed heap
libxml itself isn't terrible, it's just a little feature poor by modern standards
what we really need is something like what heartbleed did for openssl, something which puts a rocket up the arse of a few big corps who rely on it and get them to throw some resource at the problem :-P
18:29
@nikic hello, I am not at work any more :)
I'd love to put some time into it but I don't even know where to begin with any of the stuff I want/care about (re-entrancy, XSD 1.1, XPath 2.0)
it would be good if all C libraries we used supported custom allocators
libxml does support custom allocators, it just won't play nice with zend mm
I'm sure it's possible to fix that, but I couldn't even begin to talk about that with any degree of confidence/competence
@DaveRandom Like PHP!
oh on a very large tangent, @bwoebi @Trowski @kelunik have any of you ever looked into the feasibility of patching streams to accept certs/keys in the form of PEM/DER/BER strings and/or openssl X.509 resources? afaict atm every SSL_CTX is always populated by an uncached file system read (or if it is cached by openssl in some undocumented way then it either stat()s every time or is valid indefinitely)
18:41
@DaveRandom on the C level?
@LeviMorrison somewhat, but orders of magnitude more so :-P
@bwoebi yeh
nope
@DaveRandom Okay, then, our manual, website, pecl... :)
@bwoebi every crypto setup op populates the certs in it's SSL_CTX via heap.space/xref/PHP-7.4/ext/openssl/xp_ssl.c?r=4f984a2f#940 afaict
there's no caching of SSL_CTX structures or sharing between streams (again, afaict)
@DaveRandom right
18:46
I think it should be simple enough to use SSL_CTX_use_certificate() etc in conjunction with resources from openssl_x509_read()
could also check strings for PEM markers and if present try to decode them as that otherwise treat as a file path, but that may be a little more problematic, I dunno
@DaveRandom nah don't do magic
I would just add an option local_cert_string or such
which allows passing a cert directly as a string to openssl
yeh, fair
brb fire alarm apparently
i saw someone else tweet this before, tweet thief :D
19:18
German Letter ẞ ・ *Unicode Issues ・ #79374
bug is worded like there aren't Germanophones involved with PHP...
@bwoebi so looking into it a bit more, it's non trivial to build a chain like this using the current API. I realise this is suddenly turning it into a much larger job, but what do you thing about the idea of an "OO API" for the openssl_* functions? Not asking you to do anything about it, just wondering what your gut reaction is. I have a vague idea of what it would look like, I will write a set of interfaces for a bit of colour (tomorrow)
I have been thinking also about this. I think I would want functions to be explicitly prefixed based on what behaviour they have… I like `byte`, I'm not sure if I like `char` given it doesn't scream UTF-8 :p

The `StringPos` class is the most interesting part of that gist to me. Being able to efficiently iterate over UTF-8 characters/codepoints is easy for us to add and I think we should add it. But why does it need to be a class? If we work with byte positions — which I think is the best thing to do, given it's honest, O(1), works properly even for e.g. invalid UTF-8 input — we could just
19:33
@Andrea The main motivation behind the StringPos class is perception
@NikiC it looks like “real Unicode support”? :p
One of the big problems we have right now is that people use highly inefficient char-offset based mbstring functions, even though in 90% of the cases it is not necessary
And the reason why they do it is, as you say, it "looks way more Unicode" if you don't have byte positions
Like, it seems to be the bar of "unicode support" in a language to call length("SOME_EMOJIS") and compare the result
As you usually only need string positions to pass them to some other string function, hiding them behind an opaque object avoids that
strlen("🐘") === 1 or die("php sux!!!!!!!! >:(((((((\r\n");
I completely see what you mean, unfortunately
@NikiC by the way, can we get rid of serialize_precision in PHP 8?
it shouldn't be an option tbh
@Andrea I'd be fine with that
Though we'd have to adjust some transcendental tests with some trailing %s
yeah
19:42
That's the only place where we set serialize_precision I believe
otoh it's a sort of hypothetical footgun
nobody is going to use it, I hope
if your webhost does, yell at them.
@Andrea There's bug reports with people using ridiculously large serialize_precision from time to time
From what I gathered, doing serialize_precision=100 was all the rage back in the day
Like, the larger your precision the better it's going to serialize ... or something :P
ah… maybe we ought to remove it for users' own protection then
precision=100 exists only so this could: soundcloud.com/taze_t_schnitzel/the-floating-point-song
final class StringPos
{
    private int $pos;
    public function __construct(int $byteOffset): void {
        $this->pos = $byteOffset;
    }
    public function getByteOffset(): int {
        return $this->pos;
    }
    public function __toInt(): int {
        return $this->pos;
    }
}
@NikiC look, Unicode support!
@Andrea It ain't Unicode if there's no char offset option :P
@Andrea wat
@NikiC it was a spur-of-the-moment idea… :)
20:07
ugh
who had the genius idea to make perf output locale sensitive
let me guess, commas?
Commas indeed
How am I supposed to parse this now, I don't know whether . is a thousands separator or a decimal point
C locales were a mistake
well… C locales are reasonable-ish. the interaction with Unicode is unfortunate, but maybe inevitable
the problem is you can't opt out of them other than globally
for everything that is affected by locale, there ought to be a locale and non-locale version of the printf specifier etc
Thanks to @NikiC's help, we have drastic improvements to the zend_instrument API. It now works by querying interested extensions at first function call instead of at definition. Currently you cannot unregister these instruments, but I think we can support it now.
Please trying implementing something using the API to let us know where it needs to improve. /cc @Derick @bwoebi @JoeWatkins @Gordon @Danack
A few caveats:
- It still leaks memory.
- It doesn't play nice with some bits of JIT.
- The `.end` handler isn't passed the return value.
- It's expecting that exit will be implemented via exception.
It should work with opcache, but I haven't checked preloading.
while C locales are ruined forever, maybe PHP could work around them
20:14
@NikiC I wish there were a mechanism to elide intermediary objects, especially in cases like $str->pos("foo")->pos
@bwoebi agree
You can look at @SammyK's observer extension to see how it is supposed to work from a user's point of view.
And /cc @beberlei, who I missed earlier.
20:42
@NikiC Do you think an iterator would be insufficient? But I guess this is a nitpick, I think I like the overall idea
foreach ($string->chars() as $pos => $char) {
    echo "Character at byte offset $pos: $char\n";
}
@Andrea I think I did include that one
Iterator definitely makes sense :)
20:59
btw, I think byte-strings — and therefore putting a UTF-8 based API on top of them rather than making a “pure” Unicode class — are a good direction because they're more honest, and the world has broken UTF-8 in it in reality
especially given PHP until now has just used plain strings. so databases probably have text mixing Latin-1 and UTF-8 in it. it's not nice but such is life
filesystems are their own hell also
my opinion on Unicode support has been shaped in part by seeing how Python 3 fails at work… the way it makes an incorrect guess as to the supported charset of the terminal (among other things) and blows up if it's wrong is not nice
traditional Unix C programs handle UTF-8 better by comparison, ironically by not trying to handle it at all
mysqli_store_result does not report error from lock wait timout ・ MySQLi related ・ #79375
@Andrea In the earlier discussion, some people were quite adamantly against mixing both things in one type :)
@NikiC I probably argued in favour of a separate unicode string type once :)
I think I am at the stage of seeing “Unicode string type” as the same kind of bad idea as “16 bits should be enough for all the world's languages, we'll just add one byte”
mind you, Rust does it…
21:19
@Andrea Rust kind of does it ... well
Though I'm not sure what the relevant difference to Python is
Possibly the strong type system is just what makes the difference
And maybe the fact that they separated out OsString, which is where most of the crazy filesystem stuff is going on...
I haven't used it enough to say if it has the problem Python does
yes, OsString is a good thing!
I am glad they have that
OsString is sort of an admission of defeat, but a very necessary one
Isn't one of the problem with the Python 2 -> 3 migration also that in certain tasks P3 is notably slower than P2?
Is that because of Unicode? (I don't know, haven't read the stats.) they made some significant other changes to the engine with 3 IIRC
Not sure
Apparently integer implementation in Python 3 is one of the causes
21:35
ahh yes they did it quite inefficiently IIRC
they made every integer a (heap-allocated) bigint. in Python 2, it only became one if the operation would overflow
that said I think integers in Python 2 were objects too? Python's implementation is not focussed on high efficiency I think
that's not an insult to the authors, and I know there's various things they've done over the years to make it faster, it's just my impression that it's not high-priority
or maybe changing it would be very disruptive
So Unicode is also one part in it from reading at some libs
Well apparently having 1 integer type isntead of two is better for the enduser from on thing I read on SO
Which I don't get why the engine can't take care of that
Also still find it hilarious when you tell PHP is faster than Python or JS :')
class string
{
    readonly int $byteCount;

    function byteSubstr(int $start[, int $byteCount]): string;
    function utf8Substr(int $start[, int $charCount]): string;

    function pos(string $needle[, int $fromPos]): int;

    function utf8FindNthChar(int $index[, int $fromPos]): int;
    function utf8CountChars(): int;

    function utf8ToUpper([string $locale = "xx"]): string; // Turkish I problem
    function utf8ToLower([string $locale = "xx"]): string;
    function asciiToLower(): string;
@NikiC something like this is what I would like, I think
@Girgias yeah, but they could cheat beneath the surface so they have a fast and a slow integer type and pretend there's just one. that was my plan for PHP bigints (and it worked okay I think!) before I abandoned it
@Andrea yeah that's what I don't get, why they didn't do it
@Girgias yeah, I can only guess they thought it would be too painful
Who knows
I though I found a great paper about language comparison
Was presented at a conf in Nov 2016
They used PHP 5.5.9 :|
21:54
in fairness PHP 7 was fairly new then :)
but it makes PHP slow…
I mean there was PHP 5.6 out
Not sure if it's that faster than 5.5 but
hey guys i have some quick questions i have to ask i'm trying to confirgure one project on ec2 instance having ubuntu for hosting but i'm stuck with an error Uncaught error Class 'Illuminate/Foundation/Application' not found ? I have tried clearing the cache even use composer to install but still i'm getting the same error can any body help me?
22:12
@NikiC which, oops, is pretty much your proposal but without the StringPos and with slightly different naming. Maybe I should fork your gist and iterate on it :p
Jpv
Jpv
Hey guys, quick question. So my company will be moving to remote, and i've been tasked to setup remote access. Besides VPN, u guys use any clients?
@Jpv what kind of OS are you remoting into?
Jpv
Jpv
all windows
50+ users
Windows's Remote Desktop Protocol is black magic, works really well
the machine you remote into has to have Windows 10 Professional at least though, but that's probably the case if you have many machines
Jpv
Jpv
yeah, except the time we got ransomwared back on 2016..... cause windows update
thats my concern atm. cause there will be no one to pull the plug
I know i can setup VPN and then use Remote Desktop with Network Authentication. But it means I need to setup the VPN clien on everyones personal computer ( most will use their desktop )...
and not really liking the idea of visiting everyone's home.. -___-
22:23
you can't provide instructions for people to set it up themselves?
Jpv
Jpv
most are office workers.. like.. took a while to teach them slack!!!!!!
I was thinking TeamViewer or AnyDesk, but I know teamviewer kicks you out every couple of minutes
you can use TeamViewer to get into their computer and set up the VPN for them
if scammers can talk people over the phone into setting up TeamViewer and granting remote access, you can :)
Jpv
Jpv
toooo shay (idk how to spell it .... )
touché? :)
22:55
Is there a way to do object copy-on-write internally? I.e. is there a way to distinguish between (new Thing)->methodThatReturnsModifiedClone() and $a = new Thing; $b = $a->methodThatReturnsModifiedClone(); so that the former doesn't trigger a copy since the original would be immediately dtor'd?
Also: ohai @Andrea, long time no see, you doing good?
@DaveRandom well, I'm not showing symptoms of SARS-CoV-2 infection yet :p
but seriously I'm doing fine, and also apparently I have to work from home now
I think the last time I spoke to you properly was like phpnw 2016 or sth, I imagine your life is v different by now :-P
yes!
from university student in Scotland with no non-debt money to full-time software developer at [redacted] working on [redacted] in Sweden
In fact definitely the last time I saw you was when you could not legally drink :-P (so I prob made an arse of myself to some extent)
you have never seen me in person when I couldn't legally drink :]
I just avoid alcohol intentionally
23:00
Good strategy :-P
My misremenbering of that is likely related...
though, hmm. I don't remember when PHPNW in 2014 was
it is quite possible I actually couldn't legally drink, not because I wasn't old enough (I was, by several months) but because I had no photo ID
yes, I couldn't! October 2014. didn't have passport for reasons
@DaveRandom ah right, you're in fact not called Dave and I remember interacting with you now
@LeviMorrison oh wow, this looks amazing!
@DaveRandom I have that thought occasionally and wonder if it'd be possible
@DaveRandom I bet @NikiC has thought of this before and can say why it's not easy to do. :)
00:00 - 14:0014:00 - 00:00

« first day (3435 days earlier)      last day (1738 days later) »