« first day (2748 days earlier)      last day (2186 days later) » 

5:25 AM
moin
 
I've not studied much about "reflection" but I've read some lines about it and I'm confused, if reflections can reflect any classes, why do we need to pass instances of them to constructors? I think I'm missing something really easy but I don't know what...
Oh I think I got my answer myself, it's actually just a "Reflection", not more.
 
6:31 AM
monring. interesting read. aimed at java but still interesting.
 
lol wtf echo date("t.m.Y", strtotime("2018-04-25")); returns 30.04.2018
 
morgen
 
@AltayAkkus what do you think t is in that format string?
 
@PaulCrovella right lmao
 
6:47 AM
@tereško If it is one of morning versions, then YO! :-)
 
it's a German version
 
ah good to know :-)
 
With a message queue such as rabbitmq, do you setup a hook in the message queue server, or do you actively have to poll the message queue for messages when listening/receiving? If the latter, how do you make sure that the receiver isn't killed or crashes?
Would the easiest way of doing this setup a cronjob that runs the PHP script receiver, and if it's already running, just exit? That way the delay would be max 1 minute i guess
 
7:27 AM
moin
 
7:45 AM
moin
 
7:58 AM
moin
 
velitation a minor dispute or contest.
 
@Danack Why do you have a velitation with Google?
@Daniel When listening, if you use AMQP, a callable is 'triggered' when a message can be read. You don't poll it
Have you actually looked at the docs for AMQP and PHP? They have simple methods like consume() which you pass a function to, which is invoked when a message is available and read (which is automatic)
The consume method blocks
 
Anonymous
8:20 AM
morni
 
morns
 
moin
 
moan
 
!!dad
 
Dad, can you put the cat out? I didn't know it was on fire
 
8:27 AM
@Jeeves stupid bot, you make me look bad
 
@DaveRandom can probably unpin this now.. for now
 
aye
oh I need to re-enable the indexing cron job as well
 
8:59 AM
@Jimbo We're paying for stuff, including a support package. We can't figure out how to access the support package. Google can't tell us how to access the support package. Google don't even seem to be prepared for people to want to use the support package.
 
Anonymous
support package.
 
support package?
 
support package!
 
support package.?!
 
@Jimbo No I was looking at the manual for rabbitmq rabbitmq.com/tutorials/tutorial-one-php.html in the example they wait for messages until the program ends by calling "CTRL+C". This all indicates you need a consumer that listen for messages.
 
Aynybody knows how __set_state is handled by PHP internally? Looking for some code in C I couldn't find anything.
 
9:39 AM
3 messages moved to Trash
 
@brzuchal afaik it will only get called when var_export is called
 
@Gordon var_export creates a call to those methods
but after that when a string from var_export is being evaluated it's processed somehow and I cannot find how
 
@Gordon exactly this is creating a string for further evaluation
 
> When exporting an object, var_export() does not check whether __set_state() is implemented by the object's class, so re-importing such objects will fail, if __set_state() is not implemented. Particularly, this affects some internal classes. It is the responsibility of the programmer to verify that only objects will be re-imported, whose class implements __set_state().
you cannot find it because it doesn't exist?
 
9:52 AM
ahhh, cool thx man
 
13 hours ago, by tereško
what would be a good name for a mapper interface? Persisting ?
any good ideas?
 
MapperInterface?
 
No
What's the single responsibility of a concrete implementation, give me an example?
Mapper can be anything
what is it mapping?
 
that was the joke
 
and where from / to?
Ah, missed that, sorry @Daniel
 
9:58 AM
@Jimbo it's a data mapper
 
That's the pattern :) What and where from / to
 
those should not affect the naming for an interface
 
@Jimbo if it's an interface... why would you care about a specific concrete implementation?
 
@Christian If I know what the separate concrete implementations do individually I can come up with a better more specific interface name
@tereško Depends, some put Factory on the end, but not Interface
 
@Jimbo some people are idiots, that should apologize to plants for wasting their hard-made oxygen
 
10:01 AM
lol
@Daniel Just saw your message from the docs. Use pure AMQP as it's the C extension and much faster, PHPAmqpLib is a pure PHP implementation and thus is significantly slower - although tbh under the hood it just does a 'wait' as well, you don't have to do it in userland
Ah polling. Everything is polling eventually
 
Morngnen
 
\o
@tereško Here are a few bad ideas "DataMappingContainer", "DataManager", "DataMapper", "DataStore", "ModelMapper"
 
those are all names, that one could use for a superclass
 
Then just add "Interface" at the end :P
or capital "I" in the beginning like c#
 
