« first day (1739 days earlier)      last day (3225 days later) » 

12:00 AM
Because the example right now is not exactly perfect
 
fine and see your tomorrow then
 
good night
 
12:34 AM
It's my first time editing a CakePHP based project, I saw it has Models, Controllers, View, etc, is there some kind of Cake Dashboard to edit existing functions or add new ones?
 
12:58 AM
hello
 
user image
5
 
@ziGi insta-star.
 
Hahaha, right
 
Is this for me?
 
check the T-shirt
 
12:59 AM
lol
 
:D
 
I was angry, but no more
 
Hahaha :D
 
I googled until I came here as a last desperate resource
but okay
 
really?
 
1:00 AM
@ziGi I've heard you wanted to get up at 7? Not really following that plan anymore? ;-P
 
I thought "this can't be, there must be something like that to help manage all this stuff"
 
haha I got some night pills (like natural) and a hot shower
but I found that
 
(and now you can't sleep!)
 
while looking through my interesting collection of pictures
there is this book that fits a lot of questions here
I am making a Chamomile tea now
and I found it's quite helpful
it's just that I can't switch my brain off :(
I decided I'll wake up at 8
since I have to pick up shoes that I ordered from the post office
they didn't have my size 42 which I say it's pretty standard for West Europe
http://www.vanharen.nl/NL/nl/shop//00003001184782/Lederen*veterschoen.prod?r=5&‌​c=3&q=1375582&st=PRODUCT
wow there is an asterisk in the url
this breaks the SO chat
ahaha funny, I don't know why but this makes me laugh
 
1:15 AM
@ziGi stupid SO chat.
 
do you know that the kick function was invented because of me
:D
because they thought I was trolling in the JavaScript chat
but I was just disagreeing with their ways of how things work
and then someone decided to smurf my account
so later in a few months after I got banned and kicked, I received an aplogy
 
stackoverflow.com/questions/16600708/… this comment almost gave me an aneurysm I swear
 
Understanding security much?
:D
 
@ScottArciszewski new word learned.
@ziGi no. It's just seeing and not making the dumb mistakes everyone does out there.
 
@ScottArciszewski What, the guy can't build a backdoor?
 
1:20 AM
A bit knowledge mixed with a bit common sense.
 
what does it mean that global variables are not enforced
and that they create soft global dependency
when is it hard?
Hm still a bit unclear on this The best designs wouldn't include any constants or conditionals or magic-numbers or magic-strings or hard-coded anything. So if the best designs don't include constants, do they use strings instead in multiple places or what?
64
Q: Pros and Cons of Interface constants

GordonPHP interfaces allow the definition of constants in an interface, e.g. interface FooBar { const FOO = 1; const BAR = 2; } echo FooBar::FOO; // 1 Any implementing class will automatically have these constants available, e.g. class MyFooBar implement FooBar { } echo MyFooBar::FOO; // 1 ...

this is from here
Configurations?
 
interface someInterface { /* @todo: define an interface */ } class someClass implements someInterface { /* @todo: implement some shit */ }
I...
ummm...
I don't even...
 
user895378
@DaveRandom I am interested. As always it's time that's the scarce resource, though ... not so much the interest. Keep me apprised of any progress if you don't mind :)
 
1:37 AM
@DaveRandom i really like the word "unfucking" it has some nice ringing sound to it
:D
 
dafuq newmediarockstars.com/2015/07/… first youtube, now instagram. Have these people no respect for their users anymore?
 
@ScottArciszewski Do you ever get the feeling like we did something stupid when we tried to get computers to keep secrets for us?
 
I try to explain to people, computers don't lie, you do. So whenever you're trying to get the computer to lie for you, it usually sounds like you're doing something stupid, because ... well ... you are!
 
1:44 AM
lies are just creative truths
 
user4920811
a novice question: how should I use of array in class ?
 
user4920811
@ScottArciszewski lies are creative, but not truths ;-)
 
@stack He was creatively lying to you
 
user4920811
@Sherif :-)
 
2:39 AM
@DaveRandom I would also be interested in contributing.
 
user895378
@Trowski For something like that I was thinking we should just have a single global default event loop and start it automatically when the script executes. Thoughts?
 
@rdlowrey That's what I was thinking.
 
user895378
Do you think we should even allow the creation of additional event loops by the user or just limit it to the single global loop?
 
