« first day (4313 days earlier)      last day (618 days later) » 

12:31 AM
I'm still very skeptical about putting the asymmetric visibility information on the right side. It splits the information into different places, it's longer/more verbose, and it locks us into certain accessor design decisions before we've fully thought those through. The only argument for it I see is "it's what the earlier accessor RFCs used," which was just aped from C#. The more I think on it, the less I like it.
I'm flexible about the syntax we use on the left, within reason. But I am increasingly unfond of the C# style for PHP.
 
 
2 hours later…
2:09 AM
Using the proposed syntax also locks us into a specific accessor syntax. Not much else other than the Swift syntax works well with it.
Of couse, we also have the option of something like var $foo { public get; private set; } but I'm bot sure it's the best idea to revive this keyword.
 
 
7 hours later…
9:00 AM
Mornings / Evenings
 
 
1 hour later…
10:23 AM
@IluTov property $foo
 
11:08 AM
morning o/
@cmb Re: bugs.php.net/bug.php?id=80435 Do you know wether this is caused by the pcre2 version or our build process of the bundled lib? The last comment seems to work fine.
 
cmb
@kelunik Dunno. It is certainly possible that it is caused by our build process.
 
12:02 PM
@MarkR How would you specify asymmetric visibility there?
Ah, you mean combined with the braces.
 
12:28 PM
hey
i haven't contributed to php in a few years
did anyone do scalar methods yet
I assume that strict types have gained enough traction that an RFC to add aliases like $str->substr(…) instead of substr(…), $str->reverse() instead of strrev() etc could succeed
and for people who don't want strict types, string::substr(…) could be an option
 
@Andrea I threw together something a while ago, the approach was extension methods to move the implementation of the scalar API to userland but people here seemed to prefer a fixed API with no way to extend from userland. wiki.php.net/rfc/scalar_extensions
 
ahh, like nikic's old extension?
but standardised?
 
@Andrea Pretty much. But the consensus seems to be that we should model the API ourselves since we can't trust userland to do a good enough job (although I'm not sure I agree with that).
The difference to Nikitas extension was that the extensions were restricted to local scope.
 
ah I see
 
So that different extension libraries could co-exist.
 
12:41 PM
so it avoids the problems of Objective-C's Categories where extensions can clobber eachother
I think userland could do a good job, but I don't think we should leave it up to userland as you'd get basically different dialects in different projects
 
There would definitely be an initial competing stage for the dominant APIs to get established.
 
yeah
 
A fixed API is probably easier to pull off though, so I'm happy with that approach too. Honestly it is hard to come up with a good API, especially for arrays, as they are basically 5 data structures merged into one.
 
ah, yeah, arrays will be a bit of a pain
 
And string too because PHP string don't have any specific encoding, so few assumptions can be made.
Which are the two biggest use cases for scalar methods, so basically everything is controversial and difficult ^^
 
12:50 PM
I wouldn't want to add any new methods, just alias existing functions with more predictable names
I think the string functions operating on bytes is fine
there's certainly limitations to that, but it's perfect for binary data, and it's fine in most cases for UTF-8 and popular single-byte encodings
 
IMO scalar methods do offer a unique opportunity to improve the API. E.g. We could do a better job with array methods that operate on lists or maps. Some methods keep the keys, some discard them, but which it does seems completely arbitrary. Having a filter or map method for lists and one for maps could make a lot of sense. Alternatively we introduce separate data types for these but that's going to be a lot more work, especially with seamless interop with arrays.
 
1:06 PM
If PHP strings are encoding agnostic maybe the API should force you to specify a character encoding. Arrays of bytes have no meaning without a character encoding. Assuming ASCII (which is arguably how most PHP code dealing with strings is written) works fine for a subset of Latin-based languages but not the rest of the world.
 
1:29 PM
@IluTov property int $foo { public get; protected set; }
 
 
1 hour later…
2:55 PM
@IluTov The problem with the encoding thing is … nowdays nearly everything is UTF-8 except legacy things. UTF-8 plays very well with encoding agnostic operations by default. Like if you want to match a specific character, you'll get the character and nothing like a partial character as well.
The only thing which doesn't work is operations on X amount of characters. But these are highly specific operations, because maybe you want character, maybe grapheme, maybe grapheme cluster, depending on your use case.
Thus you're going to anyway need specialized function for that category of operations
 
byte offsets are also the fastest and most precise way to access character data
 
yep.
@IluTov So, no, the API should not force you to specify a character encoding. It's something you can provide as an optional argument for specific degenerate encodings. But by default, given that most operations on utf-8 and all operations on single-byte encodings are binary compatible, there's no reason to specify a character encoding.
 