10:10 AM
no need to say such disgusting things to me
 
:P
 
the TrueType / FreeType related functions doesn't work. – #76264
 
@tereško So, what none of those would work?
 
10:27 AM
Mailing list subscription confirmation emails not going out? – #76266
 
I've just realised that during the year I've spent using GitLab, I've been cloning GitLab projects into ~\Documents\GitHub -_-
Damn those bad habits.
 
Wes
\o
 
o/
 
\o
 
10:51 AM
o/
 
o\
 
/o
 
Anonymous
o/
 
Anonymous
ah mega ruined it with a double post.
 
Anonymous
amateurs
 
10:59 AM
interface ISuckBalls {}
abstract class SuckBalls implements ISuckBalls {}
class GobStopper extends SuckBalls {}
 
5 messages moved to Trash
 
@JayIsTooCommon :P
 
Anonymous
has there actually been a successful full page combo yet?
 
depends on the size of your page
 
Anonymous
size doesn't matter
 
11:00 AM
@DaveRandom Yeah, seems like a decent implementation :P
 
Wes
that's what she didn't say
 
also, it depends on the zoom level
and your font
and other things
 
@Gordon even then I don't thinks its been done. Maybe on a mobile phone screen but not on pc screen.
 
Anonymous
mega what was your previous display name?
 
@mega6382 definitely on my mobile phone. I think I posted a screenshot. On my 4k screen: nope
 
Anonymous
11:04 AM
or are you anime kid?
 
@Wes yes, just now.
 
@JayIsTooCommon My display name has been mega6382 since 2013 :P
Apr 20 at 15:34, by mega6382
NO, why does everyone keep confusing me for him.
 
Wes
lol the extended warranty. what a scam
 
Wes
11:06 AM
and they are getting away with it
hey davos
 
wasn't that the leader of the daleks?
 
Wes
no, and you should totally watch game of thrones
 
Anonymous
@mega6382 huh, why don't I recognise you. Did you have a long break?
 
@DaveRandom that was davros
 
Wes
dr who is boring af
 
11:08 AM
@Wes you are boring af
 
Wes
i am, and i don't pretend to be a tv series
 
davos? that's where the g8 is, right?
 
@JayIsTooCommon yeah, I only started coming here regularly since august last year. and I believe you took a long break after that.
 
Anonymous
ah, makes sense
 
@JayIsTooCommon btw my old avatar was this en.gravatar.com/userimage/97590504/…
you might recognize that. maybe
 
Anonymous
11:14 AM
/shrug
 
Wes
aaaaaaaaaaaaah now i recognize you
 
:P
 
11:26 AM
guys
I have a php meme
$pdo = new PDO('mysql:host=localhost;dbname=databasename', 'username', 'password');

$statement = $pdo->prepare("SELECT * FROM users WHERE id=". $id);
$statement->execute();
ignore the first one lmao
 
then delete it
 
you can delete chats, didnt know that
 
How is that a meme?
I am disappoint
 
yeah :|
 
@AltayAkkus is it a joke about not using prepare properly? I too am disappointed..
 
