« first day (2026 days earlier)      last day (2938 days later) » 

2:19 AM
Kinda trying to debug this. According to the PHP manual to use mb_*() functions you need to have --enable-mbstring or in my case it's shared so I need to have mbstring.so loaded. I run phpinfo() and there is no mention of mbstring other than the compile arguments at the start which is --enable-mbstring=shared. So if it's not showing up in phpinfo() it's not loaded then, correct? If so, then how am I still able to run mb_*() functions? Are those functions in some other extension?
I did print_r(get_loaded_extensions()) where I am using mb_*() and it's not listed, yet the function still works.
 
Ekn
how about php -i ?
 
nope, still not showing up as loaded.
print_r(get_loaded_extensions());
echo mb_convert_case('foo bar baz', MB_CASE_UPPER, 'UTF-8');
outputs:
Array
(
[0] => Core
[1] => date
[2] => libxml
[3] => pcre
[4] => filter
[5] => hash
[6] => Reflection
[7] => SPL
[8] => standard
[9] => cli_server
[10] => libsodium
[11] => intl
[12] => iconv
[13] => json
[14] => openssl
[15] => ctype
[16] => Zend OPcache
[17] => xdebug
)
FOO BAR BAZ
how is mb_convert_case() working if mbstring is not loaded?
This is for PHP 7.0.6. Are the functions an alias now or something of the intl/iconv extensions?
 
3:25 AM
@crypticツ are other functions like mb_get_info working?
 
mb_get_info() spits out a bunch of info, so yes.
 
Ekn
this comment, actually might be related
 
3:40 AM
@Ekn but that doesn't explain why the functions work, yet PHP says it's not loaded. This could cause problems when checking for dependencies.
 
did you compile it yourself or install via some package?
 
compiled myself, and did --enable-mbstring=shared and it did generate a mbstring.so file, but I'm not loading it at all. Which makes me think it generated the shared files, yet also compiled it into PHP itself, but didn't mark it so? I dunno.
I just don't see how get_loaded_extensions() won't show it.
nor phpinfo()
 
my hunch is it's loading some version that's lacking the bits (that I only vaguely remember from some youtube vid somewhere) that expose it in phpinfo.. ldd php happen to list anything interesting?
 
linux-vdso.so.1 => (0x00007ffe001e5000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f64f56a0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f64f5397000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f64f5192000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f64f4dd8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f64f4a0f000)
/lib64/ld-linux-x86-64.so.2 (0x000055c7cf659000)
libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f64f467a000)
 
Ekn
php -i | grep mbstring does this bring up anything?
 
3:54 AM
@Ekn only thing is --enable-mbstring=shared
 
Ekn
which is the configure bit
 
yep
 
4:15 AM
hello every one
no body online
 
@Oldskool lmao. All LMAObox users got perma VAC ban :D
 
4:36 AM
'nin
 
Ekn
mornin joe
@crypticツ pretty annoying it is :|
 
Wondering if I need to open a bug report. I disable all PHP extensions that you can disable (~40 extensions) and load them as .so files on a per site basis. The average person does not do that, so maybe this is some obscure bug nobody ever encountered? I don't want to open a bug report until some other PHP experts think it's a bug too.
 
was just getting hot drink ...
start at beginning ...
that's proper strange
 
YAWN
 
made certain none of your scandir files are loading it @crypticツ ?
php --ini
shows all loaded config files
'nin marcus
 
4:51 AM
Configuration File (php.ini) Path: /etc/php
Loaded Configuration File: /etc/php/php.ini
Scan for additional .ini files in: /etc/php/conf.d
Additional .ini files parsed: (none)
 
strace -o trace.log php path/to/test.php
do that, show me trace.log
(pastebin)
 
so nothing is loading mbstring.so
readelf -Ws /path/to/php | grep mbstring
 
nothing
 
then I have no idea
 
5:03 AM
So...open a bug report?
 
