« first day (1469 days earlier)      last day (3473 days later) » 

4:01 PM
@ziGi That's also used
 
I know only that one :(
 
@rdlowrey so... I've heard you have a shotgun...
Should we be worried that you'll chase the kids from lawn with it?
You're lucky I'm using Shitbuntu now, otherwise I would Photoshop you beyond recognition.
 
@webarto do you know the one that fold paper airplanes and shoots them?
I should get one of those
 
posted on October 24, 2014 by kbironneau

/* by Stichoza */

 
4:10 PM
posted on October 24, 2014 by Anthony Ferrara

There has been a lot of talk about typing in PHP lately. There are a couple of popular proposals for how to clean up PHP's APIs to be cleaner. Most of them involve changing PHP's type system at a very fundamental level. So I thought it would be a good idea to talk about that. What goes into a type? Read more »

2
 
@ircmaxell people have accepted this to make us confused and because of legacy, didn't they
do you have an article about why do we have to still type a $ before variables but not before constants?
 
@ziGi have to type?
 
type like in "type with your keyboard"
 
it keeps the two symbol tables separate, which is required by a lot of things...
 
so why does PHP do that but most of the other languages don't?
 
4:16 PM
because many other languages use a single symbol table for everything
having separate ones means a lot of flexibility, at the cost of first-class meta programming
 
can you elaborate on the flexibility part
 
Well, among other things, removing that breaks variable variables
It also gets rid of our nice string interpolation symmetry, the reason Rasmus chose it
:<
 
@AndreaFaulds That would be a feature, right? :D
 
@NikiC ^^
 
@AndreaFaulds On the other hand, it makes string interpolation more powerful by not limiting it to things that happen to start with a $
 
4:19 PM
Can any one suggest me , Is opencart version 2.0.0.0 is ready to use or not
 
@NikiC and a lot scarrier
 
@NikiC We have {} for that ^^
 
any one can answer to my question
 
@AndreaFaulds nope, that also only works if it starts with $
 
@ArunAgarwal it is. But most plugins/themes are not and they had like.. 2 days or something of beta ..
 
4:22 PM
@ircmaxell not really. could just use normal ${...} syntax where ... is an arbitrary expression ;)
of course doesn't make a lot of sense if $ actually delimits a variable
 
@NikiC dam you and your nice things which we cannot have
 
@Ronni I checked it on 3 rd october , the responsiveness was not working properly and even in admin some variables weree missing
 
@AndreaFaulds aren't variable variables bad coding?
because they hide the nature of the thing you want to do
and you can always use reflection
 
Of course.
 
So I don't see how that's a pro
 
4:26 PM
@ziGi variable variables, yes. variable functions? not so much. variable methods? variable properties? not so much
 
@ircmaxell what do you mean by variable functions/methods/properties?
 
$foo(). $obj->$foo(), $obj->$foo
 
I condemn anyone who does this, because it adds an awful lot of opacity to the code
even your IDE doesn't know what is happening
and I consider it code obfuscation
why not directly call the address where the method/function is stored
what is the difference
you can still keep it in $foo when you do $obj->$foo
 
@ircmaxell doing that doesn't really require the $ tho ;)
 
it might make things easier for people who write code but it makes is harder for those who read it
 
4:31 PM
@ircmaxell good reading, thanks (blog)
 
@NikiC no, but it makes it much clearer
 
sometimes, yes
 
class Foo {
    private $value = 5;
    public $bonJovySucksAssBigTime = 'getValue';

    public function getValue() {
        return $this->value;
    }
}

$foo = new Foo();
echo $foo->{$foo->bonJovySucksAssBigTime}();
here is your result
 
I'm reasonably certain I'm going crazy... there must be some way to set an array pointer to the specified key?
(without reset() and looping next())
 
