« first day (2039 days earlier)      last day (2914 days later) » 

user895378
1:29 AM
@kelunik @bwoebi yeah the problem wih artax is i wrote it before we had coroutine awesomeness so the code is very ugly. It really needs to be rewritten.
 
4:02 AM
Monday Morning
 
moin
 
Wes
mornin
Which version of the trunk do you prefer as a logo for @asyncphp? http://i.imgur.com/xCuIT8o.png
vote/RT please :B
 
right, but the left one could be used somewhere, it seems like something bad happened ...
500
 
Wes
ahaha
 
4:51 AM
it might only seem bad because it's next to green ...
 
Wes
206 partial content
 
I'm the last person on earth you should ask about any of this, obviously ...
 
The right one doesn't look as.. badass.
I'd be better if the trunk was more symmetric.
The left one's nice too.
 
Wes
the problem with the left one is that looks cut out
 
y
 
Wes
4:54 AM
@littlepootis AHAHAHAHAHAHA i finally managed to remember where i saw the kid in your avatar
 
mornin\
 
@Wes lol
 
mornin tereško
 
posted on May 16, 2016

New Cyanide and Happiness Comic

 
Ekn
5:34 AM
mornin
 
Wes
\o
 
Wes
6:05 AM
time to get a new pc. want to play doom so much :|
 
'nin
 
What is the best way to cache mysqli query for a specific time in PHP?
 
doog mornin
 
Ekn
@Wes i.imgur.com/IPBPaF5.jpg this is how I remember doom :p
 
Wes
:B those were the days
 
6:22 AM
Morning here. Are there any practical reasons why functional interfaces RFC tends to get so many downvotes?
 
Wes
because haters gonna hate
 
/cc @JoeWatkins
no, really
 
Wes
2 days ago, by Wes
most of rfcs should start with "you know that if you don't need the feature you could just not use it, rather than voting no?" #toptip for future rfcs
 
I used to be ranting time to time to see functions and classes as first-class citizens, and I do love closure from callback (though it is kinda a hack), but rfc itself proposes pretty sane idea
 
Wes
@pinepain people want a typedef type of thing, eg typedef MyCallable = callable(int, float): string;
 
6:25 AM
I want it too, but isn't this rfc about different matter?
 
Wes
but imho it's not a problem if we start with this and we introduce that later
indeed @pinepain
 
there are pretty nice PHP version somewhere in abyss with all nice but doomed RFC and PRs applied.
 
Wes
true, there are dozens of drafts...
at least dan's closure from callable is passing
would have preferred it being new Closure("\\Foo\\baz"); tho
 
it's still a hack
i do aware that we have different hashtables for different entities which prevents a lot of nice thing to be done in php (in a sane way), but having just $sth = \Foo\baz would looks much nicer for me
but such changes will break everything
 
Wes
indeed
 
Wes
6:50 AM
that reminds me i need to work on something...
 
Morning
 
Wes
i love how the new doom is not dark at all (as in, having poor lighting). it's easy to make a scary environment by making everything super dark, this is better :P
 
7:07 AM
@Wes Eh, I don't really like games that rely too much on lighting to create fear.
That usually means jumpscares, which are the worst kind of scares.
 
Wes
it's what i meant
it's surprisingly not-dark to be a monsters game
 
Oh, I didn't read the "not"
My bad
Dangit brain, that's the 2nd time today!
 
Wes
poor lighting also means they are trying to hide poor gfx quality
and i love how this reminds me the old doom games, with super close distance fighting, or even melee
 
so, there is this: imgur.com/gallery/2j3C4X1
 
@tereško We've had a few Thais in our neighbourhood who loved playing that
Had a special ball and everything
Watching them was mesmerizing
 
Wes
brazilians do it even better, it's called futevolei
 
Anonymous
Mornin :>
 
Wes
@Danack can we have a is_callable() that allows to specify the call context? eg
say method "baz" of class Foo is private
is_callable([$obj, 'baz'], '\\'); // false, as private can't be called from outside
is_callable([$obj, 'baz'], Foo::CLASS); // true, as baz is visible to Foo
is_callable([$obj, 'baz'], FooChild::CLASS); // false, as baz is visible to Foo class only
 
@Wes Please format your code - hit Ctrl+K before sending and have a look at the FAQ.
 
Wes
shut up jeevs
 
Anonymous
7:32 AM
lol
 
!!shuddup
 
Morning
 
Anonymous
@Saitama o/
 