what I would do before you open a bug, is create a clean vm and try to reproduce it again ...
because it's really very strange, inexplicable behaviour, so I don't know what someone is going to do with a bug report if they cannot reproduce it ...
 
'nin
 
been testing this on my laptop, let me try on my VPS with the same binary and see if it too is mysteriously loading it.
 
your test script is just simple right ?
no possibility that composer is loading some sorta polyfill ?
 
5:08 AM
maybe, let me check
@JoeWatkins spot on! Now I feel stupid for not thinking some random package was emulating it. This is why I come to this room =o) Thank you, it was driving me nuts.
 
@crypticツ :)
 
Wes
mornin
 
Ekn
mornin
 
'nin
 
Wes
5:23 AM
did someone notice that phpstorm sometimes gets closed after you return from screensaver in windows
screensaver / monitor stand by
 
What is an "the windoze" ?
 
Wes
windoge
 
who thinks trying to convince me that PHP is a compiled language is a good use of time :D
 
Wes
TIL for 20 years i called it whackamole, but what i actually meant was guacamole :(
 
lol
 
Wes
5:37 AM
i never remember if continue 0 and 1 do the same thing
 
I never use those, and if you write code that uses them, I won't talk to you anymore ...
they are just goto in fancy dress ..
 
Wes
i don't often, otherwise i'd remember
so are you suggesting me to use goto instead? :B
 
ha, I'd probably rather that ... people don't like goto, but they understand it ...
better to use neither
 
Wes
for($x = 0; $x < 10; foo: $x++){
    for($i = 0; $i < 10; $i++){
        goto foo;
     }
}
...like in js
in js it's foo: for(){ continue foo; }
 
evil
 
Wes
5:45 AM
:B
 
6:11 AM
"I'm at a good mood today" OR "I'm on the good mood today" ?
 
@Shafizadeh in
 
I'm always terrified of asking anything on SO...
But lately, I practically need therapy. PHP therapy.
 
@Gordon thx
 
Wes
@Shafizadeh i'm in a good mood today
@Amiga500Kid alcohol helps
 
@Wes got it .. thx
 
Wes
6:19 AM
morning gordon
 
Amiga 500's were awesome though
 
@Amiga500Kid Unlike me .. :-) .. I love asking and I always do that. Try it, it is the best ;-)
 
morning
 
Ekn
@Wes lies
 
Java annotations are evil might be interesting for the current discussion about introducing annotations to PHP
 
Ekn
6:25 AM
morning tereško, Gordon
 
and @tereško will like DICs are evil
 
I have session variables which are arrays i want to unset a particular array variable in session ..please someone tell me Thanks in advance..
 
morning
 
Wes
@bwoebi you haven't expressed your opinion about rewindability of generators :B i'm using that workaround and i have no issues so far. the vars you pass to the generator functions are available anyway in the function scope they wont get gc'd until the generator ends. it's a sign, imho that you could just re-run the function with the same parameters when calling rewind(). i'm not 100% sure it's a good idea tho, but i'd like you to think about it, because the lack of rewind() is hella annoying
 
@tereško \o
 
6:29 AM
@Gordon not sure if trolling or serious
 
Good morning pretties
 
Wes
@Ekn drugs then? :B
 
Ekn
nah
 
@SergeyTelshevsky serious obviously Oo
 
mordgoneningengeningoningingingngignegngienfigneinginging
 
Wes
6:30 AM
@littlepootis moridsfjgd0ossdofksning
 
@Gordon lines 43-54...
 
Ekn
o/
@Wes php works... actually :p somehow... keeping yourself busy in literal terms.
(sorry)
 
@SergeyTelshevsky so because you don't like a few closing braces you'd rather introduce a factory framework?
 
@Gordon yeah..
 
> […] they just add unnecessary noise.
 
6:36 AM
I think DIC's are great because they don't require you to use them at any moment of time
 