11:29 AM
:(
its not just not using prepare properly
 
Anonymous
charsets
 
this is hell of a meme
 
Anonymous
you need to look up what a meme is.
 
you keep using that word, I don't think it means what you think it means :P
 
Wes
i wish i had mustache like that
 
Anonymous
11:31 AM
i swear you do
 
Wes
i don't
 
Anonymous
 
Anonymous
ah it's hidden.
 
did you just say I dont know what memes are
 
prove us wrong
 
11:33 AM
kk 1 sec
 
Wes
@JayIsTooCommon it's not that great though
 
ive got spicy memes laying here
 
Wes
i have 15yo mustache
 
@AltayAkkus you're mom gay
 
Anonymous
@Wes and a funny hat.
 
11:34 AM
@mega6382 no u
 
Finally after 15 months and 5 days PHPStorm will be fixed against missing yield inspection
 
Wes
i have a pink cowboy hat which i saved for another picture @JayIsTooCommon
 
Anonymous
now is the right time to share.
 
Wes
:B
 
that must be for peehaa
 
11:35 AM
am I doing it right?
 
:P
 
Wes
perfect
 
Anonymous
ahahha
 
freshly stolen
 
Anonymous
utter shite.
 
Anonymous
11:37 AM
in JavaScript ™, 5 mins ago, by Oliver Salzburg
Because Bezos is not a lazy bum and the people who work in the Amazon warehouses are usually unskilled peasants
 
Anonymous
what a fucking prick.
 
@JayIsTooCommon yep
 
That's why JS room is almost as bad as the C++ one these days
 
@AltayAkkus so, we were right then..
 
11:41 AM
Last time I went into C++ room and mentioned how they all suck one of the girls got really upset and went on a big rant
 
Lol
Good job @Jimbo
 
JS room is so fast, its almost impossible to get any help from them.
 
New framework every 3 days, new topic every 30 seconds
 
Wes
0% work done
 
@Wes what's the difference from in here? :O
 
11:46 AM
@Naruto Can't argue this
 
Why does this not work ? move_uploaded_file($picture, "$uploadfolder/$picture")
My var_dump says "bool(false)"
 
!!docs move_uploaded_file
 
[ move_uploaded_file() ] Moves an uploaded file to a new location
 
Ye thats what it should do
 
is picture $_FILES[0]['tmp_name']?
 
11:46 AM
Yes
 
@J.Ende Did you read it?
 
is the directory writeable?
$uploadfolder?
 
@PeeHaa I have it open and im following it
Yes i guess i have the right path
But it is on a webserver
would that make any problems?
 
You are not following it correctly
 
have you checked?
> Yes i guess i have the right path
 
11:48 AM
$uploadfolder = "\\WEBSERVER03\PORTAL$\inventadmin\uploads";
Like this
 
yeah but is the directory writeable?
is it a windows server?
 
Yes i do
and Yes it is windows server
 
ok i dont know how write permissions work on windows, sorry. either you're not following the instructions correctly or you don't have write permissions
what does var_dump($_FILES) give you? and are you sure the tmp_name is set?
 
12:02 PM
@Jimbo mind sharing the link?
 
@mega6382 Here's my general abuse, and this one got upset
Attention seeking? Why would I seek attention from C++ developers?
 
xD
 
At least Jay came in to save the day
in Lounge<C++>, Apr 5 '17 at 12:57, by JayIsTooCommon
@Telkitty just a whore
 
Anonymous
got your back, bro
 
They used to be fun in there sigh
Somewhere should be the log of them all coming in here and starring anti-php messages
 
Anonymous
12:13 PM
We should increase our banter levels to compete with them. Last I checked, we still flag ascii penis images.
 
I think they would get all offended now, miserable about their "programming language"
PS - it's just a joke btw, don't want to think they think I'm serious xD
But you know these days, can't be too careful
 
Is there a dedicated token for a ternary expression, e.g $foo : $bar ? $baz? Or I’d need to search for each one?
 
One sec @GabrielCaruso
 
@Jimbo Sure, thanks :)
 
5 messages moved to Trash
 
12:20 PM
When you say token, are you talking about in C?
If so, I can't help, sorry :)
Otherwise I can point to a post explaining what ternaries are haha
 
@Jimbo Nope, I was referring to PHP, some T_TERNARY for example. But thanks for look into that!
Luckily, PHP-Parser handles it :pray:
 
I would estimate the number of hours of my life I have lost because of people trying to manipulate data containing phone numbers in Excel to be well into the thousands at this point
 
@DaveRandom dont estimate. put them into excel
 
:P
 
@GabrielCaruso As far as I know there is no token for it: github.com/php/php-src/blob/master/Zend/…
 
12:41 PM
Am I weird or the only one which is missing polymorphism in PHP?
Even a switch-case-instanceof simplification would be more usefull than comparing object class string names :/
 
@Daniel array(5) { ["name"]=> string(12) "flamingo.jpg" ["type"]=> string(10) "image/jpeg" ["tmp_name"]=> string(27) "C:\Windows\Temp\phpAD89.tmp" ["error"]=> int(0) ["size"]=> int(159737) }
 
@brzuchal you're weird and the only one
@GabrielCaruso list of tokens is at php.net/manual/en/tokens.php
 
@DaveRandom You've spent lots of your tile because of people who who what?
 
@brzuchal stop using the object type hint then and write less "generic" methods :P
 
Yeah, I thought so for the scond I was inventing a wheel with:
function (DateTimeInterface $date) {
    switch ($date) {
        case instanceof DateTime:
            doSomethign();
            break;
        case instanceof DateTimeImmutable:
            doSomethingElse();
            break;
        default:
            throw new UnsupportedDatetimeException("Blah blah");
    }
}
 
12:42 PM
@Shafizadeh "People who are complete fucktards"
 
:D
 
lets just leave it at that
 
@brzuchal You're doing it wrong
 
@MadaraUchiha Yes I know I have to compare strings
 