8:00 AM
@Wes but he's right :-P
 
Wes
shut up bob :B
 
Morning
 
Wes
oh bloody hell -__- i just noticed when __get __set etc are involved, an entry you'd expect to see in the backtrace gets eaten / collapsed as one called __get directly
 
@MadaraUchiha +1
also, morning
 
Wes
though @bwoebi opinions? i don't think is_callable should have more arguments, as it's awful already
a new function would be better, eg can_call($callable, $context = '\\Acme\\MyClass')
 
8:16 AM
@Wes A callable just just always be callable. My preferred way is autocasting to a closure on pass.
 
Wes
unsure what you mean
like, if the function returns :callable then cast it automagically?
 
@Ocramius it was a protest vote. I hate all the options. I hate that we're even in this situation.
 
@Andrea alright
 
8:33 AM
@Wes Right.
@Wes Checking with context doesn't make much sense, because you never know who will call it eventually.
 
Wes
i'm unsure about having this kind of magic under the hood
but i know very little experience with this kind of programming. i rarely use callbacks, closures in php
 
Hello, I know this is PHP channel but maybe you are able to help me with a database issue. I'm currently trying to create a MySQL table, where messages are stored an all those message have an output. The issue is that I have several output types e.g.: SMS Log or Email. How would you proceed to create the output Table ?
And I want to avoid storin NULL values in the output table.
 
@Poteito do the output in your php code?
 
@Poteito If all the other fields are the same and are going to stay the same, use an ENUM field to specify the output type. If not, make more than one table.
 
@Poteito messages have an output?
wat?
 
8:41 AM
@FlorianMargaine This would be the easy solution but, i have to use Sotred procedures later on.
@MattPrelude I also have a table for each output type. Like a "subclass" of output.
 
@Poteito You need to put all the information on a question imo, there is too much to consider which hasn't been provided. All fields, etc.
 
@Poteito Store the data, no output. Generate the output if you need it based on the data.
 
@MattPrelude Well didn't want to create a huge question :/ My bad
 
@Poteito Understandable, but database design is best done with complete information, it's one of the hardest things to make right later in software development.
 
yeah... a database is there to store data, not output
note the "data" in "database"
it's not "outputbase"
 
8:46 AM
well my data of output is for example -> the path to the log file or the email or the phone number of that output
my table is called tblOutput
I think there is a missunderstanding, I don't want to ouput anything with the database :P I want to store "ouput informations".
 
@Poteito how would the information, that you attempt to store, be different in SMS vs Email?
TBH, I dont see why would you even want to store them in the same table to begin with
 
How would you proceed ?
 
I would start by answering questions
 
@Poteito Why does a table have a tbl prefix?
 
8:54 AM
Well sms is a phone number and email an "email address" lol . an then there is log files who have a path.
It's the way I do it.
Well the way I learned it.
dbX = databse
tblX = table
idX = Primary Key
fiX = Foreing Key
and so on
 
@Poteito I would have two separate tables for storing the email and sms history (and I also would add another column: timestamp, with DEFAULT CURRENT_TIMESTAMP)
 
@tereško That's what I've done. But I have an other table -> Message who needs a reference to those SMS and Emails
 
@tereško Better use DATATIME, because of 2038.
 
@kelunik lol ... by that time we probably will be living with no electricity because of a new Carrington Event
 
moin
 
9:03 AM
@tereško I don't think we'll make it there
 
@tereško :P
 
Remember that there's a good chance that Donald Trump would be a president by next year.
 
@MadaraUchiha Not if you have anything to say about it, anyway
 
@Jeeves ohhh, shiny
 
@kelunik In all seriousness, I would very much hope that by the time we get there the SQL standard will be updated to cover 64-bit timestamps at a very minimum. And that is assuming the SQL is still a thing by then.
 
9:05 AM
@NikiC It's been there for a long time, just disabled because too spammy.
@DaveRandom I hope that, too.
 
Basically it's a bit like the debate around 5.5 the other day: it is technically a limitation, but it's not one that should influence design decisions for new applications
 
@MadaraUchiha since DNC have been using every trick in the book to prevent Bernie from becoming nominee and since Clinton is essentially "sitting on" pile of scandals .. yeah .. it's really likely
 
@DaveRandom But it has to if you have dates in your database now, that go far into the future. But that is probably only the case for very few people.
 
Indeed, but that's not what timestamp is for...
datetime is for when it's part of the data, timestamp is for metadata about the data
 
