« first day (1626 days earlier)      last day (3326 days later) » 

Anonymous
3:00 PM
@HamZa you have been called php master? Pss, I've been called a php God here in SO ;)
 
hehe
I'm off for now. Gotta workout a bit ...
 
Anonymous
Laters
 
@FlorianMargaine are we talking about the features in micro versions?
 
@Tyrael yeah
 
there are a lots of sides of the story, but I didn't really wanted to argue over one side or another just start the discussion so I can hear what other think.(ended up still arguing for one side though)
but yeah, could have mentioned the distros, and the fact that a large majority of the users are using the default versions from their distros
 
3:06 PM
@Tyrael what's a micro version?
 
patch version
but our terminology AFAIR is major.minor.micro
 
oh ok
I've always heard it as Major.Minor.Revision
but ok, I got ya
 
where did the go?
 
timed out likely
pins only last a week or so
 
user895378
3:20 PM
Hypothetical question (only because I just wondered about it) ...
 
user895378
If a user without enough SO rep to speak in chat is made a room owner can they then send messages to the room?
 
user895378
(I was thinking about chat bot implementations)
 
Man, i've been writing PHP for 8 years. And I'm probably younger than most ._.
 
user895378
Younger than me for sure.
 
@ircmaxell I actually like: Catastrofic.Major.Minor.Patch
 
3:22 PM
number of years programming != skill, knowledge or ability
 
BigBang.Catastrophic.Major.Minor.Patch.Micro.Femto.optionalquestionmark
 
@tereško Fork.Catastrophic.Major.Minor.Patch
 
@ircmaxell: it almost certainly indicates insanity, at least for me
 
(fork happens when the bug found gets baptized with a cool name)
hmmm, so the options are "lax type" "weak type" "loose type" "loooseer type" "negligent type"
 
Coercive Type
 
3:26 PM
still has a "bad ring"
Zeev considered "weak" would create a bad aura around the "weak types", "coercive" does that too doesn't it?
 
I don't think it makes that big of a difference in any way
 
user895378
"weak" has a more negative connotation than "coercive" IMO.
 
user895378
Coercive seems to be the most descriptive of what actually happens.
 
@ircmaxell me neither, but picking a neutral name could help on translations.
 
eih
the goal of a good translation is appropriate translation, not just transliteration
 
3:32 PM
which doesn't mean it can't be helped
 
Does anyone know the command to get phpdoc to generate the placeholder php manual files from the functions in an extensions C files ?
 
@rdlowrey yea, coercive seems more accurate description
 
user895378
I've been eating a ton of these pumpkin seeds lately.
 
user895378
costco <3
 
@rdlowrey No, and you cannot make a user a room owner until they have 100 rep (you only need 20 for voice)
That's why Caprica has rep
 
user895378
3:39 PM
@DaveRandom good to know, thanks :)
 
I think if the English-speaking PHP community at large has a real objection to the pretty established term "weak typing" then maybe there should be a controversy section on the Wikipedia article about Strong and Weak Typing.
 
@NikiC I don't want to close it because then @Sara's will close and it will pass >.<
I think a lot of those are bad decisions, and while there are a fairly good number of "nos" in each category I think they all slightly pass.
 
@kojiro The community at large doesn't. The guy who is part of a company that is spending a large chunk of money on advertising their framework, which apparently is going to use weak type hints, has the problem with it.
 
@rdlowrey Talk to rlemon/Zirak if you're looking at doing something like that, they've basically dismantled the entire chat system from the top down, although afaik Caprica is still browser based, but I know someone was working on a server-side implementation at one point. The ws protocols etc are pretty stable, and balpha has been known to give out inside information about the internals on occasion.
 
user895378
@DaveRandom I'm really not planning to do anything with it ... I just was thinking about what would be needed and wondered about it :)
 
3:43 PM
@rdlowrey Your new pic looks happy. You write php. Why are you happy?
 
stackoverflow.com/users/1710543/cv-pls still exists if you decide you want to play with it
 
side-note when is Auryn ready for v1.0?
 