12:44 PM
case DateTime::class: ...
and switch(\get_class($date)) { ...
 
that won't work either
 
but then there is the ugly ::class and more uglier \get_class()
 
function toImmutable(DateTimeInterface $dt): DateTimeImmutable
{
    return $dt instanceof DateTime
        ? DateTimeImmutable::createFromMutable($dt)
        : $dt;
}
just do that
 
switch (true) {
    case $date instanceof SomeClass: ...
        break;
    case $date instanceof SomeOtherClass: ...
        break;
}
 
It was just an example
 
12:45 PM
userland classes can't implement DateTimeInterface
 
I'll just shut up now :/
I don't want to be slapped with wet fish
@Christian that is also ugly
 
Depends on what you want to do.
 
/me slaps @brzuchal with dry cod
 
For your date usecase, @DaveRandom's works well (and is preferable).
 
Perfect would be if I can declare few methods with the same name and different typehints :)
 
12:47 PM
do userland functions have function pointers?
 
internally I suppose so, there is a symbol table for functions
 
@brzuchal What exactly do you need?
DateTime and DateTimeImmutable provide the same public interface (hence...the interface)
 
DateTime was just an example so I can complain about PHP
 
I'd have said PHP can't support polymorphism a few year back.
 
@pmmaga better dry fish than wet :P
 
12:51 PM
With the recent advances in type declarations everywhere, it might make sense.
 
yeah, with the weak types I don't think we can have that:
function huh(string $a) {}
function huh(int $a) {}
huh("42"); //Good luck!!
 
is there some specific function that handles the loading of userland code? Like when is userland code registered?
 
@Gordon yes.
 
@Danack which? can you point me to it on lxr?
 
posted on April 25, 2018 by PeeHaa

- implemented attachment handling - implemented search - implemented version command - added windows tests

 
12:53 PM
trying to recall where it is....
 
@Christian someone told me last week that it won't have any chances
 
!!lxr zend_compile_file
 
@Danack Nothing went wrong but I couldn't find a suitable definition
 
@brzuchal If you consider how the engine works, then it's also a big no, since for example, function names have to be unique.
 
@Gordon whats the current lxr url? anyway - if you go from zend_compile_file() that might get you where you want to get to.
 
12:56 PM
And that's also your pain point that cannot be solved unless you have each function variation named differently.
 
thx
 
@Gordon what's it you're wanting to do?
 
@Danack instrument userland functions and methods
 
I dunno if I'm dizzy or really many parts of the examples provided in this article(adayinthelifeof.nl/2010/06/02/bit-manipulation-in-php) are exactly the same! :)
Does anyone know any articles that explains bitwise & operator in PHP? I thought 129&128 must be 1 but it's not. :/
 
1:06 PM
@Danack I am currently doing this by overwriting zend_execute but if I can somehow replace the function pointers instead when the code is loaded, it would have less performance impact on the code
 
alternatively, I think it's better explained here: en.wikipedia.org/wiki/Bitwise_operation#AND
 
@Christian well, what's even more preferable is to just always use DateTimeImmuable
 
@Christian or just use Java
 
the only way to get 1 out of 128 and 129 is with a xor
 
1:09 PM
or C#
and definitely not ever use Javascript
 
22 mins ago, by Christian
@brzuchal What exactly do you need?
 
@Gordon what you could do is look at the code that assertchris has been doing - it's hooking into the autoloader, to manipulate the code before it is parsed.
 
22 mins ago, by Christian
DateTime and DateTimeImmutable provide the same public interface (hence...the interface)
 
i.e. compile time Babel equivalent for PHP.
 
when you put it like that I'm less interested
 
1:11 PM
@Christian yeh but that's not actually true
 
Sssh :P
 
@mega6382 Of course I saw this but for example for (&) it says: "Bits that are set in both $a and $b are set." which is totally different from what my book says(I expect it to say whether the bit with the value in the right hand side operand -in the binary equivalent of the left hand side operand- is 1 or not).
 
Which I of course can't find now.
 
@pmmaga Thanks
 
function stuff(DateTimeInterface $dt) {
    $foo = $dt->modify(...);
    // I'm going to do stuff with $foo that will work fine, but other bits of
    // the app are gonna have a bad time
}
 
1:14 PM
modify() is not in DateTimeInterface though..
 
I will 100% guarantee you that there is loads of code that does that
it's not in the interface, but it will still "work"
and PHP developers can be quite liberal with their definition and usage of "interface"
regardless, mutability of a date/time makes no sense, just use DateTimeImmutable everywhere
<puts fingers in ears> la la la la I can't hear you la la la
:-P
 
Not going to argue any more about coding against implementation instead of interface. :P
 