what exactly are you trying to argue against there?
 
9:15 AM
The use of datetime over timestamp for a "inserted time"-type field on the grounds that it will break in 2038
 
People say that DELETE statement in this script is a problem. Are they right?
 
Ignoring for a second that MySQL won't let you have DEFAULT CURRENT_TIMESTAMP for a datetime (which is a weird and pointless limitation IMO) because that's not actually relevant to why timestamp is the correct type
no, but I just looked at yours, why aren't you doing ON DUPLICATE KEY UPDATE?
 
maybe it's not mysql
 
Assuming he's still working on the same project that's been debated in here a few times in the last couple of weeks then it is, but indeed maybe it isn't
I think all RDBMS have some kind of construct for that though?
In SQL server has the insanity of MERGE INTO
 
I recall some issues in Postgre with duplicating the ON DUPLICATE KEY UPDATE construct
 
9:21 AM
@DaveRandom All I'm trying to do: that UPDATE statement, updates accepted in this table structure. And I also need to send/remove (based on accepting answer or undo it) a notification to answer's author.
 
@tereško I'm pretty sure I have some code that does something along those lines, looking now
@stack That's not how your code reads, though... why does your code not know whether it's an accept or undo? Your PHP code should inspect that and execute the correct INSERT or DELETE... don't rely on the existence of a notification to determine whether one needs to be created or not...
What if creating the notification in the first place failed?
Then you'd end up creating one when you should be deleting it
@tereško I stand corrected, it's only in the current release that a syntax was providied for this (ON CONFLICT)
 
My algorithm is completely opposite of your idea .. I know it :) ..! And this script works as expected .. All fine. What I want to know, will that script trow a error later?
 
can I post free lance job offer here ?
 
@DaveRandom I know. The older version had to use chicken sacrifice for that functionality
 
9:37 AM
@VamsiKrishnaB It's probably not a great place in terms of getting a response. People do occasionally put messages in here about that sort of thing, Basically as long as it's not spammy (i.e. only post it once and if you have more than a couple of sentences to say about it then post a link rather than writing an essay in chat)
I'm not sure if anyone has ever been successfully recruited via #11, most of the people here are already employed
#11 is mostly for work avoidance rather than job seeking
 
What's the latest stable MySQL version? 5.7?
 
!!google latest stable MySQL version
 