I think DICs are horrid, because they introduce a complicated component that needs lots of funny wiring and hides the actual object composition
Symfony DIC anyone?
 
@Gordon it's more of a case of "Java DI containers are shit"
 
I've built a couple of projects using Auryn, as well as the current one, that is pretty big, and I have to say I didn't regret once. The only downside I found are the beginners and interns, but it all depends on if they will to do something more than foreachechoinclude
 
@tereško which we port to PHP
 
Wes
parameter order help anyone?
splice($replacementSequence, int $from, int $limit = null, bool $limitAsCount = false)
$limitAsCount = true forces $limit to be non-negative and the function to return a sequence of exactly $limit length
 
6:46 AM
Moin
 
@Wes should be two methods :P
 
Wes
@Gordon i saw that coming :P
 
@Wes good. that means you are learning :D
 
Wes
it's bs to me, as i said, Jerry is a fool :B
 
@Wes who is Jerry?
 
Wes
6:49 AM
the article you linked about radians and degrees
 
the boolean flag thing is from Uncle Bob's Clean Code book
 
Wes
yeah that, Jerry was the guy that used the boolean flag
...in a very stupid way...
 
@Wes ah, well, then I agree that Jerry is a fool ;)
 
Wes
i'm a fool too, probably...
 
nah....
 
Wes
6:53 AM
the only problem i see with that is LSP of default values.
interface A{ function test($a = true); }
class B implements A{ function test($a = false){} }
but as long you avoid this... imho, there's no problem
(at least in my specific case)
 
we discussed the problem of having a function doing two things at length last week, so I won't repeat it :)
 
Wes
the fact that you have parameters and state it means that they are supposed to do more than one thing... @Gordon
got my point about default value of trailing parameters?
that could be something php could have
interface A{ function test($a == true); }
class B implements A{ function test($a = false){} } // error: declaration of parameter 1's default value in B::test() must be equal to that in A::test()
 
@Wes I don't get your point. If you only want to make sure limit is a certain value, then turn it into a VO and put the validation there
e.g. splice($replacementSequence, int $from, Number $limit)
 
Wes
interface A{ function test($a = true); }
class B implements A{ function test($a = false){} }
function bla(A $a){
    $a->test(); // calls with false
}
bla(new B);
ie, B breaks the contract
 
7:10 AM
it shouldn't since it would not break the client
but I dont see why we would need to have that as a language feature when you can just pass false in the consumer.
 
mornings!
@Saitama did you know they had a mobile version of slither?
 
@Wes as for having that: still doesnt warrant having a function doing two things imo. no one wants functions calc($left, $right, $isAddition = true, $isSubtraction = false, $isMultiplication = false, $isDivision = false) even though it might be clear from the signature.
 
@SergeyTelshevsky !!rebecca
 
Anonymous
7:30 AM
ughhh mornin
 
Morning
 
Which one is correct?
- It is great, is it not?
- It is great, isn't it?
 
@Gordon well, anything that uses notation-comments to impart logic is fucking stupid
if there are people, that are trying to bring it to PHP, it's their own fault
 
@PeeHaa It's not my fault you don't understand OOP :-D
moin
 
7:40 AM
@Shafizadeh Both are correct. Although I think the second one is more common.
 
I see. thx
 
@Shafizadeh both are correct. The difference is in what you want to sound like. Americans use contractions. British usually do not.
 
Ah ..
 
it's the difference between "can't" and "cannot" and "can not"
 
7:41 AM
got it .. (good to know)
 
@tereško True in cinema, not in practice. Probably was true at some point
 
well, in practice one uses contractions to sound less "official" .. or less "stuffy"
 
There is certainly an informality to contractions
 
@tereško Yes, the queen will probably avoid using them. But in everyday life, I don't (you see what I did there? ;-)) think many people care.
 
@tereško Introduce me to the Brits you know :D
Down here in sarf London no one's speaking Queen's English
 