Along with building the promise/future/coroutine stuff into PHP. Essentially what I'd like to do is build Icicle into PHP. :-)
@rdlowrey I really don't see the use case for additional event loops.
 
user895378
The only use-case I know of is for modal dialog windows ... you can start a secondary loop that effectively starves out the default loop until you take whatever action is expected.
 
user895378
2:45 AM
But do we even really want to support that kind of thing? Do people really want to use php to create native destop applications?
 
user895378
I think the tradeoff in ease of use of having a single default loop that's used for everything is worth losing that edge-case additional functionality.
 
user895378
Expecting libraries to know about an event loop is one of the biggest difficulties for this kind of thing in userland and hiding that detail would make it much simpler for php developers to learn how to write code this way (I think) ...
 
user895378
The best thing about building it on libuv is that the library solves so many cross-OS problems that exist in php currently re: missing windows support for things like signal handling.
 
@rdlowrey I agree. Proper threading with a separate loop in each thread would also allow creation of anything, including desktop applications.
 
user895378
I don't believe threading is something that should be exposed to userland if that's what you mean.
 
2:50 AM
@rdlowrey This was one of my goals with Icicle. User code does not need to care about the existence of the event loop. Coroutines can even be used to make periodic timers without accessing the loop.
 
user895378
@Trowski I always went back and forth on this in amp. I originally allowed things like this inside coroutines:
 
@rdlowrey I think it would be nice to automatically run certain tasks in parallel, and expose some API if users wished to use it.
 
user895378
function() {
    yield new Repeat(function(){}, $interval = 42);
};
 
user895378
@Trowski Totally. We could definitely introduce things like async and await
 
user895378
libuv makes this relatively easy as well -- you can offload any C function calls to worker threads and receive the result asynchronously in the main thread once they complete.
 
2:52 AM
@rdlowrey This is exactly what I'd like to do.
 
user895378
This is why I've always thought libuv was the right solution. It solves so many problems that php currently has.
 
@rdlowrey I don't have any special structure or class for this, but you can do this:
function () {
    while (1) {
        yield Coroutine\sleep($timeout);
        // Periodic task.
    }
}
 
user895378
I think the biggest obstacle to widespread use for something like this (an async libuv-based SAPI) would be how to handle BC. We'd basically have all these old blocking functions that have existed forever in php. How do we move people to the new functionality?
 
user895378
I don't really love the idea of prefixing all the new stuff with async_* to differentiate ... that would be hideous.
 
user895378
I don't really love the idea of a Php\Async namespace either (yuck)
 
2:57 AM
Neither option sounds great, and I would rather not see a \php namespace.
 
user895378
Well, we already have a PHP namespace ;)
 
That's what global namespace is for.
 
user895378
The problem is how you differentiate between the async functions and the existing blocking functions that do the same thing.
 
user895378
I would say you could just use an async keyword before the invocation but the APIs may not match between new and old functions.
 
user895378
But if we committed to keeping existing APIs the same then it could work.
 
2:59 AM
That's an interesting option.
 
user895378
The async keyword, if prefixed like async file_get_contents($path) would execute the function in another thread and resume in that location (like a coroutine) when it's available.
 
user895378
Otherwise it would just be blocking.
 
user895378
I think that would retain BC but make it possible to do new async things.
 
Yep, that's definitely worth exploring.
 
user895378
We'd have to go through and add async functionality for existing functions and error out if it's unavailable for the function it's used with.
 
user895378
3:00 AM
Also would want the ability to define async functions in userland using the same API.
 
user895378
Anyway, just some thoughts to get the old noodle running on the topic.
 
user895378
Off to bed now. Will catch you later.
 
Yeah, I'll give it some more thought. Night.
 
3:55 AM
am I wrong in believing the method signature for \Serializable::unserialize is incorrect?
or is the example wrong... lemme test
nevermind... doesn't do what I thought
 
4:28 AM
Hi guys, Does anyone know of a way to use cap'n proto in php?
 
4:50 AM
Anyone have any input on this
 
AAB
Hi Good Morning All,
Need a bit of help
gone through the docs here but am not able to use the functions present in CodeIgniter Helper
 
where are things falling down... on load or on call
 
AAB
I am trying to extend the html helper
I get an error saying call to undefined function link_tag
but the function i wrote for dropdown work fine
oops silly me
the problem was related to file name case
 
 
1 hour later…
user4268046
6:06 AM
Array
(
[0] => zero
[2] => two
[3] => three
[4] => four
[5] => five
[6] => six
[7] => seven
[8] => eight
[9] => nine
[10] => ten
[1] => new one
)
 