Search for "latest stable MySQL version" (https://www.google.com/search?q=latest+stable+MySQL+version&lr=lang_en)
• MySQL 5.0 Reference Manual :: 2.4.2.1 Choosing Wh… - The first decision to make is whether you want to use a production (stable) release or a … Usually… (https://dev.mysql.com/doc/refman/5.0/en/choosing-version.html)
• MySQL :: Download MySQL Community Server - MySQL Community Edition is a freely downloadable version of the world's most … and support using t… (https://dev.mysql.com/downloads/mysql/)
 
:-P
5.7.12 is current GA, apparently
Time for my annual reboot, bbiab
 
Wes
i neez help with phpunit. i need to call assertion methods from root scope because i don't want to pollute the backtrace with phpunit's stuff. in other words i need to call PHPUnit_Framework_TestCase::assertTrue(...); directly. which works and tests get executed, but i get "No tests executed!" in the report. is there a way to fix this?
 
9:52 AM
@Wes Why do you need that?
 
@Wes I don't think you can fix that, at least without forking PHPUnit.
 
Wes
because i'm testing some stuff that uses debug_backtrace() and it's required it to be clean for tests to make sense
 
@Wes Write a PHPT test instead
@Wes What is that thing that needs it to be clean?
 
Wes
@kelunik too long to explain but i will git it in few minutes
seems it's what i'm looking for
 
@Wes You will still have PHPUnit in the backtrace? Because it's executing the test?
 
Wes
9:58 AM
yeah, right. i'm an idiot :B
 
find unique pass_type and classification unique pair with default array function
Array
(
[0] => Array
(
[pass_type] => 5
[classification] => male
[rate] => 200.00
[emp_id] =>
)

[1] => Array
(
[pass_type] => 6
[classification] => male
[rate] => 200.00
[emp_id] =>
)

[2] => Array
(
[pass_type] => 6
[classification] => couple
[rate] => 250.00
[emp_id] =>
)

[3] => Array
(
[pass_type] => 5
[classification] => male
[rate] => 300
[emp_id] =>
)

)
 
Don't know how PHPT tests are executed, just try them.
 
@BhavinShah No, you find unique pass_type and classification unique pair with default array function.
 
10:00 AM
@MadaraUchiha then find this by looping is only solution ?
 
@BhavinShah Is that your homework?
 
What is "default array function"?
 
btw @kelunik I have an absolute concrete demonstration of why getLock() is also required: when calling SqlConn::query(), the returned Cursor needs to keep a hold of the Lock and not release it until the cursor itself is closed
 
@Ocramius No it's not. autoload-dev is root only.
 
Wes
@kelunik nope, i wasn't an idiot after all. i mean not in this specific case. it's what i'm looking for, as the expression is evaluated in the root scope
 
10:02 AM
@DaveRandom I know that it's required. I said we should remove withLock from the interface, not getLock.
@Wes How so?
 
@MadaraUchiha no default array function its an html array at php side we find pass_type and classification unique and insert it otherwise discard
 
@kelunik Ahh right OK. Yeh I guess that's sugar that's not strictly required but I do think it's useful enough to be worth having... and the default impl in the base class will cover most subclasses as well I suspect. I'm going to do some more work on a couple of other implementations later today, as I need a variable capacity lock (I think) for something else I'm doing.
However right now I'm still trying to sanely reboot my computer...
 
@DaveRandom Yes, as a utility, but not in the interface.
 
@kelunik Yes I think I agree with you there, I'll remove it
 
Wes
 
10:06 AM
@DaveRandom I think I didn't sanely restart my computer in the last year that often. Mostly it's 4 seconds pressing the power button.
 
Wes
@Ocramius thanks :B
 
So you don't have a test class at all?
 
@DaveRandom OS?
 
@kelunik this, but my poor windows installation is starting to fall apart and I think it needs to be done. Also I need to check the virtualisation settings in the BIOS because it's VBox is not letting me create 64-bit VMs
 
Wes
@kelunik yes, because i need an empty backtrace
 
10:08 AM
@MadaraUchiha 7, the reason it's hard is doing an orderly close and save in the 9000 apps I have open, and pruning useless chrome tabs so it doesn't try to open 18 windows when I start it after reboot
 
@DaveRandom It's a Linux bug for me.
 
Wes
Error: Call to undefined function assertTrue() in .... #fail
bloody nora
 
What'd Nora ever do to you?
 
Wes
i only know shes bloody
 
10:13 AM
@kelunik oh, right, dammit.
totally missed that
 
Wes
@Ocramius i'm not using composer, just running the phar, is there a way to get that Functions.php required?
 
@Wes Use PHPT.
 
@Wes no clue, I avoid phars like the pest.
 
is register_tick_function supposed to work with included files?
 
@Ocramius So you installed composer with composer, not as a phar? :P
 
10:16 AM
@kelunik touche
 
@Petah It is. But declare(ticks) isn't (in PHP 7)
 
dang
not possible in php7?
 
@kelunik "with included files"
 
Should the "see also" section in the function reference include links to pecl functions?
 
10:19 AM
@Petah If you want to handle signals, poll pcntl in your main loop
@Leigh no (imho)
 
Thanks
 
Wes
bloody hell, still no tests executed
 
Will remove :)
 
im on windows, that doesn't have pcntl right?
 
@Petah Oh, what do you need ticks for then?
 
10:20 AM
trying to figure out why my app is hanging, doesn't even obey timeout
 
attach vs
 
@Petah run it through the debugger, interrupt when it hangs?
 
yea i guess so, better go figure out how to do that again
 
10:31 AM
is there a key combo to trigger a break in phpdbg?
 
@Petah Ctrl + C
 
that just kills phpdbg
 
Wes
shameless ping @SebastianBergmann stackoverflow.com/questions/37251819 :P
 
@Petah Works for me.
[12:34:36][2005][~] $ phpdbg -qrr test.php
...^C......^C
[Current opline: in internal function sleep]
>00005:     sleep(1);
 00006: }
 00007:
prompt> back
frame #0: sleep(seconds=1) at /home/kelunik/test.php:5
frame #1: {main} at /home/kelunik/test.php:5
prompt> q
Maybe it's different on Windows.
 
