« first day (3754 days earlier)      last day (1177 days later) » 

12:01 AM
When variable is reassigned, you lose first value. It is not clear where you put references in question.
 
Ok, what happens when reassigning the var?
and why the var's visible after foreach?
 
What is "var" in your code sample?
 
@Tpojka "you lose" means freed the memory ?
@Tpojka $b
 
@BruceOverflow I suppose, yes. It is being waiting for gc cycle.
 
@Tpojka perfect
so it's correct to think that internally, when reassigned, refcount goes = 0 and it's ok for gc ?
 
12:05 AM
Actually, variable name stays the same, nothing is going to be freed.
I am not quite sure how it works on low machine level.
$a = 0;

$a += 1;

foreach (range(1, 3) as $r) {
$a++;
}

// var_dump($a);

It is just reassigning (or rather assigning new) the value.

Is there some concern behind this question?
 
@Tpojka in this case not
nothing concern or wrong I try to test if I understand correctly the internal behavior
 
@BruceOverflow I am making arithmetic operation over $a but every loop cycle it is new value assigned to variable. That is the point, isn't it?
 
If this it's correct
https://www.php.net/manual/en/language.references.unset.php#82955
I understand correctly
@Tpojka exact
 
12:21 AM
Except you in your example don't have anything related to references. :P
 
sure I referer
```
do */
$a=&$c['one'][2];
/* Look at memory
_______________________________
|pointer | value | variable's |
-----------------------------------
| 1 | NULL | --- | //value of $a is destroyed and pointer is free
```
I think that in this example use & but for my doubt also without & this it's valid
>//value of $a is destroyed and pointer is free
I have the source of PHP on hand but it's difficult to catch this behavior, for me in this moment
I miss still one piece, why the "$a" it's lives outside of the foreach ...
 
I meant in this example of yours.
@BruceOverflow Without & $a will be undefined when/after unset.
 
@Tpojka clear
 
12:38 AM
Late here, good night.
 
Mmm ok but I think explained to me wrong, for me the key point it's that, reassigning o assign free the memory ... then inside a foreach or not,
I not would fight with the reference now :-) it's more complex too
@Tpojka night thanks :-)
 
 
6 hours later…
6:29 AM
Good morning.
 
morning
 
6:54 AM
@FlorianMargaine please could you ping the person (GNi33) you pointed in my direction to check his emails. Or maybe, do you know another person in Austria who might be willing to do the PHP project a big favour?
 
7:33 AM
morns
@BruceOverflow The inside of the foreach loop block does not have its own scope it uses its parent's scope, so the value of the last assignment is available after the loop because they were in the same scope. Hope this helps.
 
@IluTov sure that looks great. The results on 3v4l appear under the branches tab of any submitted script; but I haven't found the time to create a separate page for your branch
 
@BruceOverflow but that is special to php, it is different in C/C++ for example 3v4l.org/cSiTN and cplayground.com/?p=boar-mandrill-hornet
 
@mega6382 Ya, I have supposed this.. thanks
@mega6382 Well
@mega6382 If you succeed to read the discussion, are true in my previous assumption?, The last doubt, it's was clarified from you
 
7:52 AM
@BruceOverflow Yeah, all other points are correct, those values will be cleared by BC and the last value is available because the scope is the same(in php).
 
 
2 hours later…
9:26 AM
@Sjon Oh, I'm sorry. I was looking at the versions dropdown.
 
@IluTov yeah, it would make sense if it'd appear there :X
fwiw it's listed again
 
@Sjon Thank you!
 
10:02 AM
@Danack I can ping him, but I don't know anyone else, sorry.
 
10:19 AM
DOMDocument object corruption during cloning ・ DOM XML related ・ #80665
Petermgq56245afsdfsaf5621 ・ *General Issues ・ #80666
 
11:26 AM
checking for libxml-2.0 >= 2.7.6... no ・ *XML functions ・ #80667
 
 
2 hours later…
\o
 
o/
 
\o
 
In Symfony, How can you access an entity's relationship from within a service? for some reason it's returning an empty array.
 
passed by reference upgraded from notice to error ・ Reproducible crash ・ #80668
 
cmb
2:40 PM
@Derick, I just noticed that you have updated the timezonedb in PHP-7.3; is it common to do that for sec branches?
 
3:01 PM
@cmb I would say it's valid, sec support is still supported, a broken timezonedb is non-functional
and could, I guess, in theory, potentially cause a security issue? :-P
that's a stretch
 
