« first day (3439 days earlier)      last day (1735 days later) » 
00:00 - 23:0023:00 - 00:00

00:55
Well, so much for eating out in Illinois for the rest of March... nbcchicago.com/news/local/…
Restaurants are only allowed to do delivery or curbside pickup
 
6 hours later…
06:34
is it just me or php.net is down
its up now
07:30
@MarkR but it needs to throw the exception everytime the function is called - but yeah, you should be able to cache it the first time it doesn't throw, I guess?
 
1 hour later…
08:46
@Ghostff Do you have a link to prove that? ;)
08:58
gut moaning
좋은아침
(yes, I typed that out)
@Naruto yeh, me too, I think there's something going round
I wouldn't know since I like my vampire coffin in the basement too much
@Naruto everyone's coughin' atm, vampire/basement or otherwise
09:19
@DaveRandom that's exactly what I expected
I wonder how @Ghostff originally concluded it was broken
09:33
public function __distract() ?
09:52
So I just realised that echo "This ", "string "; works but not print "This ", "string ";
>____>
welcome to 1995
Madainn mhath!
10:07
@Girgias see also: 3v4l.org/cS3JX (eval() wrapper is just to defer syntax error)
basically, print is an expression with a single argument (like include), whereas echo is a statement and can thus accept multiple arguments.
...which is why you shouldn't use parenthesis with either of them, print("foo", "bar") doesn't mean what it looks like it would. Thankfully PHP doesn't have comma expressions, but if it did that would output bar and cause a ton of wtf
@DaveRandom I never use parenthesise with them, and I only use echo with concatenation so
10:27
@Girgias I often use comma to avoid the precendence issues (requiring extra parens) when outputting a math operation inside a string
(on PHP 7 at least)
@bwoebi Seems fair, I would probably put parenthesises around the math operation to make it clearer ^^
10:48
Everyone WFH?
I always am
I'm not enjoying it so far, miss the office laughs
start a google hangout with the team?
we had sort of a partial work from home model, but switched to full home office. I made sure people do more video calls with each other, and also introduced "watercooler" vidoe calls
@Derick we did a #11 hangout once, it basically ended with everyone absolutely hammered, with a silent video of people typing into chat in here. Turns out that there's a reason we use internet chat instead of talking to people irl :-P
and when I say everyone I mean @PeeHaa
11:05
:P
Crash php ・ Xdebug ・ #79386
thats helpful
@beberlei what, you don't have your mind reader enabled? :D
> Windpws 10 x64
11:21
I'm going to ignore that one
11:40
The world is on fire, but... I think I just passed my first RFC, even if only a small one \o/
RFC: Umbrella to protect parade/chips from unwanted atmospheric fluids
I wonder if Stas has a script to automatically vote no on every RFC
4
I did see him vote yes once or twice
12:01
@DaveRandom I was wondering the same myself
Is it not weird that is_scalar() does not consider NULL to be a scalar value?
Or is it just me?
I find that to be perfectly normal
Welllll... technically it doesn't even have a magnitude
@Sherif Can an unary type be scalar?
12:05
@bwoebi I dunno ¯_(ツ)_/¯
Can types even be unary or binary?
Consider the case of foreach($nestedArrays as $data) { if (is_scalar($data)) recurse($data); ...
That triggers a false positive
Which throws a type error which kinda sucks
There's always is_array :-)
Yes, I'm aware of that, but it's not just arrays in there. It's objects too.
I know the alternatives I'm just saying isn't this kinda dumb?
Someone tell me I'm crazy.
You're crazy
Also - php.net/manual/en/language.types.intro.php lists the scalar types at the top
@Sherif imho you're not crazy
@NikiC Thank you.
12:11
Though it does have some self-consistency, e.g. you can pass scalars pretty interchangeably in weak typing mode, but passing null ... that's gonna blow up
Well, that's what I figured was the reasoning behind it, but then it creates the opposite side effect of if(!is_scalar($thing)) // I expect thing to be compound
I guess that was a dumb expectation, eh?
We have no is_special()
Does date_default_timezone_set still works in PHP 7
Yea, why wouldn't it work?
@Sherif I think is_scalar is just fundamentally pretty useless ;)
In your particular case, I'd say the correct primitive is either !is_array or !is_iterable, depending on what exactly you have in mind there
@Sherif it's not a scalar value because it's not a value :-P
12:16
@NikiC Yea, I realized this after discovering an edge case where one of the properties came up null. Of course, I know the fix I was just wondering if there was some insight I was missing as to why null wouldn't be considered scalar.
Scalars have magnitude, vectors have magnitude and direction, NULL has neither
@DaveRandom How does bool have magnitude?
true or false?
I guess that's a magnitude ¯_(ツ)_/¯
I would have said 'multiple values' rather than magnitude...but 0 -> 1
12:19
@Danack Ah, that makes a lot more sense.
OK, good enough for me.
@Danack yes, there is an element of misnomer there. I think at some point in the distant past someone confused "composite value" with "multiple dimensions" and concluded that "scalar" and "vector" made sense as descriptions
It's an overloaded term anyway :)
In physics, we consider something scalar only if it is invariant under coordinate transformations.
something something, extending scalar types, so that users can define their own 'coordinate systems'...though I think it would be inappropriate to touch that until string in PHP are less terrible.
I have an input in my html page as time type I want simply to store the posted value as H:i:s format what is the function I should use
is_scalar(new SpacetimeInterval())
12:26
$c = 299792459;
$data = "12:34:56";
$dateTime = \DateTimeImmutable::createFromFormat('H:i:s', $data, new \DateTimeZone('UTC'));
$string = $dateTime->format('H:i:s');
@PHPFan ^
No. Make sure you add "UTC"
ah yeh
@NikiC I'll ask here, rather than triggering a shitshow elsewhere. For making exit unwind properly, their is a good chance that people will have shitty, fragile code around that depends on the current behaviour. Although making exit() behave more sanely sounds good, it might make it difficult for some people to migrate to PHP8.
I realise you have a strong reaction to the following type of suggestion but how about.