@DaveRandom no
And more importantly: Why are you using the array pointer? :(
 
4:34 PM
@NikiC to point to array of course, what kind of question is this?
 
/me goes to look in spl to see if there's something more suited to what I'm doing
 
@DaveRandom what are you doing?
 
@NikiC looking into spl, ins't it clear?
 
Iterating an ordered list, in the loop body some elements may be removed from the list, I want the following iteration to get the next thing that still exists
 
This reminds me of the time when my mom asked me where I am and I told her I am with Nick and then she asked me where Nick is and I told her that he's with me.
@DaveRandom better use linked list
 
4:38 PM
A PHP array is a linked list, hence why I thought it should be easy to do
Oh wait, I can just do a while (next()) loop
duh
 
maybe you can, but I wouldn't do that
 
@DaveRandom what do you mean, how are arrays linked lists?
 
@NikiC I'm open to suggestions
 
my brain is going to explode
 
4:40 PM
@DaveRandom Missing too much context to give a meaningful suggestion
 
@rdlowrey This is turning into a rabbit hole....I need to recompile PHP because of "zend_mm_heap corrupted" and:
 
^
 
*** buffer overflow detected ***: strace terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f02745e4507]
/lib64/libc.so.6(+0x1003f0)[0x7f02745e23f0]
/lib64/libc.so.6(+0xff2a7)[0x7f02745e12a7]
strace[0x409d04]
strace[0x40592f]
strace[0x403045]
strace[0x404661]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7f0274500cdd]
 
Just saying that while (next()) + modifying array in loop sounds pretty adventurous ^^
 
^
use linked lists
 
4:40 PM
As I'm going to be re-compiling anyway - could you send me your compile options, just in case there's any other ones I should be aware of like the file-limit one.
 
@ziGi PHP arrays are implemented underneath as hashtable where the buckets are connected in a doubly linked list, that's how you can loop over them and use string keys in the same data structure...
 
uh, ugly
 
@NikiC I'm feeling adventurous :-D
 
so does this mean it is better to use your own linked list if you want a better performance?
cause if you can't have O(1) what is the point
 
@ziGi You can, that's the whole point of it...
 
4:43 PM
how do you have an O(1) when you have to traverse it?
and it's not a direct access of the memory
 
Basically the only operation that's not O(1) on a PHP array is shift/unshift on an indexed array
 
@DaveRandom Or at least, that's how they used to be implemented ;)
 
@DaveRandom and a linked list doesn't store where in the list the key is…
 
@NikiC orly?
 
@DaveRandom phpng uses a normal array to determine order, not a linked list anymore
 
4:44 PM
@bwoebi no but it's also a hashtable, so I figured it should still be O(1) to do that (lookup key, find bucket, set pointer to bucket)
 
@DaveRandom you do realize hashtables have collisions?
 
@NikiC So hash collisions affect order now, presumably?
@ziGi and?
 
@DaveRandom nope. Order is still separate, just not implemented using a linked list anymore
 
I... don't understand that on the face of it, will have to go read teh codez
 
maybe I should write a blog post on the new ht implementation
 
4:47 PM
I would enjoy that, certainly
 
I think it's quite nice. well the implementation isn't, but the concept ^^
 
@NikiC You really should…
 
php arrays map a scalar key value to a php primitive data types, they maintain order, additionally they use a hash as you said to provide a random access to the elements using the keys
this means they are ordered hashmaps
 
@Zigi - why are you telling core developers how php arrays work?
 
@bwoebi maybe will do that today ... getting a bit fed up reading TEM docs
 
4:48 PM
cause I am fed up
 
@NikiC TEM means?
 
with the decisions people make
 
Why not go for a walk or to the pub? You sound in a bad mood.
 
there are like 3 layers at least that are building up a PHP array
 
@bwoebi transmission electron microscope
 
4:49 PM
and it is more or less a monstrosity in terms of memory
 
@NikiC Heh, looks like @JoeWatkins has made everyone start blogging again :-P
 
@NikiC ah, you're having fun at uni?
 
@Danack sold
 
NikiC how are you so good at all the things at only 19?
 
In fact - why don't I go for walk to the pub....
 
4:50 PM
@QuolonelQuestions Call him wunderkind, he loves that
 
@QuolonelQuestions he has no life
 
I have no life
 
@Danack sold
 
But I am not good at things
 
@NikiC have you found a cure for acne?
@QuolonelQuestions maybe you are just not investing your time properly
that's why
 
4:51 PM
Fair point
I have a poor attention span
 
Not good at what?
 
@ziGi … when you're trolling around too much, you're no longer fun…
 
@QuolonelQuestions you should pay it more
 
it's like people saying "I have 5 years of experience". Big whoop, I have seen people with 6 that are reverse Steve Hawking - body of an athlete, shit for brains
 
Right that was definitely a sign I need to go home
later @all
 
4:52 PM
later @DaveRandom
 
cause of people being hired like that (my former colleague) I have to fix stupid code right now
 
@DaveRandom did you just ping me and leave ?
nice ... nice ...
 
@JoeWatkins That's how I roll
really actually going now
bbiab
 
