« first day (3648 days earlier)      last day (1307 days later) » 

12:58 AM
@LeviMorrison why are you using Laravel?
 
1:12 AM
@Tiffany I'm not. This is a foray into understanding widely used software in the PHP ecosystem. Symfony is on the list as well.
 
 
1 hour later…
2:28 AM
@Danack A FiberScheduler is essentially the event loop. Fiber::await() accepts an Awaitable and the associated FiberScheduler that is responsible for resolving the awaitable and calling the onResolve callback provided to Awaitable::onResolve().
FiberScheduler::run() is used to create a fiber that is suspended and re-entered as needed. Continually passing the same instance to Fiber::await() will reuse a fiber previously created from calling run() on that instance.
github.com/amphp/amp/blob/v3/lib/functions.php#L34 Here I'm passing the same instance from Loop::get() to Fiber::await() every time await() is called.
Amp\Loop\Driver::run() is called only once to create a fiber. When calling Fiber::await(), that fiber created from the FiberScheduler instance is re-entered until the given awaitable is resolved.
 
Yeah....that's what I don't grok. I'll look again when there's an example in the code that doesn't need reading amp to understand.
 
@Danack There are some simple tests in ext-fiber now: github.com/amphp/ext-fiber/tree/master/tests
 
thanks. will also wait until more awake...
 
@Danack Sounds good. I'm happy to explain more when you take another look. There's a super simple event loop implementation to make those tests work, which is a lot easier than trying to understand everything Amp is doing.
 
 
1 hour later…
3:53 AM
I have a bash script issue, can't seem to get this reg expression working