* Adding an ini setting to control the behaviour between old and new.
* Release PHP8 with the new behaviour enabled by default. People can set it to the old behaviour if they encounter problems.
* Plan to remove that ini setting in PHP9

Although adding ini settings is bad, making it so people don't whine too much is also good. And this is the type of ini setting that is app specific, rather than library specific, so it's probably not as bad as other ini settings.
@Danack ... nope
12:30
exit() should just be abort() in C :-þ
@Danack I'm also not clear on what the behavior is they are depending on
stares into abyss of session handling
Are you referring to the fact that finally blocks get run? I can see how that could break things in theory, but I also don't think that code using exit-oriented programming is exactly filled with finally blocks.
exit() and die() are the same, not? I wouldn't expect die() to make things run finally, but exit() potentially I would...
@Derick They are the same, yes
12:35
> die — Equivalent to exit
And it's very simple: If something causes destructors to be run, it should also cause finally blocks to be run
Well it also says that shutdown functions and object destructors, so finally blocks will be added to the list
sure
If exit currently suppressed running of destructors, then it also shouldn't run finally. But that's not what it does.
It's just that it sounds like the type of change that is filled with surprises, and judging by how little testing people are doing of their apps against new versions of PHP, my guess is that we would find the real problems after the initial release of 8.0. Though I guess we could wait until people report those problems, and only implement the backward compatibility ini setting after we get those reports...
12:37
If this is going to be the major blocker for PHP 8 upgrades, I'm going to be very, very pleasantly surprised :)
I have a tinkling suspicion that it's going to be more about all that code running YOLO with error_reporting=0 and then being surprised that some of their 35000 notices and warnings per request started throwing
Was there an RFC for that change btw?
createFromFormat works wrong with incorrect dates ・ Date/time related ・ #79387
Yes - cheers.
@MarkR congrats!
12:45
The mouse inside bugs.php.net appears tired...
(your RFC is the first RFC I've voted on, and probably the only RFC I vote on for a while...)
@Tiffany Tis a simple thing, but it's the first thing I've ever got past bureaucracy in an OSS project
@MarkR We should have a chat about all your small RFCs at some point?
13:33
I'm not opposed, I just don't know what I'd say beyond... saw a commonly used pattern that had some unusual quirks, added a new function to fix them.
13:48
o/
o/
Oh sorry, I mean
o/
@Derick tbf the bug description is not technically inaccurate
14:07
Chris Morris is a legend
@Jimbo you have to kill people to respect them. But you can't kill everyone, or there'll be no-one left to respect.
@Danack standard procedure
14:38
@Sjon I can swear it was broken. __destruct and eval just refreshes the page and clears out the editor. but its fine now.
@Ghostff isn't your broken script listed here? 3v4l.org/last?mine=1
15:01
@Ghostff it may have been too big
btw @Sjon it is slightly frustrating when I put too much text in (there's a size limit, fair enough) but it just eats my code without error message and without giving me an opportunity to copypasta somewhere else
(or any of the other conditions that make it do that)
e.g. if you remove the <?php ?> from 3v4l.org/6eh2N
I get why those restrictions are there, but it would be nice if you could just tell me I did something you don't like rather than eating my code and not telling me why :-P
oh btw @Jimbo you may also enjoy worldhealthwebsite.now.sh/donald-trump-virus - works best on whatsapp.fb/etc because it has excellent preview social cards
@Sjon I will verify when i get home, Am on a different PC ATM
@DaveRandom I'll look at the size limit - but this example seems to work for me, I'm looking at https://3v4l.org/new with a textarea with a red border and the original content still present
15:17
@Sjon ahh, it's the quick preview that does it
@DaveRandom ah, that's interesting
which tends to be what I'm hitting first, I will generally quick eval once before saving it to make sure it does what I'm expetcing
15:40
@DaveRandom o/
hi, everyone \o
@DaveRandom should be fixed now - make sure to refresh the js
Is bugs down for everyone or just me?
no worko
hmmmm reeeeally slow
15:53
@PeeHaa I use isup.me for these things e.g. isup.me/bugs.php.net
16:05
down for everyone :)
I was informed that it was just me
Yeah, the line between "reachable but slow" and "down" is a blurry one when it's slow enough.
I think there's some blu-tac in the server or something
It is allowed to ship bsd files inside an mit project right?
I want to directly include libui.h in my otherwise mit licensed project
nvm it's actually mit licensed
\o/
16:22
Minor Service Outage ・ Issues, PRs, Dashboard, Projects has Partial Outage
that doesn't sound that minor tbh
Minor Bodily Injury ・ Head and right leg have been completely severed, left leg still attached by 3 tendons
16:46
Hello all. I'm new to php and trying to connect to a remote DB. The php script works fine, however I have a problem with naming my columns. I want to include a parenthesis in column name. Google says I have to use back ticks to solve this.

However this still doesn't work because the column name on PHP doesn't match the one in the database when I include the backticks
The correct answer is to not use parens in your names
^ true story
Oh, kind of disappointing but thank you
KISS, an acronym for "keep it simple, stupid" or "keep it stupid simple", is a design principle noted by the U.S. Navy in 1960. The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore, simplicity should be a key goal in design, and unnecessary complexity should be avoided. The phrase has been associated with aircraft engineer Kelly Johnson. The term "KISS principle" was in popular use by 1970. Variations on the phrase include: "Keep it simple, silly", "keep it short and simple", "keep it simple and straightforward", "keep it small and...
don't make your life harder than it needs to be
btw @John note that there is no need to name your columns the same as they will be displayed
(just a wild guess)
It's just that the database is about sensor measurements and I need to display the measurement unit
e.g Accelerometer (m/s^2)
16:50
yes display, not name the DB columns
the column name should be accelerometer, all lower case
@John Actually it should be acceleration
All issues have been resolved!
@PeeHaa true
@AsyncBot I don't believe you
well to be exact, it's "xAcc" "yAcc" "zAcc" currently
acceleration_x, acceleration_y, acceleration_z
or if you have a sane db engine use a proper type
16:52
I prefer to keep it short. But the problem is with the time units
@DaveRandom I thought column names in php should match the oens in database
you basically never ever (ever) want to expose then names of database objects - tables, columns, schemas, types, there is absolutely no reason whatsoever to leak that information outside of the source code
Your preference is wrong
@John in PHP, yes. In HTML, no.
Prefer clarity and readability over characters to type
But I refer to php
@PeeHaa True. Thank you
16:53
@John Yes, but you also talked about display, which is HTML
> $ php ./bin/torrentUi.php
PHP Fatal error: Uncaught Error: Class 'UI\UI' not found in D:\Web\torrent-ui\src\UserInterface\Application.php:14
don't write your own bindings peehaa, don't write your own bindings peehaa, don't write your own bindings peehaa, don't write your own bindings peehaa, don't write your own bindings peehaa, don't write your own bindings peehaa,
@PeeHaa personally, I would prefer to not repeat the table name in the column names.... so the results look like $acceleration['x'], $acceleration['y'], $acceleration['z']...
Why is all software broken :(
@Danack I assume it is not the table name
If it is I fully agree with you
@PeeHaa ffi bindings? :-D
yes
16:55
@DaveRandom Actually I don't need html. I have a php file that exports the database contents into csv file. This is where I want to display the units
@John html/csv/whatever doesn't matter
Storage !== presentation
@PeeHaa Because all software is written by humans.
Yes I just need to rename the displayed column names then
@Crell some software is clearly written by monkeys bashing their heads on the keyboard though :P
Thank you a lot :)
16:58
I am mostly part of that group btw :D
It can sometimes be difficult to differentiate that from humans.
aye :-)
Im looking at the case where functions return a reference in PHP (function &func()) like this: 3v4l.org/7jHuf . In a normal function, a value is returned (a Literal). In this scenario, what would this function return? Does PHP return the actual variable that is being returned? $GLOBALS['foo'], in this case? Think of my question in terms of compiler design and what happens to the references within the SymbolTable. When we update $a, how does the PHP trace this back to $GLOBALS[‘foo’]?
I've never had to figure that out because I long ago removed both globals and references from my vocabulary.
On Mac OS I need to touch the extension's stubs file every time I run make. Anyone ever looked into this? Annoying, but not enough that I've investigated.
17:13
@Silverfox not an answer to your question, but may be able to find it in here: heap.space/…, if you're willing to fall into a lexer rabbit hole
mad scientist / evil genius laughter \o/
cmb
cmb
@Silverfox maybe nikic.github.io/2015/05/05/… is helpful
@Tiffany Thank you I'll look into it, I always found it hard to use Github search to navigate through the source code, this one looks much easier. @cmb I totally forgot about this post, I'll take a look. Thank you
@NikiC Using an opcode handlers for ZEND_INIT_METHOD_CALL and company, it seems like it might be possible to poorly emulate the do-something-on-first-invocation strategy on PHP 7. Basically you fetch the same polymorphic cache and see if it is NULL; if so, do the on-first-call stuff. This won't work for zend_call_function and the other stuff in core we had to change, obviously. However, to be of use we kind of need to store data somewhere. Any ideas for using an op_array.reserved ptr?
I know how to reserve a space via a zend_extension, but I'm not sure what callbacks or other hooks exist to manage it at all, if any.
I assume there aren't any?
I think @JoeWatkins was trying to tell me to do something like this at one point.
Not sure how to make it per-request though.
You mean Microsoft has signed...
18:46
These two clips have become somewhat relevant: youtube.com/watch?v=zvLHliGCcGU and youtube.com/watch?v=n7nFEnFtvCM
@Danack That's hilarious.
@MarkR See last link. Do you remember this movie?
Oh gawd please tell me there's not going to be mass buying of shells
lol- if only we had them yet.
There's still been plenty of swearing to get toilet paper though
@MarkR LOL!
You have watched that as much as I have. I would star that but I'm afraid it would be lost without context... eh... they'll click the link.
Ive only watched it once, watched clips a bunch of times though
What bugs me is there's no-where streaming classics like True Lies or Clear and Present Danger
19:00
Me and a friend of mine were just talking about this. I miss some of these movies.
He said he had it stored away on VHS somewhere.
19:22
Is a SQL query parsed on the client (PHP) side or the server?
Depends on how you're running the query.
prepared statement on an insert query
With PDO, it's parsed on the server side unless you have emulate-prepared-statements ON, in which case it gets parsed in both places. (Once in the PDO driver to do the value injection on the client side, and then once again when the server reads it to parse it out and build its traversal logic.)
 
