« first day (2384 days earlier)      last day (2560 days later) » 

12:04 AM
imho generics solve a different problem
I want algebraic types
 
How would algebraic types solve the problem of ensuring types on a collection? Not arguing just trying to understand.
Would a typed array be a primitive type in that case?
 
12:30 AM
I don't think they do. I just want them
;-)
 
1:22 AM
@PeeHaa You about? Here's the new API ;-)
 
 
3 hours later…
4:13 AM
any one know how to set a xmlns:xlink attribute on the root node of a simplexml document?
 
4:40 AM
morning
!!dad
 
I am terrified of elevators, I'm going to start taking steps to avoid them
 
morning
o/
 
morning @Akshay
 
\o/
 
5:13 AM
@Petah when you are using namespaces, chances are your xml is not simple, so simplexml might not be the right tool for the job
 
moin
 
morning Joe
 
@Petah have you tried with the first comment in the manual? php.net/manual/en/simplexmlelement.addattribute.php#106566
 
\o
 
5:20 AM
@JoeWatkins Morning Joe o/
 
'nin
 
Morning @JoeWatkins
 
yo rudi
 
php newbie here, I am trying to get a value for a given row .....$sqlquery="SELECT country FROM student WHERE first ='$uname'";........... where $uname is the user entered variable
after that I am passing....... $results=mysqli_query($conn,$sqlDisplay);
to get the result of the querry for some weird reason it never reads this line
I mean like what am I doing wrong here ?
 
5:41 AM
the first thing you are doing wrong is interpolating user entered variables in your query
 
am sorry layman terms please
 
Hi @Smple_V try likethis: $sqlquery="SELECT country FROM student WHERE first ='$uname'";
 
can I ask some help please is it possible to invoke or launch browser and have this url mysite.com/reader.php?code=12345
via php code
 
@Smple_V you done messed up yo query with user entered shit dawg
 
3 messages moved to Trash
 
5:47 AM
!!canon sqli
 
2785
Q: How can I prevent SQL injection in PHP?

Andrew G. JohnsonIf user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the us...

 
I'm so down with the kids ... you're all jealous ...
in all seriousness ...
> for some weird reason it never reads this line
no idea what that means ...
 
@JoeWatkins ahhRite !!! mate gotcha
thanks @Jeeves
 
@Smple_V You're welcome!
 
@jemz have you tried ... afaik bin uri is pretty standard usage for browsers ...
if you're talking about server side php code opening browsers on the client ... then I have no idea why you are saying these things, and think you should stop ...
 
5:57 AM
@Joe Watkins, I will use this in asterisk because if there is incoming call, I want automatically open browser and display the information of caller..since you said it is impossible.can you suggest me please what other work around ?
or execute batch file then the batch file will open the browser..is this possible ?
 
6:31 AM
 
moin
 
@Trowski Why does Amp\ByteStream\ReadableStream not implement Amp\Iterator?
 
@Gordon nice,looks good ...
 
@Linus it's fully electric
 
> power management algorithm manages the vehicle. It constantly monitors batteries, even in key off position wow
 
6:41 AM
170nm and automatic gear shifting.
if only I had 35k
I'll never buy a bike. all the bikes I like are mad expensive like that
 
electric
 
if had money i would buy previous one you linked before ..
 
things with batteries are shit
 
@Linus the midal for 150k? It's a total stunner but I guess @JoeWatkins is right on the value for money proposition not summing up
 
6:47 AM
ah, the hesketh, yeah.
 
7:13 AM
posted on April 26, 2017

New Cyanide and Happiness Comic

 
hahah ^
 
is re2c required for compiling php?
 
7:31 AM
meurnin
 
ping @JoeWatkins
 
Moin 11
 
yo seanapaul
 
mornin
 
7:51 AM
@Gordon yes
AFAIK
 
@Ekin o/
 
\o
 
@Gordon from git, not from zips
 
thx
 
I recall there was talk of removing the dep though, not sure what came of it (and I might be misremembering)
IIRC it's just used for date stuffz
 
Anonymous
7:58 AM
mornin
 
@JayIsTooCommon o/
 
Hi guys, I have a question about outputting HTML using php.
For example, is outputting an Bootstrap Modal using php correct with using echo?
 
Anonymous
no, why do you need to echo html?
 
To get data from the database and put it directly in the Modal
 
3 messages moved to Trash
 
Anonymous
8:10 AM
@Michael is the html coming from your database?
 
mornes! o/
 
Anonymous
yo pmgnatism
 
No, just data like titles and numbers
ofcourse I store the data in a variable
then output it using php
 