any ideas for a shorter name for htmlspecialchars? :p
 
@Andrea hesc(), sesc(), qesc()? :-P (html escape, shell escape, query escape)
 
heh
 
3:02 PM
@Andrea forBrowser /s
 
Also, anecdotally, I've multiple times been able to significantly improve performance of C# code by just specifying that InvariantCulture thing, … given that C# by default takes the CurrentCulture, which is the most "proper" thing. But it's so easy to miss passing that arg and what's very fast to byte wise compare is … just slow.
 
I think I'll need a suffix or prefix denoting "single-byte C locale based"
Not ASCII though. I don't want to call strtoupper something like toUpperASCII because that's a misnomer, it supports more than ASCII
possibly ANSI, that's Windows's name for it
or Narrow
ooooh
strcasecmp is not ascii-aware, fascinating...
 
@Andrea you mean only ascii-aware
 
uhh yes
I meant not locale-aware
maybe $str1->compareASCIICaseInsensitive($str2)
that's a real mouthful but it's self-explanatory at least.
 
TBH… I think long names are helpful. But only as long as it's not operations you use thousands times over in a codebase. Then it starts hurting readability.
 
3:13 PM
mm
 
like "simple" name should be sane default, and everything with a long invocation is a "special thing"
 
Objective-C embraces long names, and I think that makes the methods very understandable, but it writes function calls over multiple lines
oh
->compareIgnoreASCIICase()
slightly less long
 
I'd go with ->cmpIgnoreASCIICase()
 
yeah maybe
 
@Andrea yeah, but when you gloss over the code and there's 10 times the method invoked in the same way and one time one parameter is slightly different, you're likely to miss the difference.
 
3:15 PM
LTNS @Andrea :D hello!
 
yeah...
@Tiffany o/
afk for a few minutes now
 
@Andrea But well… I also think that's something devs like to complain about when they discuss why Swift is superior to Obj-C.
 
I have a column in mysql to store image paths and they are stored like uploads/doctor.png
I want to display the images with php
So I wrote this code echo $row["Image_path"] ;
the images are displayed like uploads/doctor.png
How to display them as image
echo  '<img src=$row["Image_path"] style="width:100%;height:100%;">   </img>  ' ;
I tried this code but the images doesn't shown
 
3:40 PM
@IluTov Those people are wrong. :-)
 
@bwoebi haha, that's probably true :D
 
@PHPFan At a guess, the images are stored in a different location relative to the URL being viewed. Try using an absolute URL (starts with a / and is always from the site root). You may wish to read up on absolute vs relative URLs.
 
3:59 PM
hey, anyone had trouble building php with bison 3.8.2?
ohh
it's probably not bison that's the issue
I had stale files in Zend from god-knows-when
unfortunate that make clean doesn't deal with them 🤔
 
make distclean
 
ohh
is that what replaces vcsclean?
adds to script
 
There's also phpize --clean for extensions.
 
I see I commented out the ./vcsclean line at some point, but I guess I failed to replace it with the new thing
 
We have a thing called vcsclean?
 
4:10 PM
oh, Levi! waves
uhh yeah there used to be a script with that name
in uh…
2018 🥴
it has been a while since I was active in PHP development ^^
oh it was actually 2019 when it was replaced, I see
oh, distclean probably doesn't delete the file I was having trouble with. welp
 
welp git clean -xfs I think is the command?
will delete everything not committed
 
yeah… I'm just doing git clean -ffdx Zend/, that fixes my specific problem
it was either the scanner or the parser that was stale
 
I see @Andrea is going to retry getting bigints into php... :-D
 
haha
nah, I've given up on those for good :p
huh, make test still doesn't use parallel testing?
I guess people just use run-tests.php directly…
 
@Andrea it doesn't for you?
 
4:24 PM
What precisely happens before a 3 way handshake?
I have a client trying to connect via TCP to my server, but can't even see the three way handshake in wireshark. I just suddenly see "ICMP host unreachable". Yet, the IP address and port are correct
 
@bwoebi not on my machine at least, maybe it relies on some makefile trickery that macOS's outdated make doesn't support
the parallel test worker might be my best contribution to the php development experience :p
 
@Andrea Indeed it does not, I've been recently using run-tests directly.
 
@Andrea make test TESTS="-jN ext/ext" works
Although apparently that's not the proper usage of TESTS :')
 
@Girgias boo?
 
4:31 PM
@LandonZeKepitelOfGreytBritn probably not the best channel for your question, it's a bit too low-level…
 
there's probably an IRC channel for networking nerds that might know? :shrug:
ooh, I forgot I committed the words “PHP is terrible” to the PHP source code. still there today :D
 
