« first day (4519 days earlier)      last day (653 days later) » 

09:29
Hello All,
I am Nikunj and I am a Laravel Developer. Also, I have an experience in Node socket io within Laravel Mysql. Aslo I have knowledge in production on server like AWS, Digital ocean etc.. Can anyone have any remote opportunity for me to bring me into your team or other organization.
 
6 hours later…
15:08
Does uset() actually free memory? I am storing big cloned object in variable and I just wanted to delete that variable along with releasing memory that hold big object.
You mean unset()?
oops sorry.. yes unset()
16:09
@Exception that question is slightly more complex than it sounds...
PHP's memory management is based around "reference counting" - once there are no variables anywhere that reference a variable, the memory is automatically "released"
so, unset($foo) reduces the number of references to the value/object pointed at by $foo; if it reduces it to zero, memory gets "released"
instantly, correct?
first caveat: if there are circular references (e.g. $foo->next === $bar, and $bar->previous === $foo), then the reference count never reaches zero
for those cases, there is a periodic "garbage collector" which detects unreachable references, and cleans up; see php.net/gc
second caveat: I put "released" into scare quotes, because PHP also manages blocks of memory - when you need to store a 5-letter string, it doesn't ask the OS for 5 bytes of memory
instead, when it needs to, it asks for a block of, say, 100 kilobytes (I don't know the size offhand); then it stores as many variables as it can in that block
so when we say a reference count of zero "releases" memory, it releases it for use by the current PHP process
there's then a different decision for when to release a whole block to the OS, so that it can be used by other processes
I saw a good talk by Julien Pauli at a conference - the details will be a bit out of date, but the key concepts are generally still true I think youtu.be/sm1HUrnsxLI
(wow, 10 years ago! I feel old...)
also, note that unset() itself doesn't do anything special in terms of memory
$foo = make_big_thing(); unset($foo); $foo = 42; is the same as just $foo = make_big_thing(); $foo = 42;
because as soon as $foo gets any new value, the reference count on the old value is reduced
so in a loop, reusing the same variable name, adding unset() may not make much difference, except to make clear to the human reader that you don't need the object any more
16:50
@TimWolla I seem to have problems. Some of them are related to code. Configuring with:
./configure \
  --enable-mbstring \
  --without-iconv \
  --with-curl \
  --disable-phpdbg \
  --prefix=/opt/danack \
  --exec-prefix=/opt/danack \
  --with-openssl \
  --enable-debug \
  --enable-debug-assertions
I get:
Undefined symbols for architecture arm64:
  "_php_random_bytes", referenced from:
      _zif_random_bytes in random.o
      _php_random_mt19937_seed_default in engine_mt19937.o
      _zim_Random_Engine_Mt19937___construct in engine_mt19937.o
      _zim_Random_Engine_PcgOneseq128XslRr64___construct in engine_pcgoneseq128xslrr64.o
Possibly related to b14dd85dca3b67a5462f5ed9b6aa0dc22beb615c ?
 
4 hours later…
20:31
@IMSoP great breakdown overall! One nit, isn't unset() different in the case of a by-reference variable? As in $a = make_big_thing(); $b = &$a; unset($b); $b = 42; isn't the same as $a = make_big_thing(); $b = &$a; $b = 42;, where the first will still have the big thing around in $a, but the second will not... (I only mention this because people tend to use references to "outsmart the reference counter" to try to prevent memory duplication, but wind up making things way worse...
@Danack Try rerunning buildconf. I've updated the m4 definitions, thus I believe the configure script changed.
@TimWolla thanks, that fixed it.
 
1 hour later…
22:04
So mvorisek still has too much time on his hands?
22:43
that's the charming fellow making the rounds in the mailling list lately?
@FĂ©lixAdriyelGagnon-Grenier No.....that's someone else. And as I'm about to suggest they might pop by here, probably best not to say too much.
unrelatingly, I'll be boarding a plane for the first time in... some time now (finally having vanquished my apathy at managing stuff in my life and got a passport) and I'm rather excited / freaking out.
Going somewhere nice, or U(S|K) ?
:P Mexico!
so pretty nice, for some definitions of nice
23:02
@Danack "No." ~ I see you liked his suggestion
anyone around here builds php on windows? some talk at confoo motivated me to try that out
@bwoebi not only does it violate the "smallest change possible is probably best", it also fails to reset the variables if they've been set wrong elsewhere....also: psychcentral.com/blog/imperfect/2020/02/…?
wtf, I just got OOM-killer kill my gcc processes during php-src compilation with make -j

« first day (4519 days earlier)      last day (653 days later) »