cmb
ACK ;)
 
@DaveRandom Depends on failure mode.
 
yeh, and an almost incredible set of real-world circumstances as well, I suspect :-P nevertheless I personally think it's valid to update timezonedb in sec branches
 
cmb
3:32 PM
the latest update for PHP-7.2 happened 2 yrs ago, though
 
4:04 PM
I think only Old Father Time himself (Derick) could comment on that
 
4:16 PM
@Crell @IluTov there is a mistake in the RFC:

> The UnitEnum interface includes a static method cases(). cases() returns a packed array of all defined Cases in lexical order.

Suit::cases();
// Produces: [Suit::Hearts, Suit::Diamonds, Suit::Clubs, Suit:Spades]

Doesn't look at all like a lexical order to me
 
!!rfcs
 
@Girgias lexical means as lexed, i.e. as the order in the code file is
 
Oh ffs I confused it with Lexicographic order
Okay, Wikipedia does say that it is also know as lexical... (en.wikipedia.org/wiki/Lexicographic_order)
Isn't there a better term for that?
 
4:32 PM
"the order of declaration"?
lexical order is the technically correct term though, because it's actually the order in which they were read, which also happens to be the order in which they were written in this case
 
Terminology the never ending rabbit hole hell
 
4:47 PM
@DaveRandom @Girgias Adjusted. I think that wording is less confusing.
 
Can't initgroups() when specifying numeric user ・ *Configuration Issues ・ #80669
 
Hello everyone, is it possible to redesign the php.net website into a modern one and have it accepted/merged? or are you aware of any reasons why it should stay like this

PS: I miss this room!
 
Well, you can propose a PR and talk on the PHP web mailing list
But I don't see what's really wrong with it
 
@Girgias thanks for the feedback
 
5:26 PM
@MehdiBounya @MarkR was working on something before the pandemic and he became super busy prototype.php.net
I think he has a GitHub repo for it, but I don't remember offhand
 
Thanks @Tiffany for the link!
 
 
1 hour later…
@MehdiBounya out of curiousity, what do you mean by 'a modern one' other other than links keep breaking, and the fonts take four seconds to load.
@kelunik ....that's an useful list, with the worst design I've seen.
 
@Danack It's a starting point, yes.
 
7:17 PM
hilariousy, searcing for "programming standard verb list" now gives me my own question on softwareengineering.stackexchange.com as the 4th result....
 
@Danack 1st result for me :D
 
in time this will come to be seen as the darkest chapter.
 
7:34 PM
despair.com/collections/posters for people who need their own
 
the results I get for "programming standard verb list" are... interesting... mostly verbs to use on a resume, but also this too: docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/…
 
I still don't know what I think about that
 
E_CATS
 
 
maybe 1/5 of the accounts I follow just post cat pictures
 
nothing is happening
 
That's a good cat/FUD ratio.
 
btw if you have the time, review @Girgias's answers - he has some upvote-worthy ones and he could use a little more rep for a lot more privileges :-)
 
7:41 PM
sure
@Girgias Prepare yourself, a storm of upvotes is coming your way :P
 
I'll be completely honest, I just upvoted the first two I clicked on because they were both fine :-P
also don't go overboard, don't want them auto-reversed
I am only encouraging peer review and bestowing upvotes where they are deserved, not violating the rules
 
yes, obviously.
 
(just to be clear)
I don't know if sock puppets are much of an issue on here any more, we don't get any in #11 so I don't notice
occasionally I go hunting for a good question to answer but I so rarely find anything to which I can add and/or have the time to craft an adequate answer
has the influx of utter garbage in got any better yet? :-/
that's how most of us got here, at the end of the day
would be nice if it could be turned into something useful again
 
@DaveRandom There are a lot of stupid questions like "how to sort an array in laravel?" in and the number keeps growing. So, no its not better.
 
is there a way to do views of like "+ - -" or something similar though?
(it's such a long time since I have used the main site)
I'm sure that I could craft useful views with a granular enough filter system
a stackoverflow spam filter, is what I want, basically :-P
should be doable with the api, I might fuck about with it if such a thing doesn't already exist
 
7:52 PM
 
would be good to have a tweetdeck-esque view maybe
just open the main question link in a new tab, can be a dumb read-only view
like columns with filters and headline summaries, is what I'm picturing
 
Yes, that would be nice.
 
Why wasn't @FlorianMargaine already an RO? that seems weird
 
inorite
it's "add the french as RO day" today
 
8:03 PM
lol
 
also everyone please note that I am not in charge of who is RO in this room, if you notice an error then correct it :-P
 
I approve your action wholeheartedly, if that matters. :D
 
Hello
 
8:21 PM
\o
 
@DaveRandom I almost figured out how to solve the problem we were talking about yesterday. Now all I need to do is get pass the first array XD
 
elaborate pls? :-)
 