@Andrea where is it :-D
 
@bwoebi run-tests.php :)
 
hehe, I agree, that behaviour is terrible
 
5:24 PM
huh, despite the JIT, the Zend VM isn't so hard to modify as I expected…
 
Hm. The notes-summary emails appear to be broken. They're reporting note counts that are considerably out of date. (Eg, it says there's 40 comments on switch. There's actually 3, because I deleted the others weeks ago.)
 
$ sapi/cli/php -r '"hello"->foo();'
wowza, 's a string errybody, letsago
Abort trap: 6
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -6757,6 +6757,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_
                                if (IS_CONST == IS_CONST) {
                                        function_name = RT_CONSTANT(opline, opline->op2);
                                }
+                               if (EXPECTED(Z_TYPE_P(object) == IS_STRING)) {
+                                       fprintf(stderr, "wowza, 's a string errybody, letsago\n");
Now I just need to draw the rest of the owl!
how hard can it be,
 
@Andrea I still say the pipe operator is the superior and easier option.
 
that wouldn't solve the naming thing
 
Naming thing?
 
5:30 PM
my main goal here is to have a more consistent and descriptive naming scheme for the string functions
the convenience of -> is just a bonus
 
That's the job of a standard lib.
Not the language syntax.
 
this would go in the standard library :)
PHP is rather unusual among popular languages today in not supporting methods on strings and arrays
it's less lonely when it comes to integers and floats
 
But why a new syntax for it that is specific to that, when it's isomorphic to a proper pipe operator, which has an easier implementation and wider applicablility?
 
no new syntax, just extending an existing one!
 
Methods on strings is a new syntax for PHP. :-)
 
5:33 PM
$foo->bar() is an existing syntax, I am just allowing a different $foo :p
 
And how would you define a new "method" on a primitive?
 
the user wouldn't, the standard library would
 
@Andrea Why not add extension methods like c# and allow them on primitives?
 
5 hours ago, by IluTov
@Andrea I threw together something a while ago, the approach was extension methods to move the implementation of the scalar API to userland but people here seemed to prefer a fixed API with no way to extend from userland. https://wiki.php.net/rfc/scalar_extensions
 
meh
 
6:03 PM
I'd concur with the php-src based functions. Otherwise it'll take some horrible workarounds where you define overrides at per-class level etc
 
 
1 hour later…
7:09 PM
I really don't want someone redefining what $string->substr(...) does because they think they're clever.
 
JRL
7:23 PM
it's fascinating to me how defensive the design of new PHP features is compared to other languages
i can't say i disagree
it's just... fascinating
 
7:48 PM
haha
maybe we're just used to the bad reputation of the language…
 
JRL
no one needs to be defensive for a language that is used for exactly one domain by one type of person by a total of like... 50,000 people in the world
PHP is used by too many people for too many things to pretend these things won't actually happen
just too successful
 
8:09 PM
that's true!
I think, also, it may be because some of us have seen how things can go wrong in practice
We want to avoid past mistakes
 
JRL
yep, certainly true
actually, a big portion of what informed the design on my RFC was that sort of thing. i was extremely defensive in the design. and even most of the people who voted no did so with the caveat that they thought the design itself was very well done.
so it also helps produce better language design IMO
huh, the reported line on the error message changed between 8.0 and 8.1 on this: 3v4l.org/moCnT
not sure what update to the engine changed that
 
what RFC did you write?
 
ah, what a shame…
 
8:50 PM
@AllenJB the images are stored in this path D:\xampp8\htdocs\www\myapp\uploads
o/
 
9:14 PM
@PHPFan it's possible that 1. the interpolation of the ImagePath results in invalid html (you should add double quotes around attributes values even if somtimes it works, in this case probable if the ImagePath is uploads/somename.jpg the slash will break html 2. you need to make sure the path in the html corresponds to the path of the actual image visible from the wide world. the web has no clue (with good reasons) of the path of the image on a server's disk, only the path of the public root
for instance, D:\xampp8\htdocs\www\myapp\uploads\image.jpg is not an image url, that would probably be something like https://somedomain.com/uploads/image.jpg
so if ImagePath is equal to uploads/image.jpg you'd need to do whatever is needed so that the final html markup is something like <img src="/uploads/image.jpg" />. notice the prepending / before uploads.
 
I am using localhost
 
that is inconsequential here, the mechanics of making an image visible apply to web servers
"localhost" is a domain name, as far as your computer is concerned (more or less)
basically the most important thing is that you understand intimately the difference between the absolute path on an actual hard drive vs a resource path in an url, the rest stems from that notion
 
Image shown as this
 