user4268046
How do I sort this by key?
 
@TheMineBench ksort()
 
user4268046
thank you :D
 
anyone know how sql injection scanners work? do they just try to hit a bunch of common GET/POST requests and hope for a return value? lol
 
6:39 AM
@A.O. They mostly check to see what parameters are being used by you and try to inject from their . And yes they try common exploits too. To see attacks in action use OWASP Zed Attack Proxy.
@A.O. Be careful with OWASP Zed Attack Proxy. Don't test on applications running on production serves.
 
moin
 
@Jay.s thanks! seems pretty basic to me. I use PDO prepared statements in 99% of my queries. THere are a few (like 2-3) that arent parameterized at the moment was curious how they would find those....
 
user4920811
7:01 AM
any moderator is here ?
 
@Trowski it's nothing like that simple ...
 
posted on July 21, 2015 by kbironneau

/* by annisar */

4
 
AAB
Hi again,
A question about Assigning Values
The page below shows values being assigned in Model class instead of in the Controller
whats the correct way?
Instead of $_POST is it not better to use the input class as they do input purification?
 
@NikiC ping :)
anyone elses twitter background disappeared ?
 
7:19 AM
damn that coding love page is bad for wok :/ lol
 
@JoeWatkins I realize that will be far from simple.
Perhaps even realistically impossible, but worth looking into.
 
not for us, not in my opinion ...
it's not impossible, but unreasonable ...
for libuv it is reasonable to parallelize synchronous code using threads because the overhead of creating a thread in C is tiny, the overhead of creating a thread in php is not ...
 
I'm thinking we could parallelize blocking functions by creating a thread using libuv, hopefully keeping much of the C code the same.
Tasks would be controlled by an event loop in the main thread that would not block, delegating blocking tasks to a set of threads.
 
libuv isn't magical, it can't prepare a thread for executing php code, preparing a thread is expensive, you cannot use the same model to fire off lightweight threads when there is no such thing as a lightweight php thread
 
Threads would be executing C code.
Which means most blocking functions would need to be re-written to leverage that.
 
7:32 AM
no they wouldn't, they would be executing zend code, take for example file_get_contents, which relies on streams, which relies on the same things as userland php code with regards to the thread it is executing in (uses request based emalloc etc) ...
it can't work the same ... I'm not wrong
 
And I wasn't trying to say it would work the same, I realize it can't.
 
it only makes sense if it can work the same ...
 
The idea is to make it transparent in user land, but run tasks in threads that can be threaded. I haven't really dug into enough to know what that entails.
Honestly I need to learn more details about how the engine works to figure out what can be done.
 
morning @DamienOvereem
 
7:48 AM
Good morning
@SebastianBergmann hehe, such a nice feature rejected :p //The guy who made it is sitting behind the wall near me - reconsider :D
 
moin @AlmaDo
 
hi, @JoeWatkins
 
Morning all
Has anyone tried running travis builds against PHP7 yet?
 
Morning
 
8:14 AM
 
@garoevans yeah
I've added PHP 7 nightly build support. Try it with "php: 7" now! https://github.com/travis-ci/travis-ci/issues/2480#issuecomment-75988205
see thread on gh
moin fab, jim
 
user1642018
hi all , i have query.
 
Thank @JoeWatkins I need to add '--no-interaction' to composer install. Now I have a successfully failing build ;)
 
user1642018
i have custom function which returns multidimentional array, like this
 
user1642018
$db = custom_function($data);
 
user1642018
8:21 AM
but its oveerwriting the $db array
 
user1642018
why is that ? how can i make output from function append in to the alreaedy present array ?
 
user1642018
function retrurn array in this format .,
 
