« first day (2415 days earlier)      last day (2527 days later) » 

5:03 PM
\o
 
5:18 PM
o/
 
The php team :)
 
@OtávioBarreto Don't interrupt too early, I was about to just \o right now… :-(
 
haha sorry
 
I'm not too angry though :-P
 
Wes
 
5:27 PM
hahaha
isn't that the knid of thing that, if you are too much to the right, can blow your car right up in pieces?
 
Wes
@FélixGagnon-Grenier yes youtu.be/IwBbeORsGo0
 
@tereško what did you do?
 
@Wes that was both less and more dramatic than I would have expected
 
5:35 PM
@Stephen too much lemon juice, and too much cayenne
 
@tereško fyi "Tom Kha soup" is redundant, like "pin number". Tom means soup.
wtf. cayenne pepper?
 
well ... I have a tendency to modify recipes
 
right
 
Wes
@FélixGagnon-Grenier they try to not get the drivers killed :B
 
5:37 PM
@tereško i do the same honestly. have you had authentic tom kha gai here?
here being thailand.
 
Wes
they aren't going really fast on that track so crashes aren't very dramatic @FélixGagnon-Grenier youtube.com/watch?v=vT17vWFkl_w
 
@Stephen nope
 
Wes
that is just below "certain death" crash
luckily they don't happen often
 
@tereško I never really tried much Thai food before moving here. I think I will miss a lot when we leave, I know it won't be the same outside of Thailand, even from a Thai restaurant.
 
5:54 PM
Floats sum return quirk – #74665
 
Wes
6:07 PM
is bob or niki around?
 
@bwoebi?
…guess not :p
Well, I am, maybe I can be helpful, @Wes? :p
 
Wes
@Andrea thanks :B so i have this problem i'm getting the memory increasing in a loop while it should not. i have an array that doesn't contain more than 10 entries but i'm adding or removing at each loop
i use array_splice
 
@Wes it's a memory leak, then?
 
Wes
the memory doubles, which makes me think it's the hash table being resized
 
and that's happening on each iteration or something?
 
Wes
6:18 PM
even if again it's not necessary as i hardly have 10 entries in the array
 
@Wes is it so much as to be a problem?
 
Wes
no it's happening after several iterations, memory gets doubled, like 64 to 128 to 256 etc
well yes, but i want to know if i'm doing something wrong or it's a php problem
the code involved is too much and i have now idea how to debug this
 
that sounds strange
if there's only 10 items in the array it should just stay the nearest power of two
 
something something hold the door something something
 
Wes
indeed
 
6:21 PM
but I don't know about PHP's array shrinking strategy, so maybe you had 200 elements and got rid of 190?
or is it not like that
 
Wes
but i never have that many elements
 
hmm.
maybe PHP is allocating more memory to handle other objects, but not returning it and instead keeping it around for future use
PHP does its own memory allocation, so it will take more from the OS than it necessarily needs
what does the code look like?
 
Wes
code involved is a lot, so again could be i fucked up somewhere, not php :B
 
well, I'd still be interested to see it!
also, PHP's memory usage increasing isn't necessarily bad. it isn't necessarily using all of it right now.
 
Wes
if i fail at solving the problem i will try to isolate the involved code
i don't have recursion almost at all, garbage collection should work
i've tried using gc_collect_cycles after each iteration but nothing changed
 
6:27 PM
well, PHP will not necessarily free unused memory, that's just how it works
but I don't know how the PHP memory usage stat is calculated
so it may take that into account
@Wes is memory usage increasing so much as to be a problem?
tfw you're not sure if this new “bourgeois” thing will work out https://t.co/0OYlFJ9ZTG
enjoy my terrible zend function name jokes
 
Wes
6:49 PM
@Andrea yes :(
 
@Wes ah, okay
 
Wes
another thing i've tried is wrapping the iteration in a function, so that gc can do its work but nope
i have this feeling that it's array_splice's fault
 
might be what you're doing with it
@Wes there's ways to force the recreation of the hashtable. what sort of array is it? all consecutive integer indexes from 0, no gaps?
 
Wes
array_splice should do a copy, right?
 
it might, I dunno
 
Wes
6:57 PM
what i'm doing is either $a[] append or array_splice($a, 0, 1, []) remove or array_splice($a, 0, 1, [4]) replace
 
oh yeah it must copy
 
user6845426
Hello
 
hi!
 
user6845426
Whats up
 
trying to add bad new features to PHP
 
user6845426
7:06 PM
im trying to understand Twig
 
oh. I've used that. I think I get it.
 
user6845426
I've been trying to find some info on how to structure my projects around the model
 
user6845426
most of the stuff i've found was pretty old
 
Wes
gotten rid of array splice but some problem
 
@Sara hi!!!
I'm currently working on something that might be a pain for Hack
sorry :c
 
Wes
7:24 PM
this is obviously getting even weirder
i managed to crash apache
 
D:
…hmm.
Hmmmm.
This code is going to be… interesting.
 
@Gordon new room11 logo? ;)
 