7:45 AM
There is an oddity in that particular example though, in that if you expand "isn't" you end up with "is not it", which isn't valid. Not always comes after the subject "you are not going" vs. "not you are going", but apparently you can ignore that rule when using a contraction
@MattPrelude this, in Manchester I'm sometimes not even sure they are speaking English. And Geordie is just ridiculous.
 
:D
 
@DaveRandom If you think Geordies are bad, check out Sunderland.
 
I've been, and I'll pass :-P
 
UK is really fucked up place. Every collection of 3 or more houses in a field will have its own accent.
 
@tereško I heard UK's accent is the best one
 
7:48 AM
Yes I have often thought that is odd but never bothered to confirm whether it's actually more like that in the UK than anywhere else and/or find out why
 
@Shafizadeh Which one of the 50? :)
 
@Shafizadeh there are like 1000+ accents in UK. What you are probably referring to is "Queen's English"
 
That urban w3schools definition is amazing
 
@Oldskool 50 is just in the London
 
7:50 AM
@littlepootis Never even heard of it, but by glancing over the site, they got what was coming to them.
@tereško Hmm, yeah good point. :)
 
I heard about a study (may have been mentioned on QI) that someone did where they analysed the barks of dogs from around the UK and found that they also have accents. So yeh, not only do we have accents we also have nothing to do, apparently.
7
brb school run
 
@tereško Yeah I know of at least 4 distinct accents just in southeast London
 
@Naruto yep, I play in that app, when I am in my bed, usually...
 
@tereško Maybe .. I just heard that in movies .. (btw your English-writing-skills are perfect, I can read your all comments and simply understand them)
 
my phone (iphone 4) isn't complient with it.. so can't play on phone :P
 
7:54 AM
@Naruto :P, ANDROID_MASTER_RACE
 
@Saitama phone from work... free == free == crap xD
 
true dat ^
 
@Shafizadeh nope, it's not perfect. It's just simple. There is a huge difference there.
 
Anonymous
morning
 
'nin
 
8:05 AM
@tereško no need to be humble here. You clearly perfected telling people they suck ;)
6
 
lol
 
"this is not the best way to do it" "sorry?" "you are doing it wrong" "say what?" "you suck!" "ah!"
simple, clear and concise :D
 
@tereško "perfect" or "simple" .. Doesn't matter for me .. I just enjoy when read a English sentence and understand it completely :-)
for example @DaveRandom is a native but I cannot understand his last comment (which has earned 6 stars). But I'm pretty sure if you write it, I will got it :-)
 
@Gordon funny title (spelling prespective) :-) I will take a look at it
 
8:10 AM
@Shafizadeh it's an english sentence
 
kidding ?
 
Anonymous
A grammatically-correct one.
 
> "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo" is a grammatically correct sentence in American English, used as an example of how homonyms and homophones can be used to create complicated linguistic constructs......
 
The hell !!!
 
@Gordon granted
 
Anonymous
8:12 AM
@Shafizadeh also /s/I will got it/I will get it
 
@samayo You are who had a monkey-photo-avatar?
 
@Shafizadeh It's "valid" in the sense that it's legal, but not something that makes sense in real life. Much like in PHP while (true) exit; is "valid", but it makes no sense and you wouldn't do that.
 
@Shafizadeh lol, no, it was @Leigh
 
Anonymous
yeah.
 
@DaveRandom I see
 
8:13 AM
All languages of every description have oddities like this (although I admit English has more than some others)
 
@DaveRandom much like do {} while (0) is valid but you wouldn't ... oh ...
 
:-P
 
@DaveRandom .
 
:-)
 
I actually wrote some PHP that did that the other day but I quickly realised it was silly
 
8:14 AM
it's silly in php ...
 
Afaik it's only usually done for strict C compliance anyway, since basically every compiler would not bork at an empty statement?
 