user1642018
Array
(
    [content] => Array
        (
            [hash] => hash
            [og_name] => og_name
            [files_count] => 22
            [size] => 389876400
            [creation_date] => 2015-07-19 06:13:44
            [title] => title
            [category] => 703
            [keywords] =>
            [uploader] => 0
            [upload_date] => 2015-07-19 06:14:06
            [verified] => 1
            [enabled] => 1
        )

    [tracks] => Array
        (
            [0] => url1
 
what you are asking isn't very clear, try: php.net/manual/en/function.array-merge.php though
 
Morning
 
user1642018
8:26 AM
now before i call the function and store value in $db , there are already values in $db like $db[content][relname] = 'relname' ;
 
user1642018
but it unsets previous array values.
 
user1642018
damn my english.
 
@AMB $db = custom_function($data); will obviously overwrite what was in $db before the assignment. see php.net/manual/en/function.array-merge.php
 
@DaveRandom lol. Okay I will contact Aquiss and ask them to.
 
user1642018
okie., thanks looking in to it, i was looking into array push but thats different.
 
8:33 AM
Wonder how concerned I should be with @DaveRandom SSH'ing in to my router :P
src vs lib folder. What goes in which and why?
 
Anonymous
Monin o/
 
@iroegbu try this: $db += custom_function($data); //Will run a array_merge :)
 
> If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator
depending on what you want, that's why AMB should read the whole page.
 
user1642018
array mrge and array union both are overriting array inside array.
 
user1642018
$db['content'] array gets overwritten. if i do it like this
 
user1642018
8:45 AM
$db['content']['title'] = 'set before';
 
user1642018
$db += custom_function($array);

printr($db);
 
Seeing people use Math.random() to generate a password is painful.
;_;
0
A: App for generating passwords

AmeliaDo not, under any circumstances, use Math.random() for a password. Ever. Use the Web Crypto API and use RandomSource.getRandomValues(). See this question on SO for a small explanation on why Math.random is insecure (hint: it's a predictable PRNG, and you can predict future passwords in advance ...

(Yes, I am aware it is JabbaScript. Yes, it's atrocious)
 
I think internet has even more bad javascript than bad php
 
user1642018
okie, i guess its array_merge_recursive i am looking for.,
 
user1642018
yes, yes , yes
 
8:51 AM
What is wrong with this recursion call? ideone.com/fEGLiT
 
@tereško bold statement, considering wordpress exists :p
 
user1642018
array_merge_recursive is built in function so i guess its better.,
 
@Amelia consider jquery exists
wordpress uses jquery
 
@tereško yeah, but jQuery is a nice abstraction over XmlHttpRequest being inconsistent and nothing more, or you're using it wrong :p
 
@Amelia if you are using a 20MB library for XHR, you are doing it wrong
 
8:56 AM
@tereško Or you could pull out jQuery.ajax/Deferred/Promise and have a microlib for it
 
I dont think you can just "pull them out"
 
@tereško technically can; they're self contained
Also I just found my new favourite JS lib
 
you're welcome
 
Didnt notice that this chatroom preffers eval.in. so here it is: eval.in/402101
what did I do wrong with that call?
 
can you define "wrong"?
 
8:59 AM
:3
 
because making a tree using nested arrays is "wrong" in my book
 
Lets not go into details of data implementation: recursive call for counting how many elements are there beneath the element (children, grandchildren, ...) is returning wierd counts
 
@DaveRandom FW'd you the email response from my request for a reprofile.
 
So I guess I did something wrong with recursion, but I cannot find it where..
And chat goes dead, everybody cracking heads on that simple yet complicated recursion?
 
@SubjectX or doing other things.
 
9:07 AM
or that, yeah
 
@SubjectX Have you stepped through it with a debugger?
How to debug with PHPStorm: youtube.com/watch?v=LUTolQw8K9A
 
hmm, do we have any online step-by-step debugger available?
 
@SubjectX use count($content, COUNT_RECURSIVE) , Luc
 
where?
 
@Danack sigh back in our times we reed books, or then - articles in the Internet (aka manuals), found via google. Now it's "video-generation" :p
 
9:21 AM
moin
 
Hey Chris, sent you an email to your php.net
 
Nobody knows? :(
 
nobody knows what?
 
@Fabor Hmm, I guess just see how you get on for a couple of wks
 
Fair enough. Seems okay so far but not used it massive amounts so far.
 
9:29 AM
@tereško: Nobody knows why my recursion is not working as planned..
 
Debugger knows, ask him
 
@AlmaDo to be fair, the PHPStorm interface is so bad that a video to show how to use it is probably a worthwhile thing.
 
why are you passing around a reference, @SubjectX ?
 
@SubjectX JUST USE A DEBUGGER. PHPStorm has a free trial. Stop trying to debug stuff by just staring at it.
 
@tereško: This solution is part of a bigger problem and I need to modify original array, I cannot work with copies..
but if the references are problem..
 
9:32 AM
@Fabor Just suspicious of that buffering youtube vid, might have been a one-off/problem at the other end but that shouldn't happen, it's the sort of thing that happens when you have lossy upstream. Suck and see I guess.
 
maybe that's part of the problem: your data structure is fucked
 
maybe that's part of the problem: your code is fucked
 
Thats really constructive answer @AlmaDo
 
if you want to know why your code is not working, learn to debug (either manually or using step-by-step debugger)
if you want to know how to solve that problem better, tell us what problem you are trying to solve
 
I think I will switch to HTTP codes when handling such requests. This particular one: 402 Payment Required
 
9:38 AM
Thank you guys, solved it. Cheers for your extensive help!
 
202 Accepted
 
@Fabor I blocked myself out last night, I only went in in the first place to do that
 
lol I don't mind that you have/had access. Probably would've made my life easier in the long run :P
 
@rdlowrey @Trowski I'll let you know when I get cracking with something real, probably later this week (thur/fri)
 
9:57 AM
@Fabor Oh well, in that case, lets set up a site-to-site VPN and I'll just route all my torrent traffic via your connection :-P
 
Can anyone recommend an RSS feed generator that doesn't make me want to kick puppies?
 
lol. That'd be a bit of a bottleneck for you though :P
 
ThW
10:21 AM
@Danack From what, and why not Atom?
 
@ThW From data pulled from a DB, and I've not used Atom before - is that what the cool kids are using these days?
It's for a blog feed.
So as long as most things can read it, I don't care the details.
 
ThW
@Danack Atom is actually defined XML with a clean namespace, many RSS feeds mix some Atom in for stuff like relations.
It is easy to create with any xml library
 
> It is easy to create with any xml library
 
Like, fluentDOM
:P
 
@Danack XML makes me sad
 
Even if it's simple - I'd much rather have something do it for me...so I don't need to read the specification file for Atom.
 
Here you go @DaveRandom.
 
@Fabor gdi
@Danack Such simple. Much library. Very Atom. So spec compliant. Wow.
 
I squandered the opportunity to force convince you to learn to play Go Chris. :(
 
Lol, why is this tagged php: stackoverflow.com/questions/31536324/…
 
10:39 AM
Because if a PHP dev can't solve it, no one can.
 
@Fabor I'm tempted to go and show a DirectX XNA fullscreen problem to a PHP developer and see what their reaction is
(The solution, btw, was to drop DirectX)
 
Well tbf my skewed version of PHP Dev is people in this room :P
 
@Fabor aka the crazy people
 
heh
 
@Fabor ?
 
10:49 AM
I keep trying to get people in this room to play Go. Haing you IRL was a perfect opportunity to impose this will.
 
@Fabor Go is fun
 
Exactly. Solid proof right there ^
 
Is there any logic behind this? 3v4l.org/8GvgO
 
@Ocramius because disallowing things is apparently a fun hobby
 
@Ocramius DateTimeInterface should have been a thing in PHP 5.0; it pisses me off when I try to work with a custom date object, so now I just explicitly use Carbon for everything ever because working with a raw datetime annoys me.
 
10:55 AM
not that everybody needs to implement their own DateTime. but why bother of explicitly disabling the interface? i don't know
 
someone just asked "is FuryX and 980TI the same? which should I get?" with no fucking context
 
@RonaldUlyssesSwanson you can't mock the bloody thing, which is awful :c
Well, you can, but it's a pain
And only in PHP > 5.5
Then again, if you're using anything under PHP 5.5, you are doing it wrong and I wish you luck.
 
Does anyone know of a way to use cap'n proto in php?
 
well ...
that's not an interface really ...
 
11:04 AM
@DaveRandom yes
and it's fucked up like... from 0 to 10... 19543705p709437
 
it should be an abstract shouldn't it ?
 
(yes there is a "p" in there)
@JoeWatkins final abstract class DateTimeInterface {}
2
:P
 
How do I exclude characters individually? ([^ipd]) so it's only i, p, d and not ip or dp, or ipd?
 
[^ipd]{1} ?
 
I don't know why that exists
 
11:07 AM
@RonaldUlyssesSwanson Thanks, is the ? a part of it?
[^ipd]{1} ?
 
Haha, thanks!
 
not sure i've understood what you mean tho :P
 
@RonaldUlyssesSwanson Don't think it worked, basically just need i p and d in one string, never merged. So I can't execute zx, but i can execute ip, I don't want that executed.
 
@Ocramius final abstract… what?
 
11:10 AM
i
p
d
not ipd
not ip
not id
not pd
not pi
etc.
 
@bwoebi try to implement it. Try to extend it :p
 
/^i|p|d$/ ?
(again, the ? is not part of the regex)
 
@Rahul ask on SO with a complete example
You'll probably get rep.
 
@Amelia I mean, that shouldn't work at all.
 
well, you can in internals, actually
still, this DateTimeInterface makes no actual effing sense now. Why do we even have an interface if that's how it works?
 
11:12 AM
@RonaldUlyssesSwanson Just ^[ipd]$ would do the same there
 
@Ocramius Because type hints are always abstract classes, right? :p (That seems to be how ZF2 does god damn everything)
 
@Ocramius also interested in the answer to that ...
 
I've given up obeying method not found/type hinting in PHPStorm because >ZF2
 
@Ocramius Maybe the same reason like for Throwable?
 
I think someone just made a mistake, and thought it looked neater as an interface, but it isn't one, it has to be an abstract to function
having an interface that can't be implemented is extremely strange, very php, but very strange ...
 
11:13 AM
@JoeWatkins such PHP. Much wat.
 
@Ocramius especially because type hinting it is kinda bad
 
whatever the reason, I doubt it can be changed
 
The problem is that the fix locked up the interface rather than the completely broken implementation, where state is shared between DateTime and DateTimeImmutable internals
 
tbh I know nothing about datetime internals, but we can't remove DateTimeInterface or have it be an abstract, so I don't know how to move forward ... find another way to do whatever you are doing is probably best ...
 
Also:
Even more fucked up: `DateTimeInterface` cannot be implemented in 5.5.8, which means that a patch release actually broke compat #phpSadness
 
11:22 AM
Just blame Derick :-D
 
why are you using the interface at all @Ocramius ?
 
@JoeWatkins because it's an interface, and we should rely on it instead of relying on a concrete impl?
 
would anyone mind helping with this gettext issue? stackoverflow.com/questions/31502711/…
 
Precisely, this issue came up while testing with a stub. Stub was working before.
 
11:27 AM
it's being so inconsistent :l
 
I'm not sure why it exists, does anyone know ? it must be solving some problem, right ?
@Ocramius oh yeah ... if it were an interface ...
it looks like a minimal abstract, and has the requirements of one ... but whatever happens you can still move forward by extending DateTime rather than implementing the interface, right ?
 
It's almost as if that whole bit of code design is terrible and needs to be re-written for PHP 8.
@JoeWatkins That's not so useful for testing.
 
Anonymous
Anyone know of a good solution for directory selectors? So, user has a browse button, selects a directory and $_POST['directory'] = the directory the user selected. Not sure what the best solution for the directory selector is though?
 
@Danack o, y? seems like a mock object that extends DateTime fulfills the requirements of an object that implements DateTimeInterface ?
 
DateTime was fucked from the beginning. All we could do is at least stop users from shooting in their feet with it
 
11:35 AM
stopping people from shooting themselves in the feet is fine, so long as it doesn't involve putting your foot on top of theirs and hoping it will stop the bullet ...
there's a bit of that going on ...
an interface that can't be implemented is strange
there are still holes in feet, whatever ... different feet ...
 
How do you have an interface that cannot be implemented
 
@JoeWatkins the actual problem is not that
It's having this interface at all
 
the gas man just ruined my life ... I can't use my hob, so no sausages for me ... I might as well be dead ...
 
DateTime and DateTimeImmutable are not interchangeable
 
@nikita2206 yeah, probably, not sure what the original reason is ...
so is it just so they can share an interface ?
so you can hint for the interface and get either ?
 
11:42 AM
I'm not sure why it's there... Maybe for a type hint really
 
an abstract would have done the same job, but not broken anything ...
you do need to be able to hint for either ...
 
user image
4
 
lol
 
indeed, rofl.
 
@Fabor smiling and headshaking…
 
11:49 AM
@JoeWatkins I think possibly that becomes a pain if you actually want to mock a class that does other stuff than just DateTime and that class implements the interface, and you need to pass the mocked object to a function that expects and instance of the class. You then have to jump through hoops to create a mock that extends a class that itself extends DateTime...
 
but DateTime doesn't do other stuff, so how would that come about ?
 
Someone wrote some code like AppointmentTime implements DateTimeInterface for PHP 5.5.x where x is less than 8.
 
oh i see ... what a mess ...
 
Yep.
 

« first day (1739 days earlier)      last day (3225 days later) »