and because people take advantage of things that are made easy in the language so they could be affordable for people to use them
 
s/roll/troll
 
4:52 PM
and they produce bad code
 
1 more hotel to book, and my Argentina trip is complete
 
and then those people get hired and make more money than other people that are really good and contribute (like Joe) and have no place to live
that's why I am mad
cause experience doesn't mean someone is better
if he didn't make the time to improve himself while doing what he does
and different people remember things in a different way
 
@ziGi and some companies do that. But many realize it and don't buy that BS...
 
@ircmaxell Is this another conference or a vacation?
 
Who out there would like to build an amazing "Debugging" section for PHP The Right Way? Like http://www.phptherightway.com/#templating, but... for Debugging.
 
4:54 PM
@bwoebi for some definitions of "fun" ;)
 
@JoeWatkins go for it
 
@ircmaxell you are right
 
@cspray first few days are conference, then a week vacation
 
but I know cases of big companies hiring people that don't know what a binary tree is or how to write a fibonacci
 
Nice. I'd like to do that kind of thing one of these days
Are you going to be speaking at this one too?
 
4:55 PM
@ziGi and I don't think that's a problem. Algorithmic trivia isn't useful for the average developer
 
@JoeWatkins If you want to do, I'd like to join the party too ;-)
 
yes but I know for instance that the guy didn't know there are different sorts of sorting, also has no idea of proper OOP and I had to fix some BS cause he did everything with inheritance and 2000+ lines of abstract classes.
 
@ziGi So, you just realized that the world is unfair and cruel? :)
 
the problem is sometimes big companies don't know how to interview properly
@NikiC I know this
 
@NikiC You're now in fifth semester? then next semester… what'll you do?
 
4:57 PM
but there should be something done to make it better
 
s/sometimes/almost none.
 
whatever, I am a fool anyway, had to become a Designer instead
 
@bwoebi more of the same - well, and writing bachelor thesis
 
@ziGi if you're writing OOP code, you better know OOP practices. But to not know a binary tree in detail, while that says something, I don't think it's overly important
@NikiC any idea on the topic?
 
@ircmaxell nope, zero
 
4:59 PM
@NikiC suggestion: mixed-mode compilation techniques :-D
 
@ircmaxell haha :-)
 
@ircmaxell meaning what? ^^
 
hi guyss hi @ziGi
 
@ircmaxell well I guess if Leaseweb ask this question, so apparently it has something to do with programming for servers. IDK
 
@NikiC leveraging JIT and AoT compilation techniques together in a single compiler to generate faster code :-P
 
5:00 PM
@ircmaxell but AFAIK Nikita isn't studying informatics?
 
hi @LukeSmith
 
@NikiC and for the record, I was kidding
 
@ircmaxell Well, assuming that AoT = JIT with more optimization, that's what a normal JIT does, right? :P
 
@ircmaxell IT jokes 101
 
5:02 PM
Why do you guys prefer to use some hipster webchat instead of hardcore hacker chat like IRC?
 
100 internet points for title ...
@QuolonelQuestions because we are hipsters, you answered your own question ...
 
@QuolonelQuestions interesting question from a Steve Jobs wannabe
 
@NikiC The JIT can handle the more dynamic parts more easily.
 
@bwoebi I'm studying computer science as well
 
5:02 PM
mo' mo' mo'
 
@ziGi You should inspect my avatar more closely
 
@ziGi is it possible to do this dynamic rewrite rule from this
page.php?page=8 to this
/page/this-first-page-title based on whats coming in from the db
 
@LukeSmith yes in .htaccess
 
@NikiC ah okay. I thought physics/mathematics.
 
@QuolonelQuestions Because you can actually link replies to particular messages?
 
5:03 PM
@ircmaxell :D
 
Sometimes very old messages too.
 
@NikiC that's a big assumption :-P
 
@ziGi i have this at moment in .htacess but i need the title not the id RewriteRule ^page/([0-9a-zA-Z]+) page.php?page=$1 [NC,L]
 
@ircmaxell but is it?
 
@LukeSmith
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
that's a standard thing
 
5:04 PM
Where's the zend_string_to_lower() function which expects a zend_string* or how is it called now?
 
@LeviMorrison I see. I'm not familiar with anything beyond text-in-the-box when it comes to features of this chat, yet
 
@NikiC sure it is, because JIT you're limited to local compilation, or maybe region compilation. But with AoT you can do full-program analysis
 