:30303423 :'''''''(
 
it's done for macros for different reasons than we do it in code ...
 
@DaveRandom it's done in C so that a macro can be an expression
 
wait, do .. while is an expression?
You can't do if (do .. while)
 
8:17 AM
466
Q: Why use apparently meaningless do-while and if-else statements in C/C++ macros?

jfm3In many C/C++ macros I'm seeing the code of the macro wrapped in what seems like a meaningless do while loop. Here are examples. #define FOO(X) do { f(X); g(X); } while (0) #define FOO(X) if (1) { f(X); g(X); } else I can't see what the do while is doing. Why not just write this without it? ...

 
@JoeWatkins I do it in code to avoid goto. In those situations, one should probably just use goto.
 
for the braces right?
 
@Leigh yes
 
sorry
it's so that if (foo) /* no brace */ works
 
@DaveRandom people squeak when you use goto ... also, it's not always the most direct translation of the instructions you have in your head into C ...
 
8:19 AM
oh btw I found this the other day bbc.co.uk/programmes/b05qqhqp/episodes/downloads semi-worth a listen
@JoeWatkins True, but regards the goto I am aware that people are so averse that it occasionally results in worse code than if you'd just used it.
(myself included)
Somewhat irrationally as well, I'll bet that most of them have never read the original "considered harmful" article or even questioned why they've been told "never do this" (again, myself included)
 
@DaveRandom the one by Djikistra?
 
@DaveRandom There are legitimate uses of it imho, i.e. lengthy initialisation sequences where you want to jump to the appropriate point to start destruction, without nesting a ton of if statements
 
err, there are still people who think using goto in C is an abomination?
it's used in most big codebases for error handling
 
posted on May 03, 2016

New Cyanide and Happiness Comic

 
@FlorianMargaine yes
 
8:25 AM
is it Djikistra or Djikstra? I never remember.
 
o/
 
pretty much my example. if (!initSubsystem10()) { goto deinitFromSysbsystem9; }
 
@Leigh I liked it before the edit
 
8:29 AM
@Leigh This. It's a very procedural construct and that's another thing that people often avoid excessively imho, people get nervous when they see routines that are more than a few lines long but sometimes what you are doing actually is a long procedure.
 
Those people have been indoctrinated
 
@JoeWatkins this will be compiled to just int main() { return 0; } :D
 
the first one reads better to me, but also, it compiled representation much more closely matches what you are actually doing ... in addition, there is opportunity to optimize hot paths ...
no ... it won't ...
some_thing:
.LFB5:
	pushq	%rbp
	movq	%rsp, %rbp
	movl	$0, %eax
	call	some_condition
	testl	%eax, %eax
	je	.L7
	jmp	.L8
.L7:
	movl	$0, %eax
	call	some_other_condition
	testl	%eax, %eax
	je	.L9
	jmp	.L8
.L9:
	movl	$0, %eax
	call	errors_have_occured_noreturn
	jmp	.L6
.L8:
	movl	$0, %eax
	call	some_final_action
.L6:
	popq	%rbp
	ret
.LFE5:
	.size	some_thing, .-some_thing
	.globl	some_thing2
	.type	some_thing2, @function

some_thing2:
.LFB6:
	pushq	%rbp
	movq	%rsp, %rbp
	movl	$0, %eax
	call	some_condition
 
@JoeWatkins with -O3?
 
8:33 AM
obviously not :)
 
that's weird... the functions are never called, so dead code elimination should make them go away
ah :P
 
@samayo well happy new avatar :)
 
chris can you have a look at sysconf(3) and tell me is it possible to get all of that (applicable) info from windows, and do you know how to do it ?
 
@DaveRandom :P
Mornigningigni all
 
yomin
 
8:45 AM
Yay! The pizza delivery Guy arrived!
@PeeHaa '
 
@Saitama You are starring in a pron movie?
 
@PeeHaa lol no
 
