Skip to main content

Timeline for When will Brexit happen?

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Jun 21, 2018 at 5:26 comment added Dom Hastings @SworrubWehttam omitting the <? is possible by use of php -r which implicitly adds it avywyay. Since command line flags are counted as a different language it should be added to the header: PHP + `-r` or something similar. Hope that helps!
Apr 4, 2017 at 9:49 comment added chocochaos I have added a more readable version of the code with some explanation. Perhaps that clear things up a bit =)
Apr 4, 2017 at 9:48 history edited chocochaos CC BY-SA 3.0
added 429 characters in body
Apr 4, 2017 at 9:41 comment added Sworrub Wehttam That just about covers it, thanks for the insight :)
Apr 4, 2017 at 9:36 comment added chocochaos You might want to check out some posts here: codegolf.meta.stackexchange.com/questions/tagged/php
Apr 4, 2017 at 9:22 comment added chocochaos Sorry, I missed your first comment. Yes, we are allowed to omit the opening tags, unless there is a requirement to supply a full program. The parenthesis are just fine the way they are. Yes, echo works without it, but calling diff on the DateTime object does not work without them. It runs fine here, what PHP version are you using and how are you running the program? :)
Apr 4, 2017 at 9:17 comment added chocochaos Just run it and see, it works fine, as per the requirements. There is no need to flush when running PHP from the command line. There's a \r at the beginning of the string to move the cursor to the start of the line, it keeps overwriting the previously outputted time. It's the same method that many other answers here are using.
Apr 4, 2017 at 8:16 comment added Sworrub Wehttam 2 more things, without flushing, wouldn't this just run forever and never display anything? And if not, I'm pretty sure this would keep building a massive string rather than refreshing the timer as per the questions requirements
Apr 4, 2017 at 8:12 comment added Sworrub Wehttam New here, and about to post my own answer. A few things: 1. Are we allowed to omit the <? tag here? 2. I think your parenthesis are wrong, right now you're calling ->diff on the echo rather than the DateTime object. 3. echo works without parenthesis anyway. 4. Even after fixing this, this doesn't work for me, but I'm new to golfing so that could just be me being an idiot.
Apr 3, 2017 at 8:40 history answered chocochaos CC BY-SA 3.0