Anonymous
@Michael so just echo the titles and numbers, not all of the html.
 
Not sure I agree with that
:P
Didn't read the conversation though :D
 
Wes
8:12 AM
buondì
 
Anonymous
what, he should echo the html for a modal?
 
I should mention that I call the php script using javascript
 
I almost always send over html fragments instead of just the data
I hate (composing html in) js
 
Anonymous
@PeeHaa eww what? So instead of escaping from HTML, you echo the whole thing?
 
8:15 AM
Yes. When I need to create e.g. a dynamic modal I compose the html fragment serverside and send the entire thing over to the client
 
morning
 
Anonymous
@PeeHaa you're gross.
 
:P
 
Anonymous
yo staboom
 
You are the gross one
You are using JS
:D
morngins @staabm
 
Anonymous
8:16 AM
true
 
@JayIsTooCommon yes I do it like that, tnx for the info
 
I sometimes get regex compilation errors for the pattern `{^[0-9a-zA-Z\.\-\s]{1,}$}`, but not reproducible.. seems to depend on the actual subject string... anyone a idea what the problem could be?
preg_match(): Compilation failed: invalid range in character class at offset 14

on php 7.0.18 (opcache disabled because heap corruptions atm)
 
@staabm Would be weird if that is based on the subject
 
it is indeed
 
Although
You use weird curly brace delimiters
Can't you just be normal?
:P
 
Anonymous
8:19 AM
says miss php-html
 
What templating engine do you use on the client side?
Imo they all suck
 
Anonymous
erm last one I used when I wasn't in a framework was twig, moustache before that
 