neither am I, it's dumb. But people still do it, all the fricken time.
 
@pmmaga But I've used this operator as I said and it works fine(I don't know why). There are 6 constants in my code from 1 to 32 that I add their sum in a field of my database, then when I want to know which options have been set, I use if(that number & constant). So why is this working?
 
@Simon.B the result doesn't have to be 1 to be truthy
 
1:22 PM
@Simon.B well, 128 & 129 = 128 which is truthy
 
Frankly, I'd be happy with just a little bit more type declarations in the code I have to work with. Right now, in general I get stuff like:
/**
* @param $from
* @param $to
*/
function something($from, $to){ } // is it a DateTime? a string? seconds since epoch?
That's how the vast majority of the code I see looks like.
Helps you build immunity against puking though.
 
Uh
is stack overflow showing an IIS page?
 
Anonymous
@PeeHaa not sure if you're still a phinx user
 
Anonymous
> I’m also planning on making it depend on cakephp/database. A common requirement has been having better support for insert() and select queries

and I would not like having to create yet another query builder
 
@PaulCrovella @pmmaga Thank you I got it.
 
Anonymous
1:27 PM
but there's it's future..
 
wat that can't be right
 
> embrace extend extinguish
 
@Sean It's you
 
hahahahaha… @PaulCrovella I was about to write the same
 
1:28 PM
Yeah figured as much, just wat
 
@JayIsTooCommon As long as I don't see anything in the public api I am fine
Will make the project worse in terms of contributions probably though
 
@Gordon don't get to see it that much in the wild
 
We're getting on wifi too
flushing the dns worked. That was weird
 
rough week for dns
 
@Gordon lol
 
1:36 PM
Is there a way to determine if a terminal supports ansi coloring etc?
 
@Daniel yes, but not reliably
 
when ssh'ing the console output from symfony/console looks terrible, i was wondering if there's a way to defalt back
ok :/
 
@Daniel did you try another program with ansi escapes from ssh?
 
Anonymous
@PeeHaa you interested in being a member?
 
nah i don't really know which to test, i did try ls -la which is supposed to have some coloring, and it does not via ssh to the server
 
1:39 PM
also, it depends on how symfony/console was initialised. ie, if you specify decorated flag, it will use ansi escapes no matter what.
 
its not the coloring per se, i thought it was the same, i use the progressbar, and it literally adds a new line for each increment
i thought these things where generally supported or not as a whole
maybe not
 
there's also another thing in that case...
 
Hi, my question: Say you have a method example(string $name){}, and I want to know the needed type paramater, a functionInfo('example') if you will. Does such a thing exists?
I need to know "string".
 
many viewers happily highlight colours and stuff in console output but do not support cursor movement / overwriting etc.
 
1:42 PM
For example, gitlab build output colours the console output but it doesn't overwrite. So if you have a progress bar, it messes up (most people just disable progress if possible, for example for composer).
 
hmm ok, in that case i could maybe just check for environment and just don't initialize the progressbar for servers, and only on development machines
instead of checking for terminal support
 
@JayIsTooCommon Can't really devote time to it still
 
@paul
Oh whoops. Anyways: I can only get string results
ReflectionFunction::export seems to be the closest thing to what I want, but it returns a string
 
@Martijn maybe explain your end goal?
 
IF the parameter is hinting a type, it will say when you call ->getType()
 
1:54 PM
Unless you're writing a dependency injector or an ORM or something (which you probably shouldn't be), then you probably don't need to be doing reflection in your code.
 
@Daniel I remember this doesnt always work for native methods and functions in php5 because they are not always exposing their type. but its the correct answer.
 
that is the case
but since 7.0 it's pretty spot on, especially since 7.2 with object type and all that
my bad
 
github.com/gooh/InterfaceDistiller/blob/master/src/Distillate/… though that is an old project and doesnt work with scalar typehints
 
i didnt read "native" i read "normal" wtf, somehow my brain is still wired to 5.x being "normal", even though i switched to 7.x when it was released
so yes, native functions are still messed up
reflection-wise
 
sorry, got a call. I get a function from a class. At my point in the code, I do not know which function that is. I need to know what type of paramater it gets
 
1:58 PM
so you reflect the class, get the method, and then read the parameters
 
@Martijn no, you dont. you need an interface and/or refactor the code
 
ohh is this about implementation and not actually trying to inject stuff?
 
I get: $class='SomeClass'; $function="someFunction";. With that info, I need to know parameter 1
 
are you designing a callback of some sort?
 

« first day (2748 days earlier)      last day (2186 days later) »