@Andrea nah, just @Wes having one job
 
Wes
why does programming hate me
i love it
@Andrea it's still more probable that i've fucked up somewhere :B
AHHHHHHHHHHHGHH
 
7:42 PM
$ sapi/cli/php -r 'enum Foo {Apples, Grapes, Parsely} var_dump(new Foo);'
0: Apples
1: Apples
2: Apples
hmm…
oh.
for (i = 0; i < members->children; i++) {
    zend_ast *member = members->child[0];
I WONDER WHAT THE ISSUE COULD BE, ANDREA.
 
Wes
lol
 
muahahaha
$ sapi/cli/php -r 'enum Foo {Apples, Grapes, Parsely} var_dump(new Foo);'
0: Apples
1: Grapes
2: Parsely

Fatal error: Uncaught Error: Cannot instantiate abstract class Foo in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1
$ sapi/cli/php -r 'enum Foo {Apples, Grapes, Parsely} class Bar extends Foo {}'
0: Apples
1: Grapes
2: Parsely

Fatal error: Class Bar may not inherit from final class (Foo) in Command line code on line 1
$ php -r 'abstract final class Foo {}'
Class modifier restrictions? Where we're going, we don't need restrictions!
 
Wes
noice
 
I'm going to do something even worse soon
(final classes extending final classes :3)
 
Hi
 
Wes
7:51 PM
lol, why?
 
@Andrea ...
 
@Wes enums!
@NikiC :D
@NikiC Java does that, by the way.
 
Wes
enums using an "abstract final class" seem ok
 
@Andrea wat
 
@NikiC for enums!
 
7:52 PM
abstract final is perfectly fine, but extending final is not...
 
Though there's something even worse I have planned:
classes created on-demand
(because it's a slightly more convenient way to do it…)
 
We should lock @Andrea somewhere without access to a computer
8
 
Wes
lol
 
@NikiC internally though it's fine, right? :D
 
I'm working on a homework for a php course (and taking requirements as a starting point rather than the end goal) - so I'm building a post-submission thingy and as the files got bigger I started breaking them into subfiles and now I'm realizing the moving parts are hard to keep in my head all at once (tired too) --- where can I get started with learning to map the process / flow of the thing I'm working on?
 
Wes
7:54 PM
guys help, how do i monitor memory usage? i want to understand where exactly the memory usage gets doubled for some reason
 
What's the right words for what I'm looking for? Information archetecture seems to be much higher level (i.e. end users in mind etc) -- I just want to map the process of the script... like what goes when where... maybe like a flow diagram
@Wes more context?
 
final classes registered on-demand extending an abstract final class :3
I actually have something approximating a sensible reason for the “on-demand” part
I don't want to spam /that/ many ZEND_DECLARE_CLASS opcodes
 
Wes
register_tick_function(function(){
var_dump(func_get_args());
exit();
});
i did this, and i crashed the helicopter again
 
@Wes >exit();
yeah that, that might do it
 
Wes
omg
i made progresses
yeeeeees!!!!!!!!!!!!!!!!!!!!!
WINNAR
 
8:18 PM
Hey guys I was trying to change folder permissions and typed in "sudo chmod 644 /" and all my applications shut down and now I can't open terminal... please help.
 
Wes
 
@KerrialBeckettNewham that seems rather odd...
0
Q: How to revert a "sudo chmod 644 .*"?

Maxguys! This is my first post here and, unfortunately, and it's being made in very ugly circumstances! I'm running Debian Jessie x64 and an hour ago I installed some fonts for figlet into the /usr/share/figlet directory. I couldn't use them because I was unzipping them with sudo and they didn't ha...

 
Wes
@NikiC busy? help me give you the reproduce code please
 
@Julix yeah I saw that. But I can't open terminal. It just has a question mark over the icon.
 
Wes
basically what i do is $a = [1,2,3,4]; and immediately after whatever(...$a);
 
8:21 PM
@KerrialBeckettNewham the question asker ran it in some directory, while you told it to run it at root, right? hm... not much of a unix guy, but a cool problem. :)
 
Wes
if i convert that to whatever($a[0], $a[1], $a[2], etc) i get no leak
@Andrea ^
 
@Julix yeah cool problem :) but I'm freaking out. I can't open any application and no files are
displa.
 
"Recursively applying this to the root (/) of the filesystem will set these permission on every file and directory on your machine . " unix.stackexchange.com/questions/61997/… -- again a different problem, since he gave too much permissions, right? hm...
 