hmm, why would I get Zend/.libs/zend_operators.o:/opt/php/src/php-7.1.4/Zend/zend_operators.h:117: more undefined references to `isfinite' follow
collect2: ld returned 1 exit status when compiling php?
 
twig does clientside too?
 
Wes
@PeeHaa WE AGREE ON SOMETHING
 
Anonymous
8:21 AM
@PeeHaa i didn't read your question, dunno
 
@Wes OMFG
 
Wes
what's wrong with using php? :B it's great
 
Anonymous
yesterday, by JayIsTooCommon
Apr 13 at 14:51, by JayIsTooCommon
@Wes god, you're gross.
 
Wes
but i bet you don't agree on the fact that i have short tags enabled in templates @PeeHaa
 
That's stupid
 
Wes
8:22 AM
<? foreach($a as $b) { ?>
<li>...</li>
<? } ?>
 
Yeah. Depending on the environment is terruble
Depending on non default environment is worse
 
Anonymous
I like using alt syntax in templates
 
Wes
now you are gross @JayIsTooCommon
 
:P
 
Wes
@PeeHaa not getting what you mean. i think short tags in templates are ok...
 
Anonymous
8:26 AM
!!wotd
 
perfidious: deliberately faithless; treacherous; deceitful.
 
@Wes What I mean is that it's a "feature" that needs to be explicitly enabled
Move to a new server it doesn't work
 
"faithless"? One of those words does not match
 
Let a new developer work on it it doesn't work
Want to quickly share your code for review / question it doesn't work
 
Wes
yes that's a problem, but there is a limit to the times you can write <?php in the same file
once you reached that, you enable short tags :B
 
Anonymous
8:29 AM
if your code is good, you shouldn't reach that 'limit' - no?
 
@Wes No you don't
There is no limit to that
 
@PeeHaa pong
 
@JoeWatkins I already found it myself in php-src. tnx anyway
 
Anonymous
hoi joseph
 
Wes
@PeeHaa you probably didn't get the memo :B i do what i want :B
moin joe
 
8:31 AM
@Wes yes I got the memo. Doesn't stop me from telling you you are doing it wrong :P
I do agree with the @JayIsTooCommon guy kid too
 
Anonymous
you almost said a nice thing \o/
 
:D
 
Wes
we disagree again \o/
 
@PeeHaa those make life a lot easier as you dont need to escape the delim char in your regex (especially when the regex is kind of dynamic)
 
When I like at my templates the times I need to do <?php ?> are very limited because it's only used for simple ifs and foreaches
 
Anonymous
8:32 AM
^
 
@staabm If the pattern is dynamic you have to escape it either way :-)
 
Wes
let's put it this way @PeeHaa would you use it if it was enabled by default?
or do you care of the "xml compatible syntax"
 
@Wes I might use it
Same reason I happily use short echo as of 5.4 in all my projects
 
Wes
brb shower
 
8:38 AM
@PeeHaa its not user-input based dynamic
@PeeHaa and when using {} as delimiter there is no delim you need to escape
 
True
I still think you are weird :D
Also you @Wes
And @JayIsTooCommon
Anybody else does some weird thing I don't use in their code base and wants to pick a fight with me this morning? :P
 
:P
 
Anonymous
@PeeHaa no, but I had a snr recently demand I use else instead of returns :(
 
@staabm I'm starting to use () more and more
 
@JayIsTooCommon Send him over
 
8:42 AM
@PeeHaa seems anybody arround you is weird.... thats weird ;)
 
Anonymous
:P
 
@staabm :D
 
@PeeHaa o/
 
@DaveRandom never seen in the wild
 
@DaveRandom That I can understand / is somewhat standard practice
lol ^^
People just keep disagreeing with me today :P
 
8:43 AM
No they don't
 
hmm I remember that at php internals there were some kind of errors reported when the subject string is too long isnt it?
 
Anonymous
@DaveRandom heh
 
Yeh it's an internal PCRE limitation IIRC
 
@DaveRandom hehe
 
@NikiC since you fixed bugs.php.net/bug.php?id=74265 FYI I still get this on 7.1.4. anything I can provide to get this fixed?
 
Anonymous
8:50 AM
so thank fuck I didn't buy an SC ticket, I got asked yesterday if I wanted to go on behalf of work.
 
Anonymous
@JoeWatkins I get to hug you after all.
 
Good boss
 
@JayIsTooCommon i'm also gonna ask for that today :P if they don't i'll pay for it on my own, but it would be nicer.. :P
 
Anonymous
\o/
 
Anonymous
@PeeHaa your turn.
 
8:55 AM
@JayIsTooCommon I don't go to confs which use their twitter feed for useless UK politics :P
 
what is the ETA for 7.1.5?
 
Anonymous
@PeeHaa o?
 
what's SC?
 
@Gordon 11th may
 
thx
 
8:58 AM
@JayIsTooCommon you've been warned
 
@JayIsTooCommon Dunno exactly where. Getting tired of all the register to vote bullshit in my feed from UK people
 
Anonymous
oh, I know right - who votes?? it's boring :)
 
1) most of the people who see it are not from the uk 2) those who are know they have to do it because it will be all over the tv / radio / news papers / wahetevr
Also I get the feeling it's a specific part of the people who tell other people to vote
 
Wes
whos good with composer
 
!!dontask
 
9:01 AM
> Don't ask to ask, just ask.
 
:)
 
Wes
so basically i've written some code for the only purpose of testing and should definitely not be available in production :B right now under autoload-dev i have only the tests, i was wondering if it's ok having also src-test there
 
yes
that's what -dev is for :)
 
Wes
but will it be available for those installing the package too? or it's just for the package's own use
 
What do you mean?
 
Wes
9:06 AM
so i have my package A having autoload and autoload-dev

a third party repo does composer require A and wants to use A's dev as well, can they do that?
 
Yes they will also pull the dependencies -dev down
 
Wes
i would try if i wasn't inept at everything. my composer knowledge is limited to composer require :B
i'll have a go :B
 
@NikiC did you already consider optimizing the typical case of loops with inner concatenation, like foreach ($array as $val) { if ($val > 0) $string .= "+$val"; else $string .= "-$val"; } into ROPE = ROPE_INIT(size=count($array)+1, $string) foreach($array as $val) { if ($val > 0) ROPE_ADD(ROPE, "+"); else ROPE_ADD(ROPE, "-"); ROPE_ADD(ROPE, $val); } $string = ROPE_END(ROPE, ""); … or is that not worth it?
 
Wes
another question, should stuff under src-dev use the same namespace of src?
    "autoload": {
        "psr-4": { "Vendor\\LibName\\": "src/" }
    },
    "autoload-dev": {
        "psr-4": { "Vendor\\LibName\\": "src-dev/" }
    }
i imagine not :P
 
btw @JoeWatkins is there anything you want me to come take a look at at your house while I am at the right end of the country for phpsc?
 
9:11 AM
@Wes Neh
 
Can bring some cabling tools etc if you need anything doing
 
Anonymous
and gloves
 
Wes
@JayIsTooCommon god you are gross
 
Anonymous
rude.
 
Wes
and rude, yeah
 
9:12 AM
@Wes Nope I would not do that
 
Wes
yeah i start to see why it's a bad idea. thanks peehee :B
 
9:55 AM
morning
 
o/
 
10:14 AM
mornin
@Wes autoload-dev is designed AFAIK especially for tests you can add namespace "Vendor\\LibName\\Tests\\": "tests/"
 
Anonymous
@PeeHaa i updated that PR, just in case you wanted to reply to levington
 
@JayIsTooCommon Yes was about to ping you about it, but didn't have time yet
Yeah update looks good.
 
@Trowski @bwoebi I'm wondering whether we should just kill Amp\Stream with fire or at least make it no longer implement Promise.
 
\o/
Just add a comment on the bug too if you want @JayIsTooCommon
And thanks
 
Anonymous
i can do that?
 
10:19 AM
@kelunik Neither…
 
@JayIsTooCommon Sure
 
Wes
@brzuchal that was my question. in practice i've seen autoload-dev used only for tests
 
Anybody can add comments
 
@bwoebi The current Message doesn't really fit in byte-stream.
 
Anonymous
oh so I can, thought I needed php.net
 
10:20 AM
It accepts a Stream instead of a ReadableStream.
 
nope that's just for changing the bug
 
@kelunik right, it converts a Stream into a ReadableStream
it is an implementation of ReadableStream
 
Well, ReadableStream as an interface is anyway horrible.
It misses most of the useful methods that Reader in amphp/socket has.
 
Anyone else having problems with images not loading on this page? (some but not all)
 
@Wes I'm also using this that way.
 
10:22 AM
@kelunik well … a stream is not a socket…
 
@bwoebi Why do we need that even?
 
A socket is a stream though
@kelunik I don't know. @Trowski thought it were a good idea to add these interfaces…
 
It should directly be a ReadableStream I mean instead of being a Amp\Stream.
 
hi, in a php extension, I have a situation where the request init is called, but the request shutdown is not called. Does anyone know, when/why that could happen
 
@kelunik no?
I mean
 
Anonymous
10:24 AM
@DaveRandom yeah
 
ah
 
@JayIsTooCommon thanks
 
@DaveRandom All loaded for me
 
@bwoebi Then there's no reason to have that interface.
 
@kelunik well, ReadableStream is designed for streams of strings/bytes
 
10:25 AM
what's your ISP @JayIsTooCommon?
 
@kelunik A socket is a stream though
 
@bwoebi That doesn't matter. If the interface doesn't cover the relevant methods, it's useless.
 
Anonymous
@DaveRandom Entanet
 
WTF do I get a tweet about a fucking musical in my twitter timeline
oh @DaveRandom
 
@kelunik well, these are the relevant methods of a stream.
 
10:27 AM
:P
 
@JayIsTooCommon ah right, I'm using the same backbone, must be an issue there
 
Anonymous
@DaveRandom though I just refreshed and they seem to be appearing fine
 
@bwoebi Please elaborate why not. I'm talking about what Aerys passes as a body for example.
 
@kelunik Why what exactly not?
 
@kelunik Some sort of common interface is required. It should be possible to e.g. pass a "stream" to a file writer. It sucks, for example, that at the moment I have to write file data to disk in order to use it in an artax request body. It should be possible for me to pass a "stream" from another artax request body, and the same function should also accept a "stream" from the local file system.
 
10:29 AM
Why that's a Amp\Stream first and has to be converted to Message instead of being directly a ReadableStream.
@DaveRandom Yes, that's fine, but then there should be pause and resume in the interface.
 
@kelunik basically, we use the Emitter class internally … which gives you a Stream, which needs to be converted to a ReadableStream. There's no such thing like a ReadableStreamEmitter
@kelunik I agree about pause() and resume().
 
Also, byte-stream misses possibilities to signal errors.
Or are they just thrown from advance()?
 
@kelunik correct
 
Also see my earlier ping to @Trowski, ReadableStream should probably extend Amp\Iterator.
 
that's what advance does: poll for new data … and when you poll you also may get errors back.
 
10:34 AM
@Jimbo Ping when confirmed
 
Microseconds to milliseconds using microtime(), is it *100 or *1000?
 
@kelunik fine, but minimal required functionality only please, not another kitchen sink interface like StreamWrapper (not technically an interface but you know what I mean)
 
@JAamish i don't know, but if you find out, please let me know as well. I think this Imagick bug bugs.php.net/bug.php?id=74387 is related to the request shutdown not being called.
 
@kelunik basically pause() and resume() could be used to signal back-pressure to the emitter
 
@bwoebi Exactly.
 
10:37 AM
(you could've told me earlier that you were complaining about pause/resume in particular lacking)
 
close should probably also be on the interface. If it's not a socket, it can just discard all new incoming data.
@bwoebi And close, as said, basically all useful methods of Reader.
 
@kelunik well, not close()
well
hmmm
 
close can just have "don't care anymore" semantics.
 
@kelunik dunno, people may expect close() to have side-effects…
 
10:49 AM
interface ReadableStream extends Amp\Iterator {
    function pause(): void;
    function resume(): void;
    function close(): void;
}
github.com/amphp/socket/blob/… < close even has a inheritdoc.
Speaking of expectations: github.com/amphp/socket/blob/…
A method like read is what I actually expect from a ReadableStream interface.
close is a problematic method name for ReadableStream and WritableStream, because then we can't have half-closed streams.
 
11:14 AM
Can any one guide me how to debug php code in browser
 
I just spent £500 on theatre tickets. I am now officially old.
 
Theatre, classical music or acting?
Even at that price, still, should be fun and enjoyable.
 
Anonymous
@DaveRandom whatcha seeing?
 
contemporary ballet dancing interpreting sort algorithms in motion
 
11:27 AM
Interesting, I'm thinking of going to the Shen Yun performance.
but, it's a tad pricey for something i've never took a liking to
 
@GurumoorthyArumugam I think this video might help you: youtube.com/watch?v=LUTolQw8K9A
 
Random question, are there any softwares/freewares you guys use to create like a vulnerability report to send results to potential clients as PDF? I've never done it that way, and have seen a lot of people doing it recently.
 
Arse is giving everyone a free copy of Witcher 1 Extended Edition.
 
@Darius Why would you give clients a vulnerability report? :P
 
@Darius Tim Minchin. Otherwise I probably wouldn't even consider it.
 
11:35 AM
potential clients, some indian guys have been sending my clients reports to try to land a job. Most of the results are retarded like "easter eggs" showing up because php_expose isn't set to off
 
@DaveRandom oh he is good
@Darius And how will a "vulnerability report" help?
 
He is. Obviously this won't be his usual style of stuff (and he's not actually in it) but I will basically give whatever he's serving a try
 
The only thing I can imagine it helping, is building an argument to have a client ultimately choose you to do their maintenance.
If they're on the verge, it could act as a tipping point
 
Does your maintenance services involve understanding and resolving security issues?
 
Short answer no, longer answer, I try. If I see something's off with the code, even something stupid like unescaped strings or queries, i fix them up.
I think the analysis would just be good practice for myself to know possible holes in websites that I take in for maintenance too
 
11:41 AM
So you are going to give prospects help without them being clients yet?
Sounds like a weird business plan :P
 
Like, last month I took on a client to be hosted on a shared reseller hosting account I have, and his site got hacked by muslim activists and reached all the way to brute forcing cPanel at inmotion.
 
did any of you ever get a "/usr/bin/ld: BFD version 2.20.51.0.2-5.47.el6_9.1 20100205 internal error, aborting at reloc.c line 443 in bfd_get_reloc_size" when compiling your extensions? I am somewhat stumped what's causing this.
 
Nah, just the potential clients that I know are on the verge, lets say they want the service but trying to low ball me, it can be used as an excuse to say, nah you need to pay that amount
even if everything could potentially be fixed by a simple fix, it'd make their eyes go O.O
and as for the hack last month, i thought maybe something like these scanners could help prevent that from the get go as well.
 
@Darius The actual fix is not using wordpress :P
 
Clients orders ¯_(ツ)_/¯
i prefer not to as well, but hey.. work is work..
 
11:45 AM
Clients don't generally want wordpress
They want a site they can maintain
 
I wish i met your clients. Mine think that with visual composer they can maintain it themselves.
because a developer sold them on the idea before meeting me
"look, you can drag and drop!" :O
"no developer needed anymore, just drag the image to where you want it."
 
:P
 
those visual composers throw SEO down the toilet too, bloating the page with HTML that's not needed.. :( and other.. fun stuff. like getting locked in to using it
anyway, i'll take it as a no info on the vulnerability scanners, due to it being useless. Was just an idea :)
 
Automated generic scanners are useless
More fasle positives than being useful
 
thanks for the input
 
11:54 AM
(╯°□°)╯︵ ┻━┻)
 
@Darius I just hope you get paid enough for the damages to your health :P
 
The beginning, I lost a full set of hair.
 
:D
 
God damn it @Jimbo why did you have to go start another conversation about typed arrays :-(
 
Wes
@Darius me too, pulled it off yourself or fell off naturally?
:B
 
11:59 AM
Pulled off a third, then when I accepted it's what I have to deal with, depression made the rest go.
 
Wes
ahaha
 

« first day (2384 days earlier)      last day (2560 days later) »