C:\work\project>phpdbg
[Welcome to phpdbg, the interactive PHP debugger, v0.5.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
prompt> ev include("web-bootstrap.php")
1
prompt> exec index.php
[Set execution context: C:\work\project\platform\public\index.php]
[Successful compilation of C:\work\project\platform\public\index.php]
prompt> run
</script>
<pre>
^C
C:\work\project>
 
10:37 AM
@Wes I don't think you're supposed to use these functions. Or tests the way you're using them.
 
@Petah you're probably the first person to try this on windows :D
 
:/
 
Wes
why exposing them then @kelunik ? since they just wrap some other static method
 
You can't intercept ctrl+C on windows, it signals the shell, it doesn't have POSIX-like signals
 
I guess for easier internal use, but dunno.
 
10:38 AM
break and/or ctrl+break might work
 
@DaveRandom Expected that. Stupid Windows.
 
@DaveRandom do signals work if you run it through git bash?
 
break is the "pause" key right?
 
@Petah You could try bash on Windows if you're using the dev preview. :P
 
does the same as crtl+c
will try bash
 
10:40 AM
@NikiC ...maybe? It's a direct execution via kernel afaik so won't be subject to cmd limitations
 
bash just quits back to bash :/
 
@Petah git bash?
 
yea
C:\Users\USER\AppData\Local\Programs\Git\usr\bin\bash.exe
 
Depends how you are invoking that exe though
 
^ @JoeWatkins @bwoebi How can one interrupt execution on Windows @ PHPDBG?
 
10:41 AM
moment, let me try and remember how you start windowless exes without the shell
 
Why windowless? Git Bash has its own window?
 
I'm scared of windows ...
 
This sounds like ctrl+c or ctrl+break ought to work
 
have you got visual studio installed ?
 
nope
 
10:44 AM
@JoeWatkins I think it's easier to install a linux environment than install visual studio...
2
 
yeah it totally is
it takes a million years
roughly ...
@Petah are you targeting windows, or can you use a vm ?
 
nah i deploy to linux, and it works fine on my mac so its not a show stopper
but still, would like to know whats going on
 
If there's a bug starting from 5.6 going up to 7, should I make a fix branch from 5.6 or from master?
 
5.6 and merge up probably
 
@Petah me too, but windows is like a box of magic to me, no real idea how any of it works ... sigint handler is installed, interrupt should work .... but all kinds of stuff that should work doesn't ...
@nikita2206 depends what the fix impacts
 
10:48 AM
@Petah So ... if debugger doesn't work, it's time to sprinkle echo's :)
or maybe try xdebug, maybe it happens to work there...
 
yea i was trying to do it the cheat way to start with, using ticks ;)
manual echos it is
 
do ticks work there ?
 
not in php7
wouldn't tick the included files
ok i figured it out
kinda a facepalm
 
that should probably be fixed, or even better replaced with something that works ... ticks are really nasty ...
 
i had my debugging too high, and it was hanging trying to var_dump
 
10:51 AM
you have xdebug loaded ?
 
    ini_set('xdebug.var_display_max_depth', 10);
    ini_set('xdebug.var_display_max_children', 256);
    ini_set('xdebug.var_display_max_data', 10000);
 
loading xdebug and phpdbg at the same time will lead to unexpectedness ....
they hate each other ...
 
this was just xdebug hating my recursive objects though
 
may explain why interrupt didn't work too ...
 
@JoeWatkins there doesn't seem to be anywhere in the phpdbg sapi where a signal handler is installed, there's lxr.php.net/xref/PHP_7_0/sapi/phpdbg/phpdbg_sigio_win32.c but it doesn't make a lot of sense to me. Would be worth asking Anatol about it because I don't think it does what it's supposed to (I can't even work out what it's supposed to do)
 
10:53 AM
@JoeWatkins No, interrupt doesn't with with a simple file, just verified that.
It just exists the process.
 
I've never seen that sigio stuff before, or don't remember it ...
 
lxr search is useless, that line didn't show up in a symbol search for signal
 
box of magic
sym search for SIGINT in sapi/phpdbg
@NikiC did you see xinchen's last comment on that pcre commit ?
 
@JoeWatkins lol blame has you for both blocks :-P
 
Ok, in Powershell it exits after the second Ctrl + C, the first one does simply nothing.
 
10:57 AM
@DaveRandom yeah, I meant the sigio_w32 stuff
 
That has anatol tagged at the top
 
yep
 
Set him on it, he's the Windows guy
Or Pierre
 
yeah awaiting ping back already
phpdbg is not in good shape on windows in general ...
iirc help doesn't even work
 
user895378
morning o/
 
10:59 AM
moin
 
morning \o
 

« first day (2039 days earlier)      last day (2914 days later) »