if [[ $APP_NAME =~ (?=.*\s)(?=.*^[^\"]|[^\"]$) ]]; then
echo "match"
else
echo "not match"
fi

it is supposed to find a match if APP_NAME is like `"git hub` OR `git hub` OR `git hub"`
 
 
3 hours later…
6:24 AM
Hi all
anyone knows where can I get list of different PHPExcel versions and their supported PHP versions?
 
 
1 hour later…
7:45 AM
I'd love a polyfill for this! wiki.php.net/rfc/token_as_object
 
@OndřejMirtes I'm going to use that format for the next major version of PHP-Parser, which is really why I introduced it...
If I ever actually get around that ^^
 
8:10 AM
Nice :) You can guess why I'm looking into this now :) https://github.com/nikic/PHP-Parser/issues/722

My plan is to have a "NodeTokensVisitor" which structures surrounding tokens around a node in some nice way so that syntax-related and formatting-related AST rules can be written and eventually be able to write rules that you'd use PHP_CodeSniffer for, but in a much nicer way with 10x less code :)
But first I want to do a PoC for the ternary :)
 
when I learn PHP is burning out normal (like I cant learn anymore for like 3 weeks to 2 months or more) or is it a 100% sign (or it may be) that I am doing something wrong; like if I would pay for a course or a tutor, he/she would explain it to me one lesson at a time in a right order and I would not be burning out
it seems to me that this burning out aspect is a sign of doing something wrong; like I've gotten some info from people (very good info) on the Net, I started going over it and I have kind of burned out (I am on a 17 day of a break now)
 
8:31 AM
@AndyRogers not sure I get your question. but I will suggest a more hands-on approach have a goal in mind like a thing you will like to accomplish eg: maybe build a library card system. Then as you follow a course apply what you learned so far to achieve this goal.
 
8:52 AM
morns
 
morning
 
9:08 AM
@Bobby Axe - I get burned out of learning this (PHP) and I am wondering if this translates into "doing something wrong"; like yes, if you would have a teacher / tutor that understands it fully, you would be taking like one lesson per week and you would not be burning out
it seems that I throw at me some random info (like not in order) and my mind needs some time to process it (like compare it to what I know and put in in the right place, it seems)
or maybe not necessarily - all people always get burned out when they learn this, to a certain extent - it is hard, it takes time, this burning out is normal
burning out means wrong edu process I am thinking; and good edu process would be "clean", no burning out; I mean, I was wondering now, it would kind of help me to understand what I am doing and how, it seems
 
we all have our different methods of learning, apply what works best for you / what has worked in the past.
 
I mean, there is that intuition that drives me (as I am doing self-edu) and what I do seems to be 80% good, so not that bad all together
but I started like 3 years ago (I was doing quite a lot of other things in the meantime, so only about 18-20 months of edu done so far, lets say)
but it seems like at least 3-4 more years to complete the PHP / Symfony / MySQL / getBootstrap.com part
so we are talking 7 years of self-edu :-/
a lot of time; plus possibly Java Script / React (could be also Angular, Vue, PostgreSQL)
I am kind of thinking phpStorm / webStorm user at the same time, get to that level - good full stack; kind of also thinking about touching on node.js (as this is good / popular for this now) and also Python
15 years of edu, it sounds like :-/
so this burning out kind of overlays
I mean 10 years of edu of this from now and getting constantly burned out for the next 10 years? does it sound like doing something wrong?
 
well if you want to cut that 15years down to 4 months, get a job as an intern in a dev company you will learn a lot faster where you have people around to ask questions about confusing topics.
 
I will relate to both of your answers as this is good info; it just seems that burning out is caused by learning about "C" without knowing "B"; or kind of doing "F" without knowing "A" fully
I mean, I dont know it; I should do "A", then "B", then "C", then "D" - as releated to learning the order of alphabet
it seems that I dont see the whole thing, I grab some random pieces of knowledge and getting this together is burning me out - can this be?
@BobbyAxe - to you, is burning out a sign of doing something wrong, like I learn "C" prior to knowing "A" and "B" fully and in order?
this is what it seems to be to me, but I am not sure
my assumption is, I do "A" fully, then "B" fully, then "C" fully, all fully and in order - I am not burning out
so this would be leading me to trying to figure out the steps of the learning process, type of thing, making sure I have this right
but again, I kind of do 80% of what it should be
and also I dont want to bother like this
I am still a beginner, what I write does not make much sense
but is seems I could get rid of this "burning out" part, get this corrected
move forward faster without getting burned out
and again, thanks for your answers - this is probably the info that I need for this
 
9:30 AM
@BobbyAxe did you get it working? your regex looks ok'ish (for pcre) but it's probably too fancy for bashs =~ and parameter expansion adds to the chaos (like trimming whitespaces you try to match)
 
@makadev nope could not figure out why it never matches any input
I checked the expressions out on regex101.com seemed to work. was proud of my self for writing a working expression :) but plug it in to bash and...... failure :(
@AndyRogers just keep moving one step at a time, try to get a full course on PHP that starts with the basics. I remember learning with the new Boston videos
 
I am 80% ok, I think; it is just what it is, I think - it is not easy, it must take time (like an education of a person takes 17 years, like primary school, high school, college - so I wont do this in a year also)
it seems like I am 80% ok and also that this burning out is a sign of doing something wrong (I dont see the whole pic and I learn C prior to knowing A and B fully and in order)
kind of 6 years of edu and being burned out for 3 :), this is why I am asking, maybe I can correct this :)
 
@AndyRogers it will all make sense eventually just keep learning
 
@BobbyAxe maybe it works another way, like inverting your match? it seems like you try to match a string that starts with double quotes or ends with one, but not both right?
 
yes exactly and has a space
 
9:43 AM
in that case it's easier to match ".*" and invert the result
 
how do I do that exactly
wait like matches everything except my specific outcome?
 
ye
like match^\".*\"$
 
alright I will give a try thanks
 
mornings
 
10:40 AM
Hi All...Can anyone please tell me why this code is not working in php 7.4
$code = rand(1000, 9999);
$im = imagecreatetruecolor(50, 24);
$bg = imagecolorallocate($im, 22, 86, 165); //background color blue
$fg = imagecolorallocate($im, 255, 255, 255); //text color white
imagefill($im, 0, 0, $bg);
imagestring($im, 5, 5, 5, $code, $fg);
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
 
anyone knows where can I get list of different PHPExcel versions and their supported PHP versions?
 
11:04 AM
@Exception doubt that there is one around and PHPExcel is deprecated for some years now, so I doubt that anyone cares either.. you can check the github repos or packagist for (lower) version constraints, seems like 1.8.2 was the first version to support php 7.0 while everything before was php 5.2+
 