There's a search? Oneboxing content? The star list is occasionally good? Markdown?
 
@ircmaxell I'd say that a sufficiently advanced JIT is indistinguishable from an AoT compiler :)
 
Transcripts from forever even when you aren't here?
 
5:05 PM
@QuolonelQuestions why don't we use cans attached with a string to each other instead?
 
@NikiC and I'd say you were wrong there.
:-P
 
@ziGi Because hackers are hardcore, not prehistoric
 
@ziGi how would i use the page title instead of the page id in the url
 
:P
 
@ircmaxell \date{July 27, 2016} :D
 
5:06 PM
I strongly suspect certain optimizations are easier to do JIT than AOT, as well as vice-versa.
Hence why people would be interested in mixed-mode.
 
Because I don't think the way I talk to people on the Internet defines me?
 
An AoT that does certain optimizations but instruments it with a JIT
 
@bwoebi I was going to use that paper in my PHPNW keynote as proof of good things happening to PHP shortly
@LeviMorrison precisely
 
@bwoebi there isn't :/
currently you do a zend_string_alloc + zend_str_tolower_copy
 
I've started to poke in the Dart VM source here and there.
No big insights yet ^^
 
5:07 PM
@LukeSmith like this: website\books\id\5\title\Harry+Potter
 
lol
 
@NikiC copy? why copy? zend_string_alloc + zend_str_tolower should be enough?
 
you were using Yii, right?
 
@bwoebi either alloc + tolower_copy or init + tolower, either will work
 
5:08 PM
@ircmaxell ah, hehe
 
@ziGi yes
 
args… confused alloc and init, sorry @NikiC
 
@LukeSmith check the link then
 
@ziGi no im not using a framework at al
@ziGi for a school proj
 
@LukeSmith then you have to write it yourself and it gets a bit more complicated
 
5:10 PM
@ziGi i have the index.php page set to home , just the dynamic pages are tricky , when you say complicated how much so do you mean?
 
@ircmaxell @Danack In case you are interested, the finished product of my Composer wrapper hacking for my PHP+Composer Docker container can be observed at github.com/Docker-nano/PHP/tree/composer/latest, and in particular, the env emulator that I was having problems with at first: github.com/Docker-nano/PHP/blob/composer/latest/product/env
 
@LukeSmith Look here then, it will help you -> tutorialzine.com/2013/12/…
what you have to do basically is again rewrite
but then in the PHP take everything after the '/'
and parse it yourself
 
@ziGi thanks man , will look at it now
 
yes
this should help you
it looks simple enough
I am leaving for now
PEACE
Zigi out
:D
 
@ziGi cheers man , have a good day
 
5:14 PM
I'm out for the evening ... lata chaps ...
 
Okay. Finally.
phpdbg is ready to be pushed into master.
2
\cc @JoeWatkins
 
@JoeWatkins have a great one
 
@bwoebi awesome
 
So, I've been thinking about how to code-generate C
and it's actually being a really hard problem...
I think I may need to generate an AST programmatically, and generate it out that way
because this current method of string concatonation is proving... flakey
 
@bwoebi freaking awesome shit :D
srsly must go tho ,will checkout lata
 
5:17 PM
yea :-)
 
@ircmaxell Do you actually work for Guggle?
 
@QuolonelQuestions no, I actually work for Google
 
Same thing
You're at work now?
 
yes
@ircmaxell @dhrrgn I prefer to call it Obola. Obama's Ebola. THANKS OBAMA!
 
Must be pretty relaxed environment
 
5:36 PM
The phpdbg push: git.php.net/… Have fun finding no bugs :-) \cc @JoeWatkins
 
I'm going to put Return Types to vote today. I have a few small bugs to work out, but I don't want this to slip anymore.
/cc @AndreaFaulds @rdlowrey
If anyone has any last feedback on the RFC itself I would appreciate hearing it. (Stuff like grammar, organization, etc.)
 
@LeviMorrison Yay!
OK, lemme look over it.
>Code which does not declare a return type continue to work
continues
 
#phpdbg just got an upgrade: an XML protocol for IDEs, some improvements ... and was ported to PHP 7! #PHP
 
@LeviMorrison The type covariance works properly for interfaces, right?
 
@AndreaFaulds Correct.
 
5:39 PM
And you made sure traits fail with a type mismatch, right?
 
I know there's at least one test for traits; will double-check though.
 