user895378
@Jimbo because php7 is going to be a thing!
 
Hell yeah!
 
user895378
@Jimbo I dunno if anyone other than you has been using it.
 
user895378
3:44 PM
the 1.0.0-dev branch, I mean
 
user895378
I'm still waiting for suggestions for a name change /cc @Danack @Patrick
 
@rdlowrey You better get it ready, I'm finding out within the next few weeks if my talk at Seattle's PNWPHP conference is accepted and Auryn is a central focal point ;-)
Also why change it man? It has meaning
 
@Jimbo It's unpronounceable from the spelling, and it's unspellable from any of the attempted pronounciations.
 
anyone here knows about kendo ui components?
 
Shit, there goes my Aurex project then ;) [silex + auryn]. I pronounce it 'orr un'.
 
3:48 PM
looking for someone that could help me with kendoUpload function
 
user895378
@Jimbo that's how I pronounce it too.
 
user895378
I used to care about the name but I don't anymore. Just dump a bunch and we can pick one. As long as it's all-lowercase I don't care :)
 
@rdlowrey I pronounce it "uh-roon"
 
<?php

$h = fopen("php://input", 'r');
$log = fopen("/tmp/phplogs", "a");

while (!feof($h)) {
  $chunk = fread($h, 2048);
  fwrite($log, "read " . strlen($chunk) . " bytes.");
  fflush($log);
}
it seems that php buffers the fopen('php://input')
is it possible to disable the buffering?
using streams, maybe?
 
user895378
You mean the stream buffering?
 
user895378
3:51 PM
stream_set_read_buffer($h, 0); // ???
 
@rdlowrey I haven't used it recently anyway.
 
actually, sending a GET instead of a POST request makes it work
 
I barely have any free time this semester. I'll be really glad when it's over.
 
@rdlowrey I used curl --limit-rate 2k -X POST -d @file http://foo/, and the fwrite were done at the end of the script only
using -X GET, it works
i.e. it's real time
it seems php://input is specially taken care of in post requests
 
user895378
Yeah I believe it is.
 
3:56 PM
It doesn't make sense for php://input to even work at all in a GET request...
 
user895378
Yeah I believe it is. @m6w6 may be the best person to ask about that ... I know he's done specific work with php://input
 
user895378
Well a GET body isn't technically disallowed ... but it is silly :)
 
@DaveRandom I was testing nginx new option to disable proxy request buffering
Turns out it was php who buffered :P
 
If you have karma but haven't voted on reserving even more types please do. Voting is close to 2:1 so whether you vote yes or no your vote is valuable.
7
 
(I mean, that's why my test case didn't work)
 
3:58 PM
@LeviMorrison what's the closing date and time?
 
@marcio A long time ago :)
It is essentially waiting on mine to close.
(Which I did just now)
 
@LeviMorrison then if people vote on "even more types" now the vote will be "illegal", better don't call for vote :P
 
I'm not sure about resource or scalar
 
oh, resource will reserved :/
 
@LeviMorrison wat
voted after closing? or is something just wonky?
 
4:02 PM
@Rican7 I voted on it, then closed it.
 
-1 on resource, +1 on scalar
 
@Rican7 that's a bug, it happened with other users.
 
Also note that "Even More Types" has multiple votes -- dunno how you are handling that.
 
@Rican7 Yeh the watcher thing has some timezone issues I think, note that not only is the vote after closing, it's also after now...
 
Resource is a meaningful class name imo
 
4:05 PM
It's also a meaningful 'scalar' name for php.
 
@Amelia that's why we have namespaces PHP\Resource
 
Heck, the way to make everyone happy would be to make that case-sensitive :3
@marcio i assumed it was forbidden globally, in any namespace, to use anything on those lists
 
@marcio That doesn't protect you.....the RFC reserves it regardless of namespace.
 
@marcio That is incorrect.
 
Hey guys
:)
 
4:07 PM
@Danack sure, that's why I think it shouldn't be globally reserved
 
How are you today?
 