Thanks @makadev
 
11:28 AM
@makadev Answer me too if you know.Thanks
 
11:48 AM
@bwoebi I have a question. Each enum case has an auto-generated constructor that basically just assigns all the parameters to the given property with the same name. How do we achieve this? There are two options: Generate an actual constructor through a pseudo AST passed to zend_compile_func_decl or by creating an internal function that looks loops through the properties and assumes to find a param with the same name. Which one do you reckon is better?
The latter would make it easier to build internal enums in the future I guess.
 
12:25 PM
Good morning everyone. How to get to IF "Ter" and IF "d5"?
<?php

$parcelas = "d5";

if (strpos($parcelas, "-") !== false) {
	echo "1-12";
	die();

}elseif(strpos($parcelas, "/") !== false){
	echo "7/14/21";
	die();

}elseif($parcelas == "0"){
	echo "0";
	die();

}elseif($parcelas > "0"){
	echo "7";
	die();

}elseif($parcelas=="Dom" || $parcelas=="Seg" || $parcelas=="Ter" || $parcelas=="Qua" || $parcelas=="Qui" || $parcelas=="Sex" || $parcelas=="Sab"){
	echo "Ter";
	die();

}elseif(strpos($parcelas, "d") !== false){
	echo "d5";
	die();

}
 
12:50 PM
@IluTov I'd go the internal function route. The userland variant will most definitely make problems with internal enums.
(because the arena is not persisted across requests etc.)
 
@Shahid "not working" is very vague. What is not working? Do you get an error message, if so, what? (And make sure you have errors turned on) also, don't ping random people asking them to answer your question. It's not cool.
 
@Tiffany The image cannot be displayed because it contains error ....this error is displaying on firefox
 
then specify what the error message is
 
@bwoebi Ok, thanks :)
 
you're not going to get help if you don't explain the problem
 
1:04 PM
Morgens
 
@Tiffany firefox is not telling any error other than that
I am creating a 4 digit captcha image png
Code Works Perfect on live hosting php version 7.2
But on localhost php 7.4.9 its not working
 
https://3v4l.org/1voLV
Is this expected in PHP 8?
 
Just to confirm, this reddit comment is utter bollocks, right? reddit.com/r/PHPhelp/comments/j8x25w/…
@FrankLiepert No seems like an actual return type has sneeked in
Can you open a bug ticket?
 
@Girgias Sure, will do that.
 
2:06 PM
@BobbyAxe Hi Bobby. Fyi, please don't indulge Andy's OCD. He needs to go talk to this doctor before he's welcome to take part in this room.
@AndyRogers Go see your doctor. Until then you are not welcome here.
s/ocd/mass spamming/
 
cmb
2:39 PM
 
@NikiC What do you think this should do?
IIRC you were saying string keys of arrays must under-go integer canonicalization, but as far as I can tell this avoids it.
 
3:38 PM
@AndyRogers You have been spamming this room for years. This behaviour is detrimental to everyone else here. This is a room owner warning. You are allowed to ask for help on how to write a particular piece of code, but you are forbidden from asking any open ended rambling question on "how to learn" or theoretical questions about programming unrelated to a useful project. Violating this rule will result in a ban from chat.
(everyone else....yes, I know. But sometimes things need to be done 'by the book'.).
 
@cmb Thanks for the quick PR. Should I still create a bug ticket?
 
cmb
@FrankLiepert I don't think that necessary. :)
 
@cmb Okay. What do you think about the following issue: 3v4l.org/h7M5C
 
@FrankLiepert I don't see the bug in this, you're breaking the API contract
 
cmb
@FrankLiepert see github.com/php/php-src/blob/…; it seems to me the behavior of your code snippet follows from that
 
3:52 PM
So it's more a documentation issue? Because it sounds like the method can be static or non-static: php.net/manual/en/xmlreader.open.php
 
@JoeWatkins On the topic of your latest musings, I don't think you can just wave-of-hand and dismiss the idea of a foundation. Most people wouldn't be able to easily set up the legalities of hiring another person across the world to work on PHP even if they wanted to
 