begin by making sure that the image exists and is visible publicly by visiting localhost/uploads/doctor.png or whatever it should be
 
9:22 PM
that is no uri.
 
image exists
 
can you see it from the browser? at what url can you see it in the browser?
 
> localhost
Where is local, depends on where you are.
 
alright, so you must make sure that the img element has /www/myapp/uploads/doctor.png as the src attribute.
 
9:25 PM
@Danack On my PC
@FélixAdriyelGagnon-Grenier I don't understand your latest statement
 
I don't know how to make it clearer, an html element is something like <img>, an attribute is any of the values we add to such elements like <img src="src-attribute" and the src attribute of an html element that would display that doctor image when being served from your localhost should contain /www/myapp/uploads/doctor.png
 
for the record, having user uploads be in a directory that is accessible via the internet, might be more exciting than you would hope for. I'd pretty strongly recommend having them be in a non-public directory, and then serve them either by apache, or by using readfile() in PHP.
 
6 hours ago, by PHPFan
echo  '<img src=$row["Image_path"] style="width:100%;height:100%;">   </img>  ' ;
There should probably be quotes src="'. '$row["Image_path"]. '"
 
9:31 PM
or something......
printf is nice.
 
right? I have long held some kind of unease with printf and sprintf but lately I love them so much
 
printf('<img src="%s" style="width:100%;height:100%;" />', $row["Image_path"]);
if that's not the problem that needs fixing, I'd suggest looking either in the apache log, or network bit of developer settings to try and find the reason why the image is not being served, if you are sure the image is in the right place.
 
@Danack <img src=".../Myapp">uploads/doctor.png in Inspector
 
er, I'd really quite strongly recommend never user dots in urls. Just make everything be absolute path
also, that looks quite wrong as a url.
 
dots are not from me, they are shown in Inspector
 
9:47 PM
@PHPFan the inspector only shows you the code that your own server produces
(or, other servers, but if you are looking at your own page from localhost through the inspector, that is your code)
if you want, you can also look at the source code of the page if you want to be extra sure the inspector is not inventing stuff.
 
that's not quite true, element inspector will show you whatever the state is of the DOM, including if it's been manipulated with scripts.
 
yeah, and also sometimes it can invent tags or stuff around invalid html or plain text
but, generally speaking, it will not be insterting stuff into the markup that comes from other websites
actually, could you please right-click on that page, show source code, and paste the exact markup of that faulty image @PHPFan? it's weird that the uploads/doctor.png appears within the img element
like, I would not hazard that the code you posted hours ago produces that html markup
 
@FélixAdriyelGagnon-Grenier You asked about the old code shown here?
 
10:04 PM
what is the code to change the output <img src=".../Myapp">uploads/doctor.png to <img src=".../Myapp/uploads/doctor.png
 
10:41 PM
Parse error: syntax error, unexpected identifier "Image_path", expecting "," or ";"
echo '<img src="/.$row['Image_path']' ;
 
JRL
i think any IDE will tell you what the problem is
what are you writing the code in
 
Mar 24, 2020 at 18:18, by Danack
22 mins ago, by Danack
@PHPFan time to get PHPStorm.
 
JRL
i can tell you at a glance what the problem is
but i dont really want to
because you'll keep having these same problems
for which the programming world has a solution
IDEs
 
@PHPFan Think of how many hours you would have saved.....
 
Really but it needs serial number
 
JRL
10:44 PM
id rather help you get a solution that solves all these problems going forward than this specific one
if this is what you do, just pay for it. it's worth it. if you don't want to, even something like netbeans would catch this one
or VS Code
 
phpstorm is way too cheap for what it is to even think about it
 
JRL
yeah, and thats even with their price increase
 
100%
like, even is php is just a hobby, the time you will save makes it worth it @PHPFan.
 
good
 
JRL
the only situation in which i think that's even a question is for someone like a 12 year old without access to their own card number
which fair enough, but even in that case, VS Code is better than something like notepad
 
10:48 PM
@PHPFan so do it! the syntax error you have up there is way too basic for you to even spend more than 20 seconds on it
on that note, I shall go play some dek hockey, have great nights \o
 
11:28 PM
There may be extenuating circumstances that make getting phpstorm difficult. Poverty and having mouths to feed, mainly. Most of us don't have that problem, though.
But that's not an excuse to not use VS Code or netbeans though
(my point being, if it's financially viable, just fucking buy phpstorm)
 
11:47 PM
If it is for a hobby, there is a way to use an OSS license for free, which can be obtained by developing a simple system as OSS for about 3 months.
For someone making a certain amount of money and using it for work, it would be easier to simply pay for it.
 

« first day (4313 days earlier)      last day (618 days later) »