Since apparently for properties, if a trait defines an identical property to the class it doesn't conflict. Though I've no idea if there's anything similar for methods
Also
ActionScript and TypeScript use colon syntax for return types, I'd link to them too
 
@LeviMorrison Not a fan personally. Feels like it is trying to creep into the type strict area of other languages. Not saying I would not use it, in all probability I would. Just....how long till everything is required to be strict typed?
 
@Pheagey Never.
PHP is not Hack
This is optional typing, and always will be.
 
@Pheagey Fair enough.
 
5:43 PM
It allows you to write nicer interfaces and enforce them. It allows you to catch bugs in your code.
But ONLY if you want them.
 
until it becomes 'best practice' community wide, then industry wide...then PHP 7 "...will requires strict typing..." /end-dream-land
 
> // Overriding a method that did not have a return type:
 
Like I said, I'll probably use it, just want to be aware and not let it get out of hand.
 
@LeviMorrison does this mean I can override function foo() {} with function foo: Bar() {}? D:
 
@AndreaFaulds Yes.
 
5:44 PM
That's not good... that's not covariant at all.
 
This is just covariance, it's just not as obvious so I state it specifically.
 
I thought covariance meant you couldn't restrict the set of accepted types when overriding?
 
Wait, did I get that backwards?
 
Yeah, I think you did.
I will double-check, but I'm pretty sure.
 
5:46 PM
So you can go, say, Collection -> Set -> ImmutableSet?
Oh, I see why this isn't a problem, actually.
For parameter types, that'd make Sets incompatible with Collections
But for return types, it keeps Sets compatible with Collections
Right?
 
Correct.
 
Ah, awesome. :)
OK, my only complaint would be lack of a patch for the language spec
I'd like to encourage people to write them before putting RFCs out or putting them to a vote, not after. In this case it should be pretty easy, too, return types aren't a complex feature to specify.
 
I am happy to do that, except I have a lot of questions of how to do it.
 
But @NikiC usual that you need so much time for porting something to phpng? :-(
 
@LeviMorrison Fork php-langspec, make a branch from master, modify /spec, add tests to /spec
 
5:49 PM
I don't mean that kind of "how"
 
Not really that different from php-src. Except our tests are weirdly multi-file...
Oh?
 
@bwoebi depends on how much time you needed ^^
for normal extensions porting is very mechanical, so takes little time
 
What style of language should be used, do I post to list XXX, etc.
 
This is complete bullshit, I shouldn't be suspended for telling the truth
 
@LeviMorrison For style of language... clear and unambiguous, we use that RFC MUST/SHOULD/MAY thing. For lists, see php-standards, though any pull request is automatically posted there by a bot.
 
5:50 PM
and like 2-3 hours later
 
I suggest just looking at how param types are specified just now
 
@NikiC well, porting arrays and zend_strings is quick. But when I need specific functions, break the abstractions (watchpoints) etc… Needed time explodes...
 
hello everyone
 
Someone from HHVM gave me a suggestion: instead of ReflectionType::IS_ARRAY use the convention of ReflectionType::KIND_ARRAY
What do you guys think? /cc @AndreaFaulds @ircmaxell @NikiC @Ocramius @Danack @DanLugg
 
@LeviMorrison Why not just ARRAY
serious
 
5:56 PM
@NikiC I think, having it compile took me around 15 hours. Fixing watchpoints another 10...
 
@AndreaFaulds ...is that even allowed? const ARRAY?
 
@LeviMorrison I prefer IS_ARRAY
 
@LeviMorrison Oh, right.
 
@LeviMorrison no
 
And internals consistency is probably better.
 
5:57 PM
@AndreaFaulds Well there is your answer ^^
 
Though I hate long and double
 
(well, yeah, it's mechanical, but phpdbg heavily uses and interacts with arrays…)
@AndreaFaulds yeah… I have no idea why it's exposed as int and float to userland. should be twice double and long.
 
@bwoebi no, it should be int and float internally too
 
@LeviMorrison There's probably an obvious reason, but why not just getType and TYPE_ARRAY, TYPE_OBJECT, TYPE_CALLABLE, TYPE_UNDECLARED ?
 
"long" and "double" are liable to cause confusion
 
5:59 PM
KIND seems weird.
 
"int" and "float" are more commonly used, and more generic
 
@AndreaFaulds when I see "float" and "int" I always think of limited types.
 
@Danack you could have strings... "array", "object", "callable" as gettype does
 

« first day (1469 days earlier)      last day (3473 days later) »