How to get to IF "Ter" and IF "d5"?
 
@Danack I felt something was odd... but... I have taken note.
 
<?php

$parcelas = "d5";

if (strpos($parcelas, "-") !== false) {
	echo "1-12";
	die();

}elseif(strpos($parcelas, "/") !== false){
	echo "7/14/21";
	die();

}elseif($parcelas == "0"){
	echo "0";
	die();

}elseif($parcelas > "0"){
	echo "7";
	die();

}elseif($parcelas=="Dom" || $parcelas=="Seg" || $parcelas=="Ter" || $parcelas=="Qua" || $parcelas=="Qui" || $parcelas=="Sex" || $parcelas=="Sab"){
	echo "Ter";
	die();

}elseif(strpos($parcelas, "d") !== false){
	echo "d5";
	die();

}
 
@Tiago Step 1) please use gist or pastebin for chunks of code. Step 2) break your code into smaller functions, so that you can understand it. 4) Profit.
 
4:03 PM
@Danack The last two IFs that I can't reach.
 
> Step 2) break your code into smaller functions, so that you can understand it.
and give those functions names....though possibly this might not help a huge amount in this case, it should help a little.
 
@Danack But this is already a small ifelse. The first 4 work, the last two do not. I just need that instruction.
If you're seeing the error, please tell me where I'm going wrong.
 
May 1 at 12:49, by Danack
@IMSoP There comes a point where asking questions and then refusing the answer given, and instead insisting that an answer that fits the faulty assumptions they have made, becomes a form of "help vampiring" which is not allowed in this room.
"where I'm going wrong" You're refusing the help being offered, and insisting that someone helps you in a particular way. In this case, you're asking someone else to debug your code.
Your real problem is that you don't understand your code. Rather than getting someone else to debug it for you, you would be better off writing it in a way that you can understand.
 
@Tiago that is not a small if/else
a small if/else is like three blocks
if this
else if that
else blah blah blah
 
@Girgias If it's not a bug, then it should be mentioned in the upgrade notes that the contract has changed.
 
4:14 PM
take Danack's advice and make it smaller
break it into smaller parts first
 
cmb
@FrankLiepert yes; the docs are not yet up-to-date for PHP 8.
 
1 message moved to friendly bin
Enough. you've been given feedback on how to solve your problem. Please don't ask people to solve it by them debugging it.
 
@FrankLiepert The contract hasn't change from what I see, you've just been using the method wrong. And that thing about not being able to call static methods "dynamically" is in the upgrading document which is just not yet published/wirtten in a documentaiton format for the onlinde docs
 
How difficult were you guys telling me where I'm wrong?
 
Is there a way to search user notes by the page they're on? There's a page that has been deleted from the docs but still has a zillion (OK, 40-something) user comments on it, all of which should be deleted at this point.
 
4:17 PM
I've been trying to make this work since early, here is always the last place I come to ask for help!
 
May 30 at 12:37, by Danack
@Tpojka 'hypothetically', is it more useful to give someone an answer to the current problem, or to teach them how to ask better questions?
I hope I am at least consistent in this opinion.
 
cmb
@Tiago see 3v4l.org/MYFCK
 
@Tiago "here is always the last place I come to ask for help!" - it's time for you to 'level up' as a programmer. Part of which is taking advice on how to solve your own problems.
 
@Girgias It's not about calling the method, it's the declaration. And as of PHP 8 the XmlReader::open() must be declared statically. Isn't that changing the contract?
 
@Tiago a couple criticisms: in your code sample, you're using ==, which is generally bad practice because it's truthy, if you don't know what truthy is, please google it. Other criticism, in the part where your code isn't accessing, your code uses case, generally it's better to make your code case insensitive by using functions that convert the strings into all caps or all lower case
 
cmb
4:19 PM
 
@cmb Hm, looks promising.
 
@FrankLiepert If that's the case yes, but I'm surprised it's not already in the upgrading document
 
ah ha, yes, that works. Off to delete 40-something comments..
(Should I even bother reading them first?)
 