it's returning Array
(
    [site.com] => Array
        (
            [0] => save
        )

    [save] => Array
        (
            [0] => results
        )

    [results] => Array
        (
            [0] => path
        )

)
which is almost Array ([http://site.com] => Array
(
[save] => Array( [results] => Array([path] => 0))
))
 
OK so, something of a tangent before I actually look at it properly, - in future please use var_dump() rather than print_r() :-)
I don't really understand what print_r() is supposed to be for
 
What do you mean?
 
8:30 PM
function prettyArray($array)
{
    echo "<pre>";
    var_dump($array);
    echo "</pre>";
}
use that instead
it shows you more information in a more orderly and less ambiguous way
 
Ok
 
@DaveRandom no need for echo "<pre>"; either if you have xdebug
@CupOfJava ok, so here is what it looks like, 3v4l.org/TueJR and what is your exact question? what is this code supposed to be doing?
 
lets start with 3v4l.org/0ubvt
(which is just your code, slightly simplified and reformatted for 3v4l)
errr
I mean that URL I just fixed :-P
so, what is your expected output @CupOfJava?
 
@mega6382 it's meant to break down urls into an array tree-like structure where the folder is in the array of the folder before it.
10 mins ago, by CupOfJava
which is almost Array ([http://site.com] => Array
(
[save] => Array( [results] => Array([path] => 0))
))
 
ahhhhh
that is where life becomes a huge pita because you need references
but also I would question the usefulness of the data structure you are trying to create :-P what are you going to do with it?
(there are use cases obv)
 
8:40 PM
if I can map a site by folder I can get all parts of the site
 
so what does the integer value in the leaf nodes represent?
I mean, for:
> [save] => Array( [results] => Array([path] => 0))
what does "0" mean?
 
it's just a place holder for file names
one step at a time
 
ah kk
I see what you want
 
so 0 would turn into Array ([0] => file1.php, [1] => 'file2.php',[2] => file3.php,[3] => file4.php)
I couldn't find a project out there that did something like this. If anyone knows of one a link would be appreciated.
 
give me a few mins
@CupOfJava is this what you want?
ugh I got dirty referencey magic all over myself
 
8:54 PM
:0
Thank you, I need to update the PHP on my machine because it won't run on it :P
 
hah lol
what version do you have?
I can probably reduce it down, it's only syntax suagr
 
I think 7.3
 
@CupOfJava for that you can use 3v4l.org/AkGdV
 
If I want to learn more about what you just did would I look up how to use PHP references?
 
@CupOfJava 3v4l.org/MFcFR will run on 7.3 and I added comments
I will also find you relevant manual links hang on
 
8:59 PM
@DaveRandom I thought you were talking about Reddit at the beginning lol
 
I was fed up of you not being RO :-P
it was untidy and upset my sense of order
 
I don't think you understand the headache you just saved me from
 
I mean I guess realistically @CupOfJava read php.net/manual/en/language.references.php like 10000 times and maybe you might being understand it
references are complicated and stupid and magical and a massive headfuck and evil and occasionally really useful
they will fool you into thinking they are like pointers. they are not.
 
I'll keep it in mind
 
the most important line of code in my example is the unset()... if you are playing with references, make damn sure you get rid of them explicitly afterwards or all kinds of weird shit can happen
 
9:03 PM
@Danack by a Modern design I mean something clean and beautiful (quite vague), the current website’s design looks very old and I imo find it terrible ui/ux wise
 
if you want to add stuff to the inner-most array btw @CupOfJava, you want to do stuff after the inner foreach loop, for example: 3v4l.org/isUbg this stores the URL in the first element of the innermost array that was created, notice how the variable $current is a reference to that array
 
Are people from this room actively using their SO privileges?
 
which is why we delete the variable at the end of each iteration, to prevent accidentally affecting stuff between iterations
@Dharman I (very) occasionally spend a bit of time in the review queues
 
I have recently got my PHP golden badge. I use it as much as I can.
I have been actively moderating PHP tag for the past 2 years. I have deleted a lot of questions and closed even more.
The problem is the constant inflow of poorly written questions.
 
Wait, we have SO privileges?
 
9:10 PM
depends on your rep
you don't gain any privileges from chat afaik
 
There's a number of users that constantly watch PHP tag for new questions, but even then it's not enough.
 
so... check your privilege?
 
@MarkR Boux!
 
I have had >20K for like a decade so I am not a good person to relate to on this matter :-P
once upon a time it used to be fun answering questions here
 
I think I only ever got enough rep to come chat on here then never visited SO to post ever again
 
9:12 PM
in the before times, in the long long ago
also I used to rep whore with the best of them, not gonna lie
but it used to be productive to do so, the general quality of the questions and answers was broadly acceptable
I was also a babydev so I will have talked a lot of shit as well, tho
 
what changed?
 
I stopped answering questions once I started working, even though I wasn’t answering that much compared to Dave
 
there are many nuanced reasons but my personal suspicion is that sheer volume accounts for most of the problem
 
Ok, but answering aside. There's a number of questions that need to be closed, edited or deleted
 
indeed, and I am probably in the top 0.0001% of people in that activity :-P I don't do it much any more but I have done a hell of a lot of it in my "career"
 
9:16 PM
I maintain bookmarks of the worst questions I find. At the moment I have 1.5k undeleted questions saved
 
What is the merit of manually deleting them?
 
there used to be a thing in this room called "cv-pls" which I cba explaining but if you search the chat history an explanation should be findable
 
Hiding nonsense from beginner PHP developers
 
^
s/beginner PHP developers/google/
but essentially the same thing
 
Roomba is a great help. Sometimes it is enough to downvote or close a question and it will be removed automatically. I have 5227 deleted questions in my bookmarks, so I think that I have made a tiny impact
 
9:20 PM
...the robot vacuum cleaner?
 
tbf they would probably ask more intelligent questions than a lot of
ahh
 
error call exit in construct not run destruct ・ Class/Object related ・ #80670
 
user7659542
9:37 PM
test
 
user7659542
don t mind me. I don t even know PHP. Just entered the room to test smth
 
user7659542
ciao
 
@traducerad How do we know whether it worked though?
 
user7659542
@PeeHaa I know. That s all that counts
 
user7659542
 
9:50 PM
are we going to be under attack?
 
10:14 PM
Do you feel under attack?
 
always and at all times.
mostly by my own anxiety.
 
If you don't have anxiety you can't be attacked by it. Bam, I solved the problem, my bill will be in the mail.
 
Ok, that sounds like a good idea,do you want to take my anxiety? I can mail it to you ;p
 
Sorry, I'm already dealing with 7 other people's anxiety. Have you tried dropping it off at the shelter?
 
hmm, shelter is a no go, tell when your load lightens
 
10:28 PM
Things that shouldn't be funny but are: youtube.com/…
Things that should be funny but aren't: twitter.com/harrymccracken/status/1353248503670075393
 
I've tried googling the syntax a bit but google is ineffective with symbol-based syntax. I have a SELECT query that uses a syntax like table_name.custom->'$.columb_name_I_think' that I've never seen before. How can I go about googling this?
 
user7659542
@CupOfJava did you follow me into this room?
 
@Tiffany is that a markdown weirdness? or is there literally a ">'$." in the query?
also...column. columb is a unit of electric charge....
 
@traducerad I've been here for a while. This room is my summer house.
 
@Danack there is literally that. Maybe it's domain specific?
 
10:43 PM
@Tiffany I have absolutely no idea.
so probably ask someone who has touched that code...
 
JSON data type in MySQL apparently.
Ah, so custom is a column name and the part I thought was the column name is something different.
 
11:32 PM
this it's a bug ?
https://3v4l.org/ehAEX
 
^ cool. It looks like one
 
The problem seems in this do_inherit_constant_check > _zend_hash_find_known_hash but I need to look at the code with attention
 
@BruceOverflow I can't imagine how many people are probably using it as a feature.
 
11:47 PM
@mega6382 :-(
@mega6382 so it's no a bug it's a feature? :-)
 
It shouldn't be, but it will be a BC breaking change for sure to fix it
 
@BruceOverflow does it cause a problem?
 
@Danack depends, it's possible to override the constant
 
Same as being able to override public properties?
 
In a large code may be a problem obv...
I think that this it's constant so the message may be like "Cannot inherit previously-inherited or override constant " or not ?
 

« first day (3754 days earlier)      last day (1177 days later) »