@JoeWatkins you want absolutely eveything or something specific?
 
as close to all of it as possible ?
 
Just looking into the very first one (arg max) I found a lot of discussion and no-one saying "here's a value you can use"
It seems to be a hard 32k, ftr
 
8:48 AM
not even from the hive ?
surely the hive has everything ?
 
dunno, but I suspect cygwin would be a good place to start
It probably has an emulation of a lot of it, and it will get the values from somewhere (even if hard-coded and you just copypasta those values)
 
that's a good idea ... one that you'll probably be really good at ...
 
:-P
I can have a look around in an hour or two, need to do some work first
@JoeWatkins what's the end goal here? i.e. what are you using it for?
a lot of them don't make sense in the context of win, e.g. CHILD_MAX is not done by processes it's done by handles
 
ThW
9:07 AM
Morning
 
o/
 
I have a table with ~100mil rows, about ~5GB. It has one column with integers. It's index weights about ~3GB+. Frequent reads for (Is in table or not) and only weekly updates (full table replace). Which storage would be best to have this functionality?
 
The int is the only column?
 
yeah
so basically the index is almost the same size as the table
 
9:15 AM
@SergeyTelshevsky you replace 100mil values each week? what kind of data is this?
 
let's say it comes from a 3rd party in a flat file separated with line breaks
@Gordon invalid passports
 
oh, interesting
 
I thought about redis..
 
same here, but not sure.
 
was thinking about memcache too.. but it grows
 
9:19 AM
@SergeyTelshevsky what about hstore ?
 
how about spinning up several solutions and multiplex to them to see which performs best?
 
!!google hstore
 
PostgreSQL: Documentation: 9.1: hstore This module implements the hstore data type for storing… | hstore vs. JSON - Which to use in Postgres Craig Kerstiens 3 Jul 2013 ... Of course as soon as people realized thi… | HOWTO handle key-value data in PostgreSQL – the HSTORE contrib 20 Apr 2015 ... HSTORE was introduced back in 2006 as p… | Search Url
 
@tereško I've discussed with guys on postgres irc, wasn't in the suggestions
 
> # php --version
> PHP 7.0.6-1+donate.sury.org~trusty+1 (cli) ( NTS )
Feels good man. Morning 11!
 
9:22 AM
> you don't seriously want to store 100 million integers in a single hstore
 
true
 
@Sean o/
 
@SergeyTelshevsky you should probably go back there. Few of us can play in db architects, but that's about it.
 
@Sean Ah, you got it up and running :)
 
9:25 AM
is 7.0.6 stable?
 
 
\o/ I'd compile it myself, again!!--...
 
@SergeyTelshevsky another alternative would be to use write optimized storage like cassandra to persist the data and then keep an in memory index in some read optimized storage, like elastic search or redis
 
@Oldskool Aye, wasn't nearly as difficult as I imagined it would be, and nothing broke!
 
9:37 AM
@Sean 7.0.6? That's not even released yet?
Or is that stupid debian naming?
 
@tereško yeah, but you know, it's like if someone here would say you should use ruby for that
 
@SergeyTelshevsky my honest advice would be: if it's not broken, stop poking at it
 
@SergeyTelshevsky pipelinedb.com/blog/making-postgres-bloom interesting but maybe not useful
 
@Wes I don't oppose, personally, but not sure about Nikita.
 
hi
 
9:52 AM
hi
 
I have 1 directory in var/www/dirfolder to which I just wanted to give read only permission with the help of user created (suppose test) .but when I click on back it also redirect me to that folder and that folder and files are visible
is there any way to prevent it
?
 
Anybody using an nginx + php docker container they recommend?
@John what does that have to do with PHP
 
@taco nothing to do with php just I am using over that server.. curious if you guys worked on that part
 
@John your question doesn't make sense. I take it you are not a native English speaker
 

« first day (2026 days earlier)      last day (2938 days later) »