cmb
@Crell, ta (quickly skimming might make sense)
 
4:22 PM
*deletes the 5 "that's not how to use a singleton, this is a singleton" comments...
 
@Crell I read that in a Crocodile Dundee accent...
 
As well you should.
 
@Tiago another piece of advice, don't come here specifically only to ask questions. Lurking and reading conversations is also a great way to learn how to improve your code.
 
(Seriously, did that page talk about singletons before it was removed? Because there's so much singleton over-engineering in these comments it's almost funny.
 
@FrankLiepert found the relevant commit made by @cmb which indeed doesn't document the change: github.com/php/php-src/commit/…
 
4:27 PM
@Tiago calm down, debugging with anxiety will make you miss the obvious, now to fix your issue we will start by removing all the die() then changing all the ifelse() to if()then use === for comparison and see the documentation for strpos() check what it returns (boolean or null or int) then take note as $parcelas > "0" will never work at least not in the way you expect it to
 
cmb
@Girgias ah, indeed! I'll add a note to UPGRADING ASAP.
 
I am very disappointed, because I only come here to ask when I was unable to solve the problem, I research on the internet, in the forums and when I do not find a solution I see if someone could be so kind as to point out where I am wrong, that's all! 3v4l.org/lSj2k
 
@cmb No worries, seems to be a weird edge case to forget about :D
 
@Tiago We aren't here to debug code for you. You've been given advice, refused to take it, and now are complaining about people who are taking the time to give you meta-advice.
 
There are people who have easy learning, I can only learn from examples. Don't judge me!
 
4:29 PM
@Tiago don't say such, no one here is being paid to help
 
> There are people who have easy learning
 
@Tiago trust me... it's not easy learning
 
.....YOU KIDS DON"T KNOW WHAT ITS LIKE TO LEARN WITHOUT THE INTERNET.
 
when I learned HTML/CSS, I had to get a library book :P
 
Same, but clay tablets.
 
4:30 PM
granted, that's assuming one has access to a library, and that the library has computer books
 
@Girgias @cmb Thanks for taking care of it.
 
@Tiago I also learn best from examples, but I've learned to cope by using a LOT of scratch paper... taking what people suggest, and trying to make my own examples on paper, trying to take it apart. I can't do it in my head.
most of my code is written on paper
but if you're not willing to take the couple of criticisms I gave regarding your code... that's your problem
 
I will keep trying and researching, if anyone wants to show me where the error is, I will be very grateful. I think that way because that's how I do it in my daily life when someone asks me for help, I help.
 
cmb
4:46 PM
@Tiago the exact error has already pointed out twice.
nope, three times already
 
It sounds like a joke, but I can't see this error that you can :(
Silly thing like that, it's been taking me all day :(
 
@Danack Andy "Open Ended" Rogers :)
 
cmb
@Tiago learn to use a debugger. :)
 
If that's a legit oopsie, that's one way of getting people to try 8.0
 
5:02 PM
@Tiago i can’t see the error. But if i were to debug that code i wouldn’t debug that code. I’d rewrite it first so I could under stand it.
 
@Danack The first 4 rules always worked. Then I needed to create new rules that are the last two, then I can't get past the fourth. Apparently they are simple if / ifelse, but due to some error that I'm not seeing, I can't pass the fourth rule.
 
Your problem is that any string will also make $parcelas > "0" evaluate to true
 
@Derick is it correct to write this way? is_numeric($parcelas) && $parcelas > "0"
 
morns
 
@Derick Thanks, I got it.
 
5:23 PM
Why are people posting their own custom ini parsers in comments on the parse_ini_file page? Like, there's several of them. Why?
 
cmb
@Crell if the note doesn't explain, why, I suggest to delete it
 
Some are possibly useful/interesting/add functionality. Others... I don't understand why they're there.
What's the right tag for a code literal again?
 
Notes are for pointing out errors or suggestions to improve the docs. If that's not what they can be used for, they shouldn't be there.
 
In docs.
 
literal? depends on what your formatting
 
5:35 PM
"Additionally, environment variables may be read using ${} syntax." - What do I put around ${}
 
<variable> I think
 