These reserved names are prohibited even in namespaces.
 
@LeviMorrison are the names case-sensitive? because I have one hell of an issue with not being able to use a Resource class :<
 
In other words: I'm against resource being globally reserved because it's a useful name.
 
marcio
 
4:08 PM
@marcio I'm against it because I don't think it's a useful distinction (the type of resource is important)
 
They are case-insensitive. This is one reason I am voting against everything*.
* Except object.
 
Bah
make them case sensitive and add them all, or none at all :<
 
I have a feeling most people casually voted on this RFC. I'm not sure how many of them really weighed the benefit or impact, especially on ones like mixed.
 
Yo guys , does anyone here uses PDO?
 
class names can stay StudlyCaps :<
 
4:09 PM
@roimulia A very good percentage does.
 
Cool just wanted to check
 
@ircmaxell these are all generic type names, though. You could argue that for all of them
 
can't we namespace types?
 
im building app right now with server side(first time on app) so im wondering lol
 
I have an issues
 
4:10 PM
@Ocramius voted yes on resource? eek.
 
@Rican7 no, because there are useful contexts to the rest of them. Resource by itself isn't nearly as useful as a specific type of resource
 
I use collections which contain domain objects .. everything is fin in a trivial usecase
 
I hate this kind of ambiguous language design in which to create a type you have to globally reserve something. It's awful.
 
but now I want ot have a collection named "inventory"
 
i'm mostly annoyed because I have App\Contracts\Resource which is implemented by specific ones, @ircmaxell
 
4:11 PM
which can contain various types of domain objects
 
@marcio If you think of it as having a default of 'use Resource;' at the top of each file it becomes slightly less magic.
 
Or at least consistent.
 
usually, the collection is repsonsible for initializing the child elements
 
user2620028
Hey guys. Seemingly stupid question here but I have been unable to resolve it on my own. I am attempting to make a form that uses the Stripe payment service. I am unable to include the file and I am receiving a Class 'Stripe' not found error message
 
4:12 PM
... and nobody is paying attention ..
 
@ircmaxell that's much like what I'd do with "object"
 
@Rican7 github.com/onemightyroar/php-filemanager/blob/… <-- that's the important line. And that isn't handled by a resource hint
 
/pats tereško
 
<?php
namespace BluePeter;
class Valerie {
    private static $instance;
    public function instance() {
        return self::$instance ?: self::$instance = new self;
    }
}
Valerie Singleton ^
 
@tereško why is the collection responsible for initializing children?
 
4:13 PM
@ircmaxell mostly, because I am lazy
 
@Danack or require some kind of stropping to typehint native types (but it's too late for that)
 
it has addItem(array $parameters) method, which takes data from datamapper, instantiates a thing and populates it
basically, I usually have ThingCollection which always contains only Thing instances
problems is that now with the Inventory class I cannot really do that
the data, which datamapper is pushing in does not contain any unique characteristics
but in this new usecase the Inventory class needs to contain instances of Request, Proposal and Product
hmm ... I think I figured it out
I am doing it all wrong
 
@tereško cough, shameless plug, cough: reddit.com/r/PHP/comments/30s13n/…
 
to begin with, the Inventory needs to be service, which handles collections of request, proposals and products
 
(for instantiating based on the mapped data.... unless your DM does it automatically)
 
4:19 PM
my problem was of the You are doing it Wrong™ variety
 
@Rican7 HydratorInterface
 
hahaha
hate that name?
I went back and forth on it a million times
I figured it was the more well-known term that described the intent
I thought about naming it MarshallerInterface or something too, but I didn't think that was as well known (outside of Go users that are used to the term from the std lib)
 
@ircmaxell using zf2, slightly horrified at hydrators
send snacks and pizza
 
haha, don't think of them like the ZF2 DB hydrators
;)
 
@Rican7 name, concept, etc
 
4:27 PM
Hey guys
i have survies with 3 possible answers
I thought about save the current stats inside the DB as follow : VarChar : 23^27^2
the numbers is for the first answer votes , second and third
and ill breake it down myself
what are you thinking
 