@Wes huh
 
Displaying ^
 
Wes
8:24 PM
$newEntry = [$removeEntry[0], $v];
array_splice($contents, $searchIndex, 1, [$newEntry]);
// $table->set(...$newEntry); <- memory leak
$table->set($newEntry[0], $newEntry[1]); // works fine
 
@KerrialBeckettNewham ctrl+alt+ one of the function keys can switch to a terminal, and ctrl+alt+ a different one (I forget which) switches back to GUI
 
@Andrea nothing
 
maybe it's just Alt+function key? also I think it's only the higher ones, F7, F8 and so
no, it's Ctrl+Alt+
 
Wes
trying to isolate the issue..
 
@Andrea alt + what?
 
8:33 PM
@KerrialBeckettNewham a function key
try Ctrl+Alt+F1 and switching back with Ctrl+Alt+F7
wait that'll only work on Linux
if you're on macOS you're beyond help probably
 
@Andrea I am on a mac
 
@KerrialBeckettNewham Oh. Hmm. Restore from backup?
 
@Andrea seriously?
 
@KerrialBeckettNewham Er, well, it's the only real solution to this problem if you can't open a terminal
you probably can't even run sudo at this point
 
Single user mode and fix it
 
8:37 PM
@PeeHaa well, you can set everything to 755 or 777 with that, yes, but it's far from ideal
you don't want everything set to 755
 
Or you can reset it correctly
He only did the root and not recursive
 
oh, okay
 
so single user mode?
 
yes
 
@KerrialBeckettNewham your best bet is that or the recovery console. either way you'll need to reboot.
 
Wes
8:38 PM
Apr 7 at 9:40, by Paul Crovella
@wes has an uncanny ability to break his tools
always valid. amen
 
@Andrea What does recovery console do?
Maybe try that first @KerrialBeckettNewham
I hate macs and macs hate me
 
@PeeHaa macs can boot into a recovery partition and it has a terminal among other things
 
Fancy :)
 
but it's just as easy to get into so whatever takes your fancy really
 
Oh wait. Actually I think I used that once to recover from broken updates
 
8:40 PM
@PeeHaa Oh wow I can'ok in singe user mode. How do I fix it maybe undo?
 
@PeeHaa I think the coolest thing about macs on the firmware level is they can redownload the OS over WiFi.
@KerrialBeckettNewham sudo chmod 777 /?
 
@KerrialBeckettNewham There is no undo button
Ask somebody with a mac what the permission should look like
 
oh yeah
lemme check
 
:P
 
I wasn't reading Udo an undo
U can do ^
 
8:42 PM
@Andrea Not sure if awesome or scary
:)
 
lrwxr-xr-x 1 ajf staff 1 27 May 21:42 /
what's that in numbers… 755? I think?
 
@Andrea I don't need the question mark right?
 
6?
I always get confused by them :P
 
@KerrialBeckettNewham yes, the ? was a question, not part of the command
 
Yeah 5
 
8:44 PM
@KerrialBeckettNewham also I think it should be 755 not 777 but let me check real quick to be sure
yeah, do: sudo chmod 755 /
in Single User Mode
 
Unable to start etc/dispersed: permission denied
 
…wait that requires the system to be able to boot
uhhh
you might need to use the recovery partition thing
and then it'd be sudo chmod 755 /dev/ …something
no wait
I don't even know how the permissions of / are changed on a mount point
…you'll need to go to a UNIX IRC channel or something, I'm out of my depth
 
Wait I don't mount a device
Didn't ^
No valid sudoers found, quitting
 
@KerrialBeckettNewham I mean from recovery mode where / is not your macOS install's root and you'd need to mount root
 
Yeah, I'd be scared too. Call Apple?
 
8:50 PM
^ that
 
Wes
160 250 000
 
ah mount points work like symlinks I think, they take the permissions of the root they mount
 
Wes
160m iterations and no leak :B yeeee
 
8:51 PM
probably you can do sudo chmod 755 '/Volumes/Macintosh HD' in recovery mode
assuming you've mounted it
and assuming it's named that
 
and assuming FileVault isn't gonna be an issue…
 
What do you mean an issue?
 
@KerrialBeckettNewham well, I'm not sure how FileVault volumes work here. but recovery mode will probably be able to deal with it
 
@Andrea did you work on the property iteration thingy? If not I might give it a go
 
8:55 PM
evenings
 
@NikiC I quickly stopped because SPL so, no, I didn't really do anything.
 
@Andrea will give it a go
 
Please add ClassicForeachIterator to SPL ^^
 
@hakre that's basically the idea!
 
Yay :) I haven't fully understood why property iteration was removed from foreach (don't remember in which PHP version), I always guessed it was to make it a bit more strict.
 