I'll go with that for now.
 
it's wrong
it's <varname>
 
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer and let someone correct you.
3
 
cmb
@Crell I'd probably use <code>
 
5:44 PM
That works too.
 
6:06 PM
@BobbyAxe Thanks. For the record, I am open to reasonable suggestions on how to handle this type of situation better. Someone behaving in a way that is indistinguishable from a bot attempting to waste other people's time without violating the code of conduct, appears to be a difficult problem to handle.
 
"must be able to fail the Turing test as a human"? /s
I can't remember which is the desired condition in this case
 
@Tiffany I have some very bad news. Combine en.wikipedia.org/wiki/Eugene_Goostman with realtime video synthesis youtube.com/… and you have a bot that can probably pass the turing test even if there is a video feed of the test subject.
 
6:19 PM
just pulled a polycom vvx441 out of a box for the first time in a long time, I don't understand why anyone uses anything other than polycom
the old ciscos were nice but the current ones are absolute ds by comparison
(#showerthoughts :-P)
 
@DaveRandom What news of the Bristol 'client' ?
 
@DaveRandom ds?
 
Dog ____
where "bull" refers to deliberate subterfuge, and "dog" is accidental
 
7:03 PM
@Danack a catch-22 situation, but I think the best way is just to notify the person or persons engaging the individual about the issue and let them do with the information whatever they will. just as you did.
 
@BobbyAxe agreed, yet annoyingly this approach still seems to result in the ban-hammer being applied after not too long :-/
this is why I kill.
 
lol :)
 
:-P
@BobbyAxe also worth noting that these people can sometimes be saved. There's a guy who is now a regular contributor (that I won't name) who started out many years ago as a full on help-vampire
 
that's possible, I think the individual sometimes don't know they are doing it
or they don't think it is a problem
but In all, I believe a little bit of kindness always goes a long way.
 
7:28 PM
> "nearly zero" !== 0
fair comment ^
@BobbyAxe agreed :-)
 
As a general rule, giving people enough rope to hang themselves is usually a good policy. They'll either hang themselves or, in some cases, take up creative macrame and become your favorite artist.
 
8:05 PM
@DaveRandom no WhatsApp today?
 
WhatsApp notifications are perma-disabled atm
I can only deal with a finite amount of input :-P
 
Deal with fewer people, less input then
I dunno :S
 
8:22 PM
@Crell I agree, but also (andI should write words about this when not as 'tired'), I have a strong suspicion that any code of conduct needs to be applied somewhat capriciously to allow this to happen.
 
8:59 PM
Ah code of conducts, the bureaucratic tool of oppression to right the worlds wrongs when presented with an opportunity by the minority.
 
9:11 PM
@MarkR you make it sound like it's wrong
Everyone would need to be Jean Luc Picard to not need a code of conduct and that would make life very boring
Well, ish
 
Often. All too many times have those writing such policies, be them community, governmental or other used the opportunity to try and enforce their own broad views. I am much more comfortable with a more surgical approach... lest we end up with using the word blacklist being punished by excommunication and/or public execution.
 
I love TNG, but it is antiseptic
That's a radicalized view of it. We're talking about code, not death sentences
Even room 11 has a set of rules
 
and they are mostly extremely precise :)
 
It tells people who are prone to asshole behavior to not be assholes and where the line is drawn
And it tells people who are usually sensible that "hey, even though you're a cool person, that thing you did wasn't cool"
 
9:36 PM
tfw when I notice my scroll bar isn't changing as I background compile... and realise it's not been scrolling down for 10 minutes and there's 500 error messages
 
10:16 PM
@Danack The idea that there exists some set of objectively fair rules that can be applied consistently without the use of subjective human judgement of a particular case is one of the most destructive fallacies of the modern era.
 
 
2 hours later…
11:48 PM
@cmb Is there a link I should use for the include path in the ini-file doc PR?
I'm thinking set_include_path....
Ah, no, wait, that page has a link to elsewhere that I can steal. nm.
 
cmb
you can link to any xml:id with something like <link linkend="ID">TEXT</link>
 

« first day (3648 days earlier)      last day (1307 days later) »