2 hours later…
21:48
Is it possible to ship multiple composer packages to packagist from a single git repo?
Think a monorepo layout.
No
Unless you git subtree them to other git repos
That sounds kind of terrible.
Can you upload releases manually somehow? Instead of automatically through branches?
s/branches/tags/g
Seems like not really.
22:07
I would imagine that the fundamental problem there is that composer install effectively does git clone, and afaik you can't clone part of a repo
plus updating one of the packages (because a new commit sha) would update all of them, although that's less of an issue
full disclosure: I don't really understand monorepo. I mean I understand the what, but not the why.
Consider something that provides a bunch of PHP interfaces, and an extension that wants to implement those interfaces.
So far, the best route I can think of is that the interfaces use autoloading, and then the extension provides them always without autoloading.
And now consider an SDK like package that provides things you probably want but aren't required for DIY enthusiasts or businesses.
It's annoying to develop them in 3 separate repos.
OK yeh that makes sense-ish, I need more time to brain it out properly but I can see the basic problem
I need to learn more about composer too. Not quite sure how these sorts of dependencies are modeled, where more than one package can supply the same set of things.
my gut reaction is that it would be relatively trivial to use server-side hooks to replicate the mono-repo to separate sub repos, sort of like submodules but implemented server side in a way that's transparent to the client, but that would require more control of the server certainly than github gives you
(I'm thinking .git/info/excludes on the top level which ignores /sub/path/.git and server side hooks to auto commit+push the sub repos on parent push)
sounds like a lot of buggering about though
and fragile
@DaveRandom Any idea about the composer bits even if I used separate repos?
22:21
which part, specifically?
also btw, without wanting to volunteer people for stuff unsolicited, @Danack is the person I know who I consider to know the most about doing slightly niche/esoteric stuff with composer
I've avoided doing anything complicated like that....seems like a lot of effort.
Would separating the interfaces be an upstream library make more sense? As you're almost always going to change those less frequently than the downstream implementations.
@Danack The trouble is PHP sucks. If I implement it in raw PHP (doable), then I can't use them directly from the ext without duplicating them, and now I have to be careful and make sure they are sync'd version by version.
If I implement it only in C, now I have a hard requirement on a C extension, which is a no go for many users, for whatever reasons I still don't really understand.
Am I wrong? Please tell me I'm wrong...
is it the case that a native class cannot inherit from a userland symbol? I mean that makes sense but just so I'm clear on what the problem is
Doing the code inspection for the php interface definition, and the ext wouldn't be that hard.....Or you could generate one from the other, or some simple schema. That way you can automate keeping them in sync.
@DaveRandom For the most part, yes. You can dl at runtime, but that's not a common thing to do so I wonder how well it really works...
22:28
4 hours into libui and ffi - both are broken
urgh yeh I mean there's a pretty obvious chicken and egg I guess
@PeeHaa Oh I'm sorry, I forgot to be surprised.
No!
Surely not!
Assuming the stubs generator is complete for PHP 8, I guess I could generate the whole thing via that file right? Since it's only interfaces?
@DaveRandom Yeah was also expecting some cough rough edges cough
@PeeHaa Are you using Joe's libui thingy or FFI directly?
directly
joe's thing is unmaintained which didn't come as a shock either :D
22:31
I suspect that FFI is not broken as such, more just inherently liable to explode. libui on the other hand... yeh that's probably broken, because all UI is all broken in every API on every platform
@DaveRandom I am inclined to agree :)
I will just build a website instead for my user interface :P
As distasteful as it is, I would imagine that the least broken way to do desktop UI things on windows from PHP is COM/.net and windows forms. Simply because it is the dumbest approach.
@DaveRandom I can't hear you over the sound of segfaults
@DaveRandom yeah was hoping for shiny x-platform though
Yeh that's probably on you though.. you are fiddling with the heap outside zend mm :-P
It's totes on me
That's why I agreed :D
22:36
@PeeHaa I don't want to sound condescending, but... I think it's fairly hard to argue against the supposition that the most mature x-platform UI frameworks are all Javay. How well do any of those work?
:-P
I miss drag and dropping UI in visual basic :(
Those were the times
I wish I was able to provide a viable implementation for this:
11 hours ago, by DaveRandom
RFC: Umbrella to protect parade/chips from unwanted atmospheric fluids
unfortunately, I can't. sorry :-P
rain down on all parades bru
Everyone uses containers now, right? They can install extensions all they want, right?
right?
Installing an extension does not put me off, as long as it is stable and/or actively maintained
22:39
Those exist?
notably uv, ds and pq I use all the time
I am not totally against the idea of one day having something with a hard dep on ffi, either, although that day is a way off atm
ffi is fine once it's proper stable. it's the people writing for it that the problem
o/
You don't want to get anywhere close to anything I do
Or any other code monkey for that matter
I have a new tag line for you
PeeHaa: not even once?
@PeeHaa xdebug :)
22:42
@PeeHaa: like @Ocramius, except he genuinely doesn't know what he's doing
nice
@LeviMorrison right. good one
@LeviMorrison I think that actually stands in a class of it's own in that regard, arguably better maintained than core :-P
I think the redis one is pretty maintained too.
@LeviMorrison are the userland things you are talking about here essentially polyfills?
in fact, can you share specifics for context or no?
@DaveRandom Yep, this is 100% open source.
Here are roughly what the interfaces will look like: github.com/open-telemetry/opentelemetry-php/pull/64/files.
There are also some concrete things that will be moved to OpenTelemetry\Sdk namespace, maybe to another package, I dunno. But the main API is literally only interfaces.
22:47
pecl/pq is pretty well maintained btw, well enough that it generally works properly and when I find stuff that doesn't work properly I either PR or tell Mike and it gets fixed pretty damn quick
A lot of OpenTelemetry implementations also provide an auto-instrumentation package. For PHP this will have to be an ext, so there's where the chicken and egg problem comes.
Clear as mud, @DaveRandom?
thinking
specifically, wondering if anything can be done with separate branches in the same repo and using composer "conflict" to resolve deps to the correct one with/without polyfills in a way that's actually maintainable
If I could provide the ext and API in one repo, that might work. Literally use the stubs file as the API ahahaha.
They are just interfaces, right? That's something the stubs generator should be able to handle, 100%.
that definitely sounds viable
as an aside, <3 the omission of visibility keyword in interfaces. You are doing it right, I feel like I have been alone in that for so frickin long
:-P
:D
I guess I'd have to backport the stubs generator to PHP 7.2-7.4, but hopefully that's not too hard.
22:59
I actually don't see any harm in having the ext and userland sources in a single repo, at least from a usability/security PoV
00:00 - 23:0023:00 - 00:00

« first day (3439 days earlier)      last day (1735 days later) »