9:01 PM
@hakre It wasn't removed...
 
Wes
it should be removed though :B
 
@Andrea Wondering if it really belongs in spl...
 
Okay, than I'm just ahead of time... ^ ^
 
@Wes you should be removed :B
 
@NikiC eh, it's where the other Iterators hide :p
 
9:02 PM
hey!
 
@hakre It wasn't removed, just iterable doesn't accept that.
 
Wes
@Gordon weren't you afk?
 
@Andrea Yes, in one 4kloc file ^^
 
@Wes yeah, but done shopping now
 
@NikiC a thing I was wondering about was where to categorise it in the spl.php ToC…
 
Wes
9:03 PM
you always appear just to make fun of me :(
 
@kelunik You hit the nail, that was it. And the reason is as otherwise any object would match the subject.
 
@Wes scnr :)
 
Wes
:B
nikiiiiiiiiiiiiiiii
 
@hakre iterable accepting that wouldn't be very useful. It's usually not what you want.
 
We need the foreachable type.
 
Wes
9:05 PM
iterable, traversable, foreachable
because.
 
yeah. kittens.
 
Wes
@NikiC i'm saving the file that caused the issue because right now i don't have time to isolate it. can you guess what it is already perhaps?
// $table->set(...$newEntry); <- memory leak
$table->set($newEntry[0], $newEntry[1]); // works fine
 
some "cast" to iterable would be nice.
for some quick-hand solutions, e.g. iterating an objects properties, turning skalars into a single iteration of their value, eating arrays, feeding from generators and what not.
 
@Andrea says command not found
 
@hakre (object)(array)$object
@KerrialBeckettNewham drop the sudo?
 
9:08 PM
Do I need the 'm?
''?
 
@Andrea Without the (object).
 
Wes
iterating an objects properties imho should be done through reflection only
 
@kelunik oh true
 
@Andrea yes, similar to that, but more under the hood with less memory overhead.
 
@Wes how do you determine memory leak
 
Wes
9:10 PM
@NikiC i just use words i heard other people use
 
@Andrea @hakre Just use get_object_vars($obj)
 
@hakre That one actually has no more memory overhead than object iteration has anyway
@Wes I mean how, technically
How do you measure memory usage
 
Wes
i have a loop and with that unpack i get memory_get_usage increasing
and with increase i mean that it suddenly doubles (eg from 256mb to 512mb instantly), so i thought it was an hash table resize
without that unpack memory stays about the same all the time
 
@bwoebi @Trowski If you're ok with the docs format, then I'm going to convert byte-stream to a Jekyll site, too.
 
memory_get_usage true or false
 
9:13 PM
@kelunik ah yeah
 
Wes
@NikiC false
 
@Wes 256 MB to 512 MB? MB?
 
Wes
yes
happens after several millions iterations obviously
 
That's a lot of memory
Sounds like an actual leak
 
Wes
well it does in steps. starts from 1mb, then 2, 4, 8 etc. then dies at 512mb, which is my limit
and, it shouldn't increase at all... i'm clearing everything at every iteration
 
9:17 PM
I like how @NikiC has 3 of the top starred things right now. A real quote mine :p
 
@Andrea fuck! That worked.!!
 
@KerrialBeckettNewham hooray!
 
can anyone help me with a problem saving a json string? this is so stupidly simple but I can't get it to save for some reason. if I just do file_put_contents("test.json", $json) it saves, but the second I go to put it in a directory it won't save
 
@DestinyFaith does the directory exist
 
@Andrea yes
 
9:19 PM
@DestinyFaith check the directory permissions
 
idk if i'm putting the path in directory.
file_get_contents(DIR . $gPath) works perfectly fine
 
actually, what error is file_put_contents giving you
 
i'm not getting an error, just nothing is happening
 
turn on show_errors?
 
i'll try that
is there a difference in the directory scheme with file_get_contents and file_put_contents?
when i pass in file_get_contents(DIR . $gPath), I get the file perfectly fine
but when i do file_put_contents(DIR . $gPath, $json) it doesn't overwrite the file
 
9:21 PM
@DestinyFaith check the write permissions on that file
possibly it's not writeable by the web server
 
yep, that did it
i feel so stupid for not checking that
 
we all forget things sometimes ^^'
 
thank you so much for helping me. i'm just trying to get this site done already haha
 
9:40 PM
every single token in php should have a doc comment. leave no line uncommented.
 
...
that starred @NikiC's comment takes all its sense
:P
 
@DestinyFaith just always check return values of a function call for success / error. that is especially true for i/o operations.
 
9:59 PM
@Wes so, you have a repro?
 
Wes
i have, but you don't want to look at it :B
i have to clean it up..
 

« first day (2415 days earlier)      last day (2527 days later) »