@Rican7 I think I'd rather see something where you specify a type-spec and it returns a data structure (struct or associative array) using proper data types
 
is it efficient?
or it it's easier to store 3 ints separately?
 
@roimulia No, don't do that. Unless you have a huge number of responses, you can just query all of the responses to get the totals very easily.
And if you need to cache the stats, you can cache them in memory, rather than in the DB.
 
@Danack actualy it's for a app thats going to go big
 
btw s/survies/surveys/
 
4:31 PM
something like $userStruct = $incoming->process($_POST, array("name" => "string", "gender" => new Enum("male", "female"), "age" => new IntVal(0, 115))
 
hmm the stats is not always yours , something the surveys isnt yours
so you upload it from the DB
so i need to find what is the most effiecnt way to get it , store 3 diffrent INT values or store it on string and break it down on the phone it self , which is very easy for him when it comes to memory
 
@roimulia I strongly recommend doing it as simply as possibly. This is very unlikely to be an actual performance chokepoint on the application.
 
@ircmaxell We might do it, but will have to be discussed due to BC breakage...
might be better to introduce new random_ functions ^^
 
@NikiC yeah, I thought it used the LCG (which isn't effected by srand()), but seeing as it's using php_rand(), then no...
 
Danack , i have to do this , but there is several thing that im really weak on , like efficient , it would be very kind of you if we can discuss in private for 5 mintues and, i have a frew questions that i cant foruml a question for them
 
4:37 PM
@LeviMorrison Sara's proposal won't throw errors though, just documentation-reserve
 
No, sorry - it sounds like you need to hire a developer.
 
any chance you can assist me and i will assist you in what ever you need (ios apps client side)
no no
im doing everything my self
i know how to work on server , i just dont know the diffrence between a effiecnt and not
 
@ircmaxell that's actually very similar to how I'm using it
 
@HamZa No immediate plans at least
 
lol and for big apps it matters
@Danack no more than 5 minutes , thats all i need to start
 
4:38 PM
@ircmaxell Personally, I combine the hydrators with Symfony Validator to validate and coerce the types before setting the values of the model
 
@Rican7 Yeah, that terminology certainly has some bad connotations for me ^^
 
@NikiC eh, I think its appropriate though, even if the word's a bit jaded :P
 
Hmm, I wonder what TotalBiscuit said so offensive that my twitter got flooded with social justice warrior crap again.l?
 
@NikiC Are you sure?
She said that in an email but when I had last thoroughly read the RFC that's not what the RFC said.
> This RFC does not fully reserve them as keywords; it only prohibits their usage as class, interface and trait names. It also prevents them from being used in namespaces.
That would mean errors.
 
@LeviMorrison I trust what Sara said in the mail more than what she copy&pasted into the RFC ...
 
4:47 PM
Shit, I think I have a FactoryFactory :-(
 
AbstractSingletonProxyFactoryBean?
;)
 
DecoratorProvider
 
@NikiC @LeviMorrison yea, just the other day Sara was saying that she just quickly copy-pasta'd the RFC
 
@LeviMorrison Oh, and please don't do vote manipulation
I don't care if you tell people to vote one way or another, but intentionally keeping votes open past their due because you don't like a result, that's definitely not okay.
 
Hi guys I want to do some easy AI and I want to ask you what would be better if to do in browser based (AJAX/Php) or win application (C/Java) *I don't really use C/java btw" I would like to implement database (probably MySQL)
btw late happy birthday @PeeHaa
 
4:59 PM
do you think a small pre-processor layer in PHP to allow conditional code could be good? something like:

##if some_requirement_exp
// use shiny new feature
##else
// use polyfill
##endif
 
@NikiC Eih, it's Saras RFC, not Levis? Levis is closed and accepted?
 
1 hour ago, by Levi Morrison
@NikiC I don't want to close it because then @Sara's will close and it will pass >.<
 
@NikiC Yeah… he doesn't want, but he did.
 
@NikiC I haven't. I actually closed my RFC immediately.
 
5:00 PM
good
 
(Was the first thing I did this morning)
 
@marcio No, not really. What can it do you can't with standard PHP?
 
bad timing :3
@bwoebi you can't conditionally declare something
 
@marcio declare() is the only exception…
and there are reasons why that doesn't work.
 
@bwoebi using new syntax
 
5:04 PM
@bwoebi oops, not really 'declare()', I really meant declaration context, like methods and new syntax
 
@LeviMorrison great, sorry for the baseless accusations then ;)
 
@NikiC yup, writing forward|backward compatible code
 
I still haven't sent the email to Internals saying it is closed because of time
 
@NikiC You can put classes and functions in an if etc. … Just new syntax, yes. But is that really worth it?
 
@NikiC Unfortunately that means we probably need to have a chat on the Internals list then, since that's not what the RFC says.
 
user895378
5:10 PM
if (version_compare(...)) {
    require __DIR__ . '/compat/php7thing.php';
} else {
    require __DIR__ . '/compat/php5thing.php';
}
 
user895378
^ Just avoid pulling in the incompatible syntax?
 
@rdlowrey argh :D
 
user895378
I know that's suboptimal for things like autoloading and testing but it does work without changing the lanuage :)
 
"scalar" is currently 28:14
That's the only one that might not pass.
 
@LeviMorrison She's already said so on-list, so I don't think there's much to discuss.
 
5:13 PM
@NikiC I still don't think that's acceptable.
 
@rdlowrey we could have macro expansions too (not sure if it counts in favor of the idea though :3)
 
marcio Yes I will use a lot of math so I'm not sure what would be better. Php is server based so..
 
function factorial($i = 0, $factorial=1)
{

if ($i == 0) {

echo "The factorial of given number is $factorial";
}

$factorial=$factorial * $i;
$i-=1;

factorial($i,$factorial);
}

$fact=factorial(42);
echo $fact;
 
I don't see why people want to reserve resource. We have plans (but not concrete ones) to drop resources (and replace by objects). A resource typehint is just useless. Pass in a wrong type of rsrc and it's useless. It'd be enough if @rdlowrey and @Danack would quickly change their vote…
 
i just wrote a simple factorial function and it gives a output like The factorial of given number is 1.4050061177529E+51
But i want complete result in string which is 1405006117752879898543142606244511569936384000000000
 
5:20 PM
Tell me about it StaticVariable. I had many problems with that either and I still can't figure out how to do that. Oh god
Use some function that do math but return you string
I don't remember the name
But that didn't worked well for me. I was just lazy ^^
 
i know that it is beyond the limit of integer and php calculates it as a float and number_format is not working well..
 
@bwoebi I don't necessarily disagree, but also don't think that being able to specify a type fully means that it's useless. By the same logic you could argue that the callable typehint is useless, because it does not allow you specify a signature, and array is useless because we don't have generics.
 
user895378
@bwoebi I don't see any harm in reserving it and I disagree that it's useless. It can prevent me from accidentally passing in an int (e.g. for a file descriptor) when a resource is required.
 
an incomplete type specification is often still better than no type specification at all
 
@bwoebi It's not useless now, and I have dreams of class FileResource extends resource {}
class EmailAddress extends string {}
 
5:22 PM
@NikiC what do you mean by that...will you explain plz..
 
@StaticVariable you need to use php.net/gmp for that
 
@Danack extends resource makes no sense. You want an object there.
You can't create your own resources in userland.
 
i can't use them...
@NikiC is there any implicit or explicit way to convert that into string..
 
user2620028
I have a

require_once('relativepath/filename.php);

This file is getting required properly, however the class inside this file is not accessible to my code. If i copy and paste the code from filename.php into my file then the file works. Why is this happening?
 
@rdlowrey the issue is that the BC break would be even larger. When we specify resource in signatures, we'd have a bigger BC break, when we convert them to an object…
 
user895378
5:25 PM
I'm not sure ... the BC break would be huge either way.
 
@StaticVariable If you use php 5.6 it will be implicitly converted to string. otherwise use gmp_strval
 
@bwoebi yes, but what if that is a object?
 
user895378
@bwoebi And this RFC is not creating a resource type hint ... only reserving it.
 
@rdlowrey no, not really. You usually don't manually check against is_resource(). And for everything else, it'd be completely transparent (as long as it's just an object without methods) … procedural API won't disappear.
 
@NikiC i am using PHP Version 5.6.3 but i am not getting the answer...
 
5:27 PM
@ircmaxell ??
@rdlowrey Yeah, with what intents...?
 
@bwoebi aka: what if we changed resources to be objects which implement a virtual Resource interface
 
user895378
@bwoebi I would vote NO if it were creating a resource type, but it's not. It's only reserving the name (which I think is a sensible thing to do because we don't know what's going to happen in the future).
 
@ircmaxell That'd be a mess.
@rdlowrey hmh… k
 
enin
 
5:32 PM
@ircmaxell Because there already exist objects doing "resource"-like things…
 
/s/Unfair/Any/
 
@NikiC will you please help me in that question?
 
Also… not sure what value that interface would have?
 
@bwoebi legacy transition. is_resource($x) -> return $x instanceof php\Resource
 
@StaticVariable you shouldn't ping people - room-11.github.io
 
5:35 PM
ok....i didn't know that....thanx for help...
 
Chatroom Don'ts: Dump a link to this document as a response to someone doing a "don't". WHAT?
 
@ircmaxell I'd rather mark these internally and deprecate is_resource(). instead of an interface you can visibly hint against
 
fair enough
 
hmm ... looks a bit too much like a dong ...
 
5:38 PM
@JoeWatkins read the comments
 
oh oh
damn, I been so busy I haven't even had time to think of an april fools post ...
 
I know exactly what I want to do
I just am not sure how to pull it off
actually, I do know how to do it, now that I think about it... Though it will have a "hidden" dependency
hmmm, now to actually implement it
 
/me if off to podcast
 
enjouy!
 
@StaticVariable Sorry I'm missing a bit of context here? What's the problem you have with it?
 
5:52 PM
@NikiC actually i cant use gmp_ * functions and i need calculate factorial and result should be in int not in float.. like 1.5511210043331E+25 and should be 15511210043330985984000000
 
@StaticVariable So what's preventing you from enabling the gmp ext?
 
actually it is a task..
 
Without it you're gonna have a really bad time doing this
@StaticVariable can you use php.net/bcmath functions?
That would be the alternative
 
yes...but i haven't used them yet......let me study them...
@NikiC that worked....thanx for help.....i didn't know that this library exists....
 
great
 
6:02 PM
Some time (1~2 years) ago we had around 400 releases/day on packagist feed. Now it's around 40/releases day. Did most packages reach stable or people just stopped writing clones?
 
@marcio huh?
 
/me shrugs
Some of us are just using other repositories... firegento, for example
 
@marcio who are "we"?
 
@NikiC we = we all that use packagist to create or consume packages?
 
6:08 PM
Where do you got your numbers? Number of releases is increasing exponentially still
 
@NikiC that's not what the RSS feed says. Isn't the "versions" number absolute on the graph?
 
@ircmaxell IIRC SPDY only supports TLS, and HTTPS has the next protocol negotiation; that will hopefully encourage people to use it over HTTP 1.x -> 2.0 negotiation, which seems costlier.
nice doc :)
 
@marcio yes, but if the absolute is increasing super-linearly that means the delta is increasing as well...
 
@NikiC well, I'm only watching the "new releases" feed, not the "new packages", but that's super weird.
For instance, today we only got ~80 new version releases of packages. I remember that one year ago Monday was a day with usually not less than 300 new releases.
 
Anatomy Of A Type System

PHP 7 is coming quickly. One of the major features that it brings with it is the ability to use scalar typing. Are you ready for it? Join me as we take a tour through PHP 7's type system from end to end. Don't know what a type is? Come and find out! Are you a seasoned type user? Come learn how to leverage the new options! Confused about weak vs strict types? We'll cover concept, theory and practical details of the type system. We may even talk briefly about a few languages besides PHP...
thinking of submitting that as a talk proposal. thoughts?
 
6:29 PM
Is it true that with tight coupling the performance is a bit better and memory usage is less while loose coupling decreases performance and increases the memory usage? I read it in an article and I find it a bit hard to believe
 
@ziGi what article?
@NikiC ok, makes sense. The entries on the "newly submitted packages" feed (aka first releases) do not appear on the the "new releases" feed.
 
@marcio let me find it
 
@ziGi isn't it logic? If you do everything in a single function, it's much faster than across 30 classes
 
true
 
@ziGi Not necessarily
 
6:35 PM
 
It depends a lot on the programming language and the programmer ;)
 
@NikiC as correct as your statement sound it is a bit vague in my head right now
 
@ziGi In many languages abstraction always comes at the cost of performance. There are other languages (most notably C++) where abstraction is possible without any cost to performance.
 
@ircmaxell Looks good. May want to call out classic confusion between weak/strict dynamic/static, too?
 
@ziGi specially this part jpauli.github.io/2015/03/24/…
 
6:39 PM
@kojiro I've tweaked it slightly
PHP 7 is coming quickly. One of the major features that it brings with it is the ability to use scalar typing. Are you ready for it? Join me as we take a tour through PHP 7's type system from end to end. Don't know what a type is? Come and find out! Are you a seasoned type user? Come learn how to leverage the new options! Confused about weak vs strict types? We'll cover concept, theory and practical details of the type system while exploring how PHP's type system compares to other languages.
@kojiro but I plan on covering that in the talk itself
 
but I guess having loosely coupled code is cheaper in terms of maintainability than having tightly coupled code, because with the second option more time should be spent by the developer when adding new features or modifying the existing ones
 
@ircmaxell I dunno… the new wording makes it sound like a comparison between PHP7 and "other languages" is a primary purpose… isn't the primary purpose comparing PHP7 and PHP<7?
 
I wonder if generics would help or hurt performance even more on a language like PHP. On one side, there is no need to declare new classes, on the other the overhead of generating an object based on a template is probably not negligible.
 
@kojiro the primary purpose is to describe the type system
 
@ircmaxell I see, so the "other/php<7" difference is just a means to an end. WFM
 
6:44 PM
yup :-D
 
@marcio if there are generics implemented in PHP shouldn't there be also typecasting to actual classes instead of a generic object?
 
@rdlowrey would you mind looking at something for me? github.com/google/google-api-php-client/issues/…
 
@ziGi it depends on how it's implemented. I started a proof of concept generics patch some days ago and gave up because the idea of template traits and templates extending templates horrified me :P
 
ahahaha :D
I can imagine
 
@NikiC would storing an AST persistently be more costly than treating templates as classes?
 
6:47 PM
well if you think about it in C++ templates and generics are also quite complicated
 
I used C++ documentation as a reference.
 
@ircmaxell Which part?
 
> There are other languages (most notably C++) where abstraction is possible without any cost to performance.
do you just mean possible? or that all abstraction comes with no performance cost (at least within reason to all)
 
@ircmaxell C++ has both abstractions that are zero-cost and those that are non-zero cost
 
6:53 PM
which abstractions are zero-cost?
 
Primarily those that are generics based rather than virtual dispatch based
 
can you give an example?
do you mean templates?
 
Yes, of course
 
well, they aren't zero-cost
 
They are
 
6:57 PM
for using a single type, yes they are zero-cost
 
whats the link to the page on php.net to request karma, the official one ?
 
but for each type used, they increase memory usage (due to the duplication of implementation) as well as potentially harm cache locality due to the same effect
 
sure
however don't forget that you'd get the same without the abstraction ;)
 
@NikiC not really, since you wouldn't pay those costs with a generic style approach
 
@ircmaxell which is supported as well...
But has inherent overhead
Unlike templates, which don't have inherent overhead
 

« first day (1626 days earlier)      last day (3326 days later) »