« first day (1735 days earlier)      last day (3210 days later) » 
00:00 - 17:0017:00 - 00:00

12:00 AM
except that you probably meant Firebird :)
 
Right, right
 
Does anyone know a nice library for better formatting output of a data dump (like var_dump but prettier)
 
ok let me try
 
12:22 AM
what is difference between:
`header("HTTP/1.0 404 Not Found");`
and
`header('HTTP/1.0 404 Not Found', true, 404);`
 
The latter seems rather unnecessary.
Just stick with the first.
 
@Ja͢ck me ?
 
you
 
@Ja͢ck ah, just you offer me to I use of the first ? (I don't know english very well)
 
Yes.
 
12:30 AM
@Ja͢ck ah ok thanks
I have not a 404 page. I want to redirect the user to index.php when he enters a badurl. so should I use of `HTTP/1.0 404 Not Found` before redirecting ? like this:
`header("HTTP/1.0 404 Not Found");`
`header("Location: www.example.com");`
 
12:45 AM
No, just use header('Location: ...'); only.
It will automatically set the right response status code
 
@Ja͢ck I see, really thanks
 
switched from silly videos to lushprojects.com/circuitjs - now this stuff makes a lot of sense.
 
1:46 AM
@Ocramius If you're really into that kinda thing you should checkout 123d.circuits.io
 
 
2 hours later…
4:11 AM
morning
@PeeHaa actually that immutable thingy is not that bad, but not exactly what i'm doing
 
 
2 hours later…
6:43 AM
and mornin
 
6:53 AM
Morning
Happy Eid everyone!
4
 
7:19 AM
winning
 
7:53 AM
In an MVC application, how to decide scope of each controller?
 
Anonymous
monin o/
 
I have an Array of object in which some objects have same values.
I want to Remove those repeated objects from My array.

array_unique() is not working for Array of objects
Is their any function for this?
 
whats everyone working on
 
8:21 AM
 
hey anyone knowledge of prestashop ??
php prestashop ??
 
user image
10
 
need some help with prestashop friendly url's
 
Anonymous
@AlmaDo lol
 
no one knows???
 
8:37 AM
@AlmaDo whats wrong with that? wikipedia has mobile friendly subdomain
 
Hi guys need some help about postgres
?
Installed postgres, started service but while login it asks password which we don't know
 
amazon.co.uk/gp/product/B00RK0YTMS/… Price is a lot cheaper than a thought
 
@NeelIon sharing links between a device that gets redirected to the mobile friendly version, and a device that can handle the full version, sucks.
 
@Fabor yeah but it doesn't include the price of all the visits to A&E that you will incur ...
 
heh
Aren't you at that dinner today Joe?
 
8:50 AM
is that today ?
 
Yep.
 
-_- You're supposed to know that Joe
 
oh yeah, its today, yeah I'll be going to that ...
 
A lot of travelling for you today and tomorrow.
 
it's mostly just sitting on a boat ...
 
8:53 AM
How many times have you done a full practice of your talk @JoeWatkins ?
 
in total ?
er none ...
 
Worth doing a run-through with no audience. Get timings down etc.
 
@JoeWatkins It's really good to actually give the talk out loud so that you can have all the words pre-formed in your head ready to be spat out at the audience. i.e. you can build up a mechanical memory of what you're going to say....rather than have to figure out how to phrase things on the fly.
Even when stuff is clear in your head, finding a way to phrase it nicely doesn't always work the first time.
 
going to run through it with the misses tonight, then again in the car with chris and fab on the way there ...
 
In the car you'll not have a sheet to look at safely tbf :P
 
8:57 AM
no sheets, if I have a sheet, I'll just end up staring at the sheet ...
 
I'd drive your car but I haven't driven since i passed my test 10 years ago. Bit risky :p
 
chris could drive it maybe ...
I'll just have one of you work the slides ...
 
hahaha
"Fab, do the slides. NAO!"
 
:P
 
Morning folks
Who's got pre conf jiggles?
 
9:02 AM
@bwoebi You have memory leaks? :(
 
http://www.example.com/v2/index.php?page=http://www.example2.com
Look at the link. Is it possible to attack a website that way? As far as i know it is not possible to attack that way because pagination mechanism will not generate any harmful code, am i right?
 
Hi guys, is this considered bad design? if $bar['baz'] in $allowed_methods: $foo->{$bar['baz']}($params)
 
dan
9:18 AM
Any help in this question please? stackoverflow.com/questions/31471238/…
 
@sathia not necessarily, but i'd try to avoid it, if possible
 
@SergeyTelshevsky 404
 
@sathia It's fine, it's called whitelisting. Though I would probably use the value read from $allowed_methods just as a defense in depth against comparison bugs.
e.g. comparing two strings where one has a null character in it...
 
9:30 AM
@SergeyTelshevsky dem porn ads!
use imgur
 
dem adblock?
 
@RonaldUlyssesSwanson doesn't that show ads related to your search history, mate? :)
 
9:54 AM
noob question here.I dont know how to word this in google
 
Gotta get down on Friday
 
but for this
$conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password);
if your db is on a server do you give its ipadress here or url where $servername is
I have only evr use localhost
 
10:09 AM
@Gotalove do you have phpmyadmin or smth?
 
yes
@MarcelBurkhard
 
@RonaldUlyssesSwanson how would you design it then? a long if else looks pedantic
@Danack
thanks, what do you mean exactly?
ah, now i got it, good one
 
10:24 AM
@sathia like this:
$allowedMethods = [
    'update' => 'updateFoo',
    'fetch' => 'fetchSingleFoo',
];

if (array_key_exists($bar['baz'], $allowedMethods) {
    throw new \Exception('invalid method');
}

$methodToCall = $allowedMethods[$bar['baz']];
It separates the internal function names from the query parameter, and it makes it harder for me to make a mistake comparing things.
 
@Danack yup, good one, I'll just do this
you mistook the if though, I guess you wanted to do if(!array_key_exists
 
Why array_key_exists? It's not like you're going to have a null method name.
 
A sneak peek at tomorrows conference starring our very own @JoeWatkins and @Danack.
 
@Danack I've got the glass bottles ready for the heckling (Y)
 
10:29 AM
We throw tomatoes not bottles here in the South Jimbo.
 
Oh yeah, forgot... farmers. Tomatoes it is.
 
What time is your train?
And drunks throw bottles :P
 
Ha, you know me! :D And I won't be there until 12 tonight so will just be going to sleep straight away ready for tomorrow morning
 
What talks are you planning on watching?
There's that nice period of choosing either CakePHP or Wordpress. Also known as brunch.
For me at least.
 
@NikiC probably. never tried. No major ones and probably easily fixable.
 
10:33 AM
I'm going to watch Joe's then go to the composer one if I can
I might even go to the Backbone one but stick my fingers in my ears and blow loud raspberries when the wordpress parts are mentioned
Then API pain points
Dan's talk, then DB version control
Then... DRUNK LASER QUEST
 
@Fabor Dunno - probably just rock up to the station. Apparently the planned pub is the Still and West. What time were you thinking of starting drinking?
 
@Danack I'll very much leave that decision up to @DaveRandom.
I doubt I will be doing the laser quest though
 
10:57 AM
@Fabor How come?
 
Never really been a fan and I don't need the additional injury risk :P My body is broke enough.
 
That is almost the worst excuse I have ever heard... not a fan of laser quest!?
 
11:14 AM
@SergeyTelshevsky i use incognito :P
@sathia using a map<string, closure>
but it's not necessarily better, depends on what you are doing
 
11:33 AM
Morning :P
 
user895378
morning
 
Anonymous
11:49 AM
@PeeHaa o/
 
user895378
@Danack @Jimbo auryn 1.0.0
 
@rdlowrey yay!
 
user895378
And now follows the flood of regrets where I wish I could break BC but can't lol.
 
@rdlowrey just release 2.0.0 then.
 
user895378
yeah yeah yeah
 
11:55 AM
should've first released 2.0.0 and only then 1.0.0 :)
 
posted on July 17, 2015 by kbironneau

/* by James Basoo */

 
Hey
 
12:18 PM
@bwoebi Better to skip to 7.0.0 and remove all doubt
5
 
@Machavity :-P
 
Anonymous
@PeeHaa ping
 
Anonymous
12:53 PM
Anyone has any experience with fuelphp?
 
most of people don't even remember it
 
@samaYo 4 years ago I was playing with it, a bit shit
 
Anonymous
@rlemon You went through all my old questions ? xD
 
1:13 PM
hi all
somebody please help me
1
Q: Where I'm making a mistake in datewise grouping array elements in following case?

user2839497I've an array titled $all_event_details as below : Array ( [0] => Array ( [group_name] => Student Organisation [event_id] => 239 [start_time] => 1443546000 [end_time] => 1443546000 ) [1] => Array ( [grou...

 
ew, I'm getting pinged in PHP
@Jay so? public is public.
 
Anonymous
@rlemon Is this because of what was said in the HTML room ?
 
I randomly click through to peoples profiles
that is the magic of a public profile.
also, yes, what you said in the HTML made me chuckle.. "help or be quiet" is very funny.
 
Anonymous
@Jimbo Oh, didn't even know it was that old :)
 
Anonymous
There is a job, which seems to match my competence, and it requires a little fuelphp know-how ...
 
Anonymous
1:17 PM
I thought I might give it a try :/
 
Anonymous
@rlemon I know I was rude, it was just annoying me is all. Thanks for letting me know about my old questions though, I had forgot about them. Back when I was SO noob.
 
user895378
@rlemon Don't pretend you don't love it.
 
@rdlowrey :P
don't pretend you don't love it
:D
 
user895378
zomg I thought today was Thursday.
 
Anonymous
@rdlowrey Best feeling ever when you realise..
 
1:22 PM
nope, friday
and boss has already said today is a nooner
:D
 
user895378
awwwww yissssss
 
0
Q: Mobile scroll issue in magento

Deeban BabuI used flexslider for product image gallery Issue: mobile scroll is not working over the image but scroll is working in empty space or below the image below code is sample html <div class="flexslider productMain lftInner" id="productMain"> <ul class="slides"> ...

Please help this issue
 
@ircmaxell @tereško What do you guys think of SQRL?
 
1:42 PM
@MadaraUchiha I have worked on a similar project about a year an a half ago
but that one required a authentication client to be installed on a phone
 
@tereško SQRL needs an authentication client, but it doesn't have to be on a phone
 
I will read the whole thing later, but if it is any way similar to what I worked on, then it has one major flaw: the consumer (site) has to communicate with the provider (sqrl server) to verify that the user (client) has been authenticated
and to make that sort of process seamless, the consumer has to keep pinging the provider, otherwise the usability becomes tedious
 
 
@rdlowrey ^ nooooooooooooooooooo
 
user895378
it's just a non-issue as far as I'm concerned
 
1:53 PM
then again, @MadaraUchiha, I have not read what they have there .. only scanned over, maybe they have a bit different solution
 
user895378
As long as I don't have to use tabs I can go along with whatever the broadest acceptable standard happens to be.
 
@tereško Yeah, it's different
 
@rdlowrey Traitor :P
You're going over to the dark side...
 
user895378
@NikiC I'm probably going to disable the "braces" fixer though so I don't have to have those silly opening-braces-only lines
 
and they don't even have cookies
 
1:54 PM
The gist is: Site provides large random number, My app scans it, creates a public key from my private + hash or website domain, signs the URL with my private, and sends both the signed message and the site-specific public to the site's auth endpoint
 
@rdlowrey Yes...
 
The site verifies my signature with the public, and I am authentication
 
Anonymous
@MadaraUchiha @tereško Do you guys know any (good) micro framework similar to Slim or Silex?
 
@samaYo aurex? cc @Jimbo
 
On next visit, the process repeats, only the server already has my site-specific public on their end, and so can associate my identity with the on-site account.
It completely separates authentication from identification
 
1:56 PM
@samaYo nope. You should just assemble few composer libs
 
Anonymous
@FlorianMargaine That's just Silex :/
 
@MadaraUchiha that's still sounds exactly like what I was working with
 
@tereško The only secret here is my private
There's no further communication with the auth endpoint.
 
basically, your "client" becomes the holder of you account, and you link various identities to that same account
 
Anonymous
@tereško I could, be tying them up together is my problem. .. no experience ..
 
1:57 PM
@tereško Nope
My client is completely unaware of the online accounts I have
My client only knows my private key
 
Anonymous
I don't trust this: lumen.laravel.com
 
I will read it later
 
And it only generates public keys (and generates them again and again for the same sites, no persistence), and solves crypto challenges.
k :P
 
posted on July 17, 2015 by kbironneau

/* by d4b0urn4 */

 
2:18 PM
 
Um, doesn't PSR7 do something... broken, with respect to the fluency of the interfaces? If Message::doSomething() : Message and RequestMessage extends Message, then you can't continue chaining RequestMessage methods off of RequestMessage::doSomething()
They return "self" which isn't... actually anything IIRC.
We don't have generics, and the return is essentially upcasting the type
 
I know we don't have "casting", but as far as making assertions are concerned, it's no longer a derived type, but the parent type, and you can't chain derived type methods off of the reference anymore.
 
^ Friday link
 
@AlmaDo Not far from the truth
 
2:27 PM
@NikiC yay, so I'm a prophet? (:
 
@AlmaDo In the sense that Windows now supports 64bit, so there is absolutely no reason to use 32bit anymore
 
@NikiC but I don't care about win. It won't be removed for i386 for sure..
 
god opcache is awful to debug
 
one does not just debug opcache
I have a 32bit windows VM, and I can justify it ...
I downloaded windows from the internet and installed the wrong one ... it is not really worth installing again, I'm only using it to run a windows only training dvd thing ...
 
opcache is screwed in so many ways exciting in so many senses!
 
2:33 PM
at some point, I'll probably want it to build php ...
what's the bug anyway @nikita2206 and are you sure dmitry doesn't already know about it (calls it a feature maybe) ?
 
well, @NikiC - when jit for PHP will be in-built? :p
 
@JoeWatkins nah he doesn't, I'm making some changes to the zend_arg_info structure... something is going wrong in zend_persist_op_array_ex or in zend_persist_op_array_calc_ex or in zend_file_cache_unserialize_func or in zend_file_cache_serialize_op_array
 
Jul 7 at 18:24, by Joe Watkins
if anyone changes anything, I'm going to stab them in the face @PeeHaa
you have been warned ...
 
Haha were you searching for that particular message all this time?
 
no, was looking in the fridge ...
 
2:46 PM
I'm making callable(A, B) typing stuff, I need to change that
 
got a diff of the changes, I'll see if i can spot errors, I've had to change opcache before in those places
 
one sec
 
morning
 
@nikita2206 what do failures look like ?? iirc if calc is wrong you get an error saying that ?
 
2:55 PM
@bwoebi Found the first one: github.com/php/php-src/commit/…
I'm a bit afraid of changing code in phpdbg because there's nearly no test coverage
@nikita2206 did you try it without file cache already?
 
@NikiC I am, each time, too. I wish there were more tests. But I'm terrible at writing (initial) tests. … I'd be happy if anyone would volunteer to improve the testing system and add loads of tests…
 
@JoeWatkins basically, somewhere some children of arg_info is being mixed with another bit of memory, so when I run a script which should fail with error which looks like "blabla callable(callable($a)) expected, callable(callable(...$a)) given" - in the end it fails because smart_str tries to allocate 9GB of memory. Because at some point arg_info->name points to 0x40
 
Good morning
 
Good morning
 
hi, @Orangepill @ircmaxell
 
2:58 PM
@NikiC sure, I just remembered about opcache today and decided to look at it and if I will need to make any changes to it
good morning
 
@nikita2206 not without opcache, without the file cache
So you can exclude some of your possibilities there ;)
 
ah, good idea
It is disabled by default in CLI mode right? Cause I was calling opcache_compile_file right now in order to trigger it
 
Guys I need some advise. In short: I need to develop some sort of Administrative system that saves customer orders. The problem is that each customer has different types of data to save. EG Customer A requires 3 table columns while customer B requires 5.

Up to this point I have no issues developing this. But here's where I need advise: What if a new customer must be added to the db with an unknown amount of columns? Ofcourse I can simply add an extra table. But how would I automaticly create the required form / table in php to add / remove data to the new table?
 
Apparently I have shitton of leaks without it
 
Leaks are good :)
 
3:01 PM
sup?
 
The segfault is still there though
 
@icecub there must be a way of unifying the number of columns... you'll need to give an example to an order with 3 columns and another with 5 or more, makes it easier to solve.
 
@iroegbu Give me a few mins. I'll pull up the data sheets to give some examples
@iroegbu

EG 1: ID / packing slip / Customer Name / Date Order Placed / Delivery Service (like TNT) / Date Order Picked / Number of Pallets

EG 2: ID / Order Status / Article Nr / Description / Amount / Date Order Finished / Priority
 
first, you need to normalize properly... why do you have customer's information in EG1?
 
It's for a distribution centre with all kinds of different products and customers. So each customer has different product information etc. Currently there's an Excel sheet for each customer which makes it hard to normalize the data
I'm afraid I can't answer that question. The sheets were thrown at me with very few information to go around with. Only working for the company for a week now. Their administration is a mess and they're expecting me to solve it somehow. Sorry I know it's not much to go with like this
I was more looking for a general idea on how to do it. I was thinking about seperating all products from the customers and joining those together in a generalized table, but not sure if it's the best way to go
 
3:18 PM
Morning.
 
Anonymous
o/
 
@icecub I would be to settle in on a standard container to represent all orders, then create customer specific adapters to map the inputs and output to that particular customers data.
 
@rdlowrey But hooray! It's 1.0!
 
user895378
@LeviMorrison yes!
 
Thx @Orangepill. Didn't think about that yet :)
 
3:25 PM
@icecub and once you learn more about the business you can apply sane defaults for the orders to the customers that don't have a data element specified... for example in your second example there is not specified Delivery Service but the product has to be delivered somehow and you can set that up as a default in the input adapter for that customer on save
 
Anonymous
$route->get('/blog/{id}', function($id) use ($db, $view, $response){

  $blog = $db->select("SELECT title, content FROM blogs WHERE id = ?", [$id]);
  if(!$blog){
    $response->redirect('/404');
  }
  $view->layout('blogPage', ['blog'=>$blog]);

});
 
Anonymous
Anyone see anything wrong with that?
 
Anonymous
@rdlowrey @Orangepill ?
 
Anonymous
It's a small framework for personal use ... the above would be a simple demo ..
 
@icecub the benefits of doing that will be clear once you start writing any kind of general reporting.
 
3:27 PM
@samaYo Why do you redirect instead of sending a status 404 directly?
 
Should I use BIGINT or INT? If there will be many posts a day
 
@samYo I wouldn't give the db directly to the controller (use a domain model instead) and I would issue the 404 response directly other then that looks
 
@Orangepill Ye I see your point. I guess I'm just gonna start writing and see where I can generalize data. Anything I don't get will simply have to be explained by the company before I can develop any sane db anyway
 
Anonymous
@kelunik That would be to show a custom 404 page. If I send a 404 header, then it'll be upto Nginx to show the generic page, which is the same for all sites.
 
user895378
@samaYo You still have to send a 404 status code. It's incorrect to redirect and send a 200 status code with 404 HTML.
 
3:33 PM
@samaYo Just use a middleware to replace all pages with status 404 with your own error page?
 
Anonymous
The 404 is just an example in this case, it's more like a .. "blog not found" message, it would be the router's task to handle and send a true 404 response.
 
Anonymous
@Orangepill any example of this so-called "domain model" class I can't find any two source that are alike ..
 
Anonymous
it's a bit confusing :/
 
@samaYo You're redirecting, that's not a 404 status. I'm not sure, 3xx + 404 might be OK, but I'd send a 404 directly. I hate sites redirecting in case of a 404.
 
@bwoebi lxr.php.net/xref/PHP_TRUNK/sapi/phpdbg/phpdbg_bp.c#497 What's up with this variable?
 
3:45 PM
@NikiC no idea. probably some leftover. or… was it supposed to replace brake there?
 
Anonymous
@kelunik In that case, what would you do if a user was trying to read a deleted blog?
 
@NikiC I guess it was supposed to replace brake there...
 
4:07 PM
posted on July 17, 2015 by kbironneau

/* by marianoR */

 
@samayo the router wouldn't be aware of the missing blog post because there is a route match so you have two different sources for a 404... a route not found as well as a resource not found. As far as a domain model ... I just meant something like a blog object that came from a separate storage layer...
 
@samaYo For deleted blogs, I'd send a 410, otherwise a 404.
 
@samayo It might be just me but I have issues with seeing sql that close to the front of an app
 
Anonymous
@Orangepill I have some issues with it as well, that's why I would like to know more about the domain object model ... this seemed fine, but also bloated and overkill for a simple-page app.
 
4:22 PM
self is not a valid return type; correct? Further, even if it were it would resolve to the type that originally declares the member, not the LSB type. static isn't valid either, so no LSB at all.
So why the hell is PSR7 written with self as a return for interfaces? Aside from PSR7 being broken.
 
@Sjon Something is broken: 3v4l.org/lh6cf
@DanLugg self seems to be valid as return type.
 
Anonymous
maybe they meant return $this
 
Anonymous
or new self :/
 
My issues is that... with an implementing/inheriting type implemented/inherited methods that return self return the type of the parent (the interface/abstract class)
I know PHP doesn't have this notion of typed variables, but for the sake of sanity, I always assert as though it does.
interface I1 { function foo() : self; }
interface I2 extends I1 { function bar() : self; }

class C implements I2 {
	function foo() : self { return $this; }
	function bar() : self { return $this; }
}

(new C())->bar()->foo(); // is valid
(new C())->foo()->bar(); // is not
The latter being invalid as foo() returns an I1, not an I2.
So, when analyzing code that does this, circumstances with the latter would be invalid. Moreover, if the result of foo() should be returned to satisfy the type I2 or C for that matter, it should be unsatisfied because it's again I1
I know... PHP, magic, untyped vars, etc... it just drives me fucking bananas.
 
Anonymous
hmm, this is confusing. So, basically the object implementing an interface can't do shit by itself ...
 
Anonymous
4:35 PM
ehh php .. always confusing !
 
^
The problem is with PHP, we just say, "Oh, it returns $this, so it's still an instance of whatever... Call whatever methods you want anyway"
But it's that loosey goosey attitude that makes me want to pull my hair out and go back to
 
@DanLugg None of them is valid, because you'll get a compile time error, because the signatures are not compatible. Return types are currently invariant.
 
Generics solve the problem with recursive type params, but we don't have that.
@kelunik I haven't dove into 7 so I'm not savvy yet.
 
Hello
 
And 3v4l is borked, so I can't even see what you're talking about.
 
4:39 PM
@DanLugg Currently, it would have to look like:
interface I1 { function foo() : self; }
interface I2 extends I1 { function bar() : self; }

class C implements I2 {
        function foo() : I1 { return $this; }
        function bar() : I2 { return $this; }
}

(new C())->bar()->foo(); // is valid
 
@kelunik Ah, okay. Well, my issues still remains then. We need generics or some other mechanism to overcome the type disparity as far as code analysis is concerned.
Or... call methods in a certain order.
 
@DanLugg No, we don't need generics for that. We need covariant return types.
 
That'd work too.
I've used generics with recursive type params in other languages.
	interface I<T is I> {
		function foo() : T;
	}
	class C implements I<C> {
		function foo() : C { return $this; }
	}
 
@DanLugg I'd be happy with that
 
Likewise.
Though, covariance is tits.
 
4:46 PM
I use curl to extract and store th datas in the table.. my dat is name and price.... My table have 3 fields I'd | name | price | time.
Every min get result from table.. No I want if new price fild value is more than previuse price field echo price with green color and if less echo whith red price... new price is 2000$ and previuse 1500$...
Now I wan..
 
So, practically speaking, how does one overcome the current invariance of return types when analyzing code? Stop giving a shit?
 
@DanLugg Strictly coding to the interface. :P
 
@kelunik Interface inheritance. Answer: fuck inheritance
 
@DanLugg so I do it by deriving a 2-way type matrix. One direction shows all possible defined classes that can resolve a type hint. The other shows all possible type hints a class could resolve.
 
@DanLugg Yep, that's the current answer.
 
4:51 PM
@ircmaxell But you do so based on actual value type, not on return type, correct?
 
@DanLugg what do you mean?
 
So I attended MozCon this week, a conference about marketing/SEO.
Those bastards there ended up making me sign up for Twitter so that I could give feedback live.
 
$this is subtype of the asserted return type. If you're analyzing on asserted return type, it wouldn't satisfy that which the instances' value type could. ... but if you're analyzing on value type, you're running, not analyzing.
 
So much dev hate there, it was upsetting.
Anyway, I think I've followed most of you twitts, did I miss anyone? I'm "@CharlesECapps"
 
@DanLugg can you show me an example, your words are confusing me (though they may be completely correct)
@CharlesECapps, Eugene, OR
Sysadmin & Developer
7 tweets, 8 followers, following 26 users
 
Anonymous
4:55 PM
@Charles What a coincidence, I just signed up 2 minutes ago.
 
Anonymous
_samayo
 
@samaYo My condolances.
 
interface I {
	function foo() : I;
}
class C implements I {
	function foo() : I { return $this; }
	function bar() : C { return $this; }
}

function test() : C {
	return (new C())->foo()->bar();
}
All kinds of wrong are happening here; because foo() returns an I which has no knowledge of C::bar()
Oh, my example was incomplete... but same point.
 
@ircmaxell Neato, didn't think SO would inline twitter users themselves.
 
function test() : C {
	return (new C())->bar()->foo();
}
^^ Similar problem, but with the return type of test
 
4:58 PM
so I analyze that fine
 
Anonymous
@Charles You are following 27 people, so the condolence belongs to you, i.e. tweets == waste of time :)
 
But because we lack syntactic "casting", how can you assert that I::bar() is valid?
 
because I iterate through all possible I's, of which there is only a C, which has an appropriate bar() method that returns a C
 
Oh. Okay.
 
@kelunik fixed
 
4:59 PM
So it's probably okay... ;-)
 
now, if you throw anoter I that doesn't extend C, then I will raise a type error there
 
00:00 - 17:0017:00 - 00:00

« first day (1735 days earlier)      last day (3210 days later) »