Re: [PHP-DEV] Re: Was Reflection annotations reader - We Need A Vision
On Fri, Jan 11, 2013 at 1:00 AM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! I have a question, maybe it is dumb: why not those opposed to using annotations just... refrain from using them? We've been there before. You seem to be thinking as a person who only writes software for himself and has to deal with software only written by you. However, not everybody has such luxury. Once you start dealing with bigger projects, language environment and language ecosystem starts to matter, complexity of the code and complexity of what is being done with the code starts to matter. If some code is too complex to be properly understood, it will contain hard to find bugs, it will be misused, it will be routed around in weird ways due to the fact people don't understand how it works, and in general it will be a pain to all around. Basically, it will be a piece of closed source in an open-source project. And people will hate us for imposing this onto them. So while don't use it may work with isolated features (nobody objects to mongodb extension because they don't use mongodb), for language features it does not work. Once it is in, you're stuck with it as a part of your ecosystem. And since PHP has deep BC traditions, you are stuck with it next to forever. You make the wrong assumption on me, I'm not familiar on PHP's source, but I had assumed that horizontal reuse (Traits) would have been more complex. You make a very sane argument and I agree on the selective process, however, every time I read internals it seems that the general attitude is: please don't add more to it Is the PHP codebase in a bad place such that is hard to add to it?, I mean Also, to maybe put things in better perspective and discourage visceral vote (because the topic will keep arising until the end of times, I'd bank on that) why not make a list of pros and cons to adding this to the language? Did you read the past discussions about the topic? There was a lot of argument outlined about pros and cons. But it is not documented on the RFC. New people that come into internals suggesting annotations because they've had a first world experience with them in other languages most probably wont sit and search for all mailing list discussions on the topic and spend hours going through them to make a detailed analysis on why yes or why no. I care for PHP, but I don't really have the luxury of spending that much time on reading heated debates with all sorts of arguments where no agreement seems to happen. Finally, I remember the lack of support for development has been a problem... so why not call out for support to the community?, from GSoC to PHP gurus litterate on Comp Sci and software engineering and architecture? Please note that whoever you call out for will have to support this for years to come. You probably can write an extension and then just drop it out there and move on and let others deal with support. Even then doesn't work that well but at least with extension the problem won't be acute and will be localized. But with language core part you need commitment for at least several years, otherwise it would just be piece of buggy and clunky code that nobody can touch. Why the pessimistic outlook?, I thought the intention of open source software was to have people to gravitate towards the code and add value to it (and adding to it also means cleaning) Again, I understand, but then again PHP is under version control, Git IIRC, you can have that live in a branch and not integrate it unless it meets certain standards, but why not give it a chance to fail? Class metadata and annotations definitely are not a bad idea and that can be factually proven. Whether or not they can get to a decent shape or gather enough support, that is another deal. What I'm saying is: don't reject a proposal on the suspicion that it might not get development support and that you don't want to support it, let it sit in a corner until someone picks it up, and if no one picks it up, no harm done. Who knows, you might get a long-term maintainer from one of those proposals because he/she lives that need every day and has the knowledge to execute it. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227
Re: [PHP-DEV] Re: Was Reflection annotations reader - We Need A Vision
On Fri, Jan 11, 2013 at 1:51 AM, Ralf Lang l...@b1-systems.de wrote: Am 11.01.2013 05:55, schrieb dukeofgaming: I have a question, maybe it is dumb: why not those opposed to using annotations just... refrain from using them? Although I am not the least against annotations, there are valid and good technical reasons why one does not want to have a feature in the language. As Rasmus said, the code for annotations also needs to interface with opcode caches and other core and close-to-core technologies. This will require additional development and maint. time/manpower. This is a finite resource, there is a tradeoff between expensive new language features like annotations and other stuff which needs to be done. You can probably not have both at the same time. I understand, those arguments make sense. Wouldn't it be good to just document these sort of blockers in the RFC without rejecting the proposal?, who knows, someone can come and have a solution for each one of these in one form or other. Finally, I remember the lack of support for development has been a problem... so why not call out for support to the community?, from GSoC to PHP gurus litterate on Comp Sci and software engineering and architecture? I think this has been done before and most who stay and contribute over time have come here by their own means. By the way, even if it is not to work on a particular features, maybe call for more help on maintenance? -- Ralf Lang Linux Consultant / Developer -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] A remark about PHP's Vision and new things.
Hi, I suggest you start defining action items in the RFC. After reading what Stas and others say, this looks like too big a task to discuss in itself, so it should be definitely be broken down. You will probably find that as it is broken down, actual development support will surface by itself. Regards, David On Thu, Jan 10, 2013 at 9:49 PM, guilhermebla...@gmail.com guilhermebla...@gmail.com wrote: Stas, I totally agree and Pierrick and I faced all these problems during the creation of patch. If PHP doesn't all have support required for a given feature, let's just not only discuss feature, but also the required support too. Named parameters is a great example. I'd also name another one, ReflectionNamespace; namespaces are converted to strings and attached to their classes during compile time and you can never reflect over them to grab for example their names. I even mentioned to Andi back in 2010 that ZE gets re-written every 5 years. That happened in 2000, 2005 and we're now hitting walls because of monster changes required to implement feature A or B. Maybe it's time to consider a rewrite again? Cheers, On Thu, Jan 10, 2013 at 3:36 PM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! I strongly suggest to anyone following the (too many) threads about annotations to try the C# annotation and see what it allows. It goes As far as I can see, C# annotations rely on two very important things: 1. Compiler support. Compiler really knows a lot about what annotations do. 2. Extensive library support. Annotations themselves are just passive metadata, what makes them work is .net framework that uses them. This means to make annotations as useful in PHP we would have to have substantial support in the engine (including bytecode caching provisions, etc.) and some libraries that require very latest-and-greatest version of PHP. Another thing is that we're not having some features that are used extensively in C# annotations, main being named parameters support. I am saying this not to oppose the idea of annotations or the idea of looking into C# and other languages (actually, I think anybody who talks about it should look at least into what C# and Java do with it - and also what Python does, which is completely different direction, just to know other options). I'm just saying porting this to PHP may be less than straightforward. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Guilherme Blanco MSN: guilhermebla...@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada
Re: [PHP-DEV] Re: Was Reflection annotations reader - We Need A Vision
I have a question, maybe it is dumb: why not those opposed to using annotations just... refrain from using them? Annotations are currently used by the industry through workarounds to the PHP language, so any argument on it's usefulness is completely moot. Adding native support for this (no one says it is easy) is important for the advancement of the language, you already have your proof of concept out there, so there is really no discussing on whether they are a useful feature or not. Also, to maybe put things in better perspective and discourage visceral vote (because the topic will keep arising until the end of times, I'd bank on that) why not make a list of pros and cons to adding this to the language? Finally, I remember the lack of support for development has been a problem... so why not call out for support to the community?, from GSoC to PHP gurus litterate on Comp Sci and software engineering and architecture? Regards, David On Thu, Jan 10, 2013 at 5:18 PM, Yahav Gindi Bar g.b.ya...@gmail.comwrote: Agree, I thought about Those who don't want to annotations at all. So we can add 2 extra options for those who don't want annotations at all and those who wish better proposal :) PS : I'm with those who do wish annotations. ב-11 בינו 2013, בשעה 01:07, Ralf Lang l...@b1-systems.de כתב/ה: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Just a thought - if the main argument is about syntax - we can propose few versions (Without implementing them) and then vote for 1) No annotations (attributes) at all. 2) Syntax #1 3) Syntax #2 and so on. What do you think? If we come up with two bad ideas, it's not a reason to shred annotations altogether. ;) Alternative wording: 1) Syntax #1 2) Syntax #2 ... n) Syntax #n n+1) None of these - do nothing until we get better proposals. - -- Ralf Lang Linux Consultant / Developer Tel.: +49-170-6381563 Mail: l...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlDvSa8ACgkQCs1dsHJ/X7Ct/ACgx2PD/Pk4DDnFGC8QSq75K2J/ 8i8An0IXRxebk3663Y1rZaoZN+Fr5m6b =k2Bt -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Aspect Oriented Programming in PHP
AOP is not very well understood, it took me at least a week of going back and forth trying to grasp the core concepts. Before getting into debates (because the Observer Event patterns could still allow for AOP-like programming), I advice everybody to watch the following two videos Using Aspect Oriented Programming to Prevent Application Attacks (6 parts, very practical explanations and code examples): http://www.youtube.com/watch?v=c-492qXrT6w http://www.youtube.com/watch?v=jOqQpbk--jQ http://www.youtube.com/watch?v=tMHr34Empvo http://www.youtube.com/watch?v=A63g4xSvb1Y http://www.youtube.com/watch?v=-0U5LzLkPkY http://www.youtube.com/watch?v=PygweFC5VKM After you are finished, watch Aspect Oriented Programming: Radical Research in Modularity, which is a Google Tech Talk by Gregor Kiczales ( http://en.wikipedia.org/wiki/Gregor_Kiczales): http://en.wikipedia.org/wiki/Gregor_Kiczales In a nutshell, AOP could be said to be a gramatical extension to give languages the formal expressiveness to natively allow for decorating/observing/metaprogramming(code generation)/reflective behaviors, which can avoid lots of code duplication and increase performance modularity. I also would also advice everybody to look into AspectJ: http://en.wikipedia.org/wiki/AspectJ http://www.eclipse.org/aspectj/ Regards, David On Mon, Aug 27, 2012 at 1:06 AM, Ralph Schindler ra...@ralphschindler.comwrote: On 8/26/12 7:21 PM, Rasmus Schultz wrote: But AOP is just one of many popular techniques that require code generation. And for that matter, there is an endless number of different I'm failing to see what code generation you talking about. Could you elaborate about how AOP and code generation relate? I would much prefer to see the language enhanced on a lower level - to enable solid, reliable, efficient implementations of code generation in userland, paving the way for good AOP frameworks, as well as many other techniques and ideas, now and in the future. Thanks to bytecode caching, and various other advances in efficiency in the past few years, PHP in general is (or could be) a brilliant language for code-generation tasks. For instance, check out this elegant parser library: The benefit of AOP as a low-level (it is as low level as say, xdebug) extension is massive. AOP solves the problem of cross cutting concerns. In PHP, if you don't want to rely on globally accessible API's, solving this problem usually entails injecting another object. So now, your $controller object is injected with a $logger object, $authentication object, $session object, $caching object, etc. Currently, all of the major frameworks are attempting to provide AOP stylings though a Javascript-esque event/signal manager. To do this, code must be littered with something like the following: class Foo { public function doA() { $events-trigger('beforeA', $this); // actually do A $events-trigger('afterA', $this); } public function doB() { $events-trigger('beforeB', $this); // actually do A $events-trigger('afterB', $this); } // repeat for every other interesting method } Now, $events could be a dependency, it could be some object that shares a static scope, or it could actually be a static call like Events::trigger(). Whatever the case, any code that wants to subscribe to this AOP-esque style of allowing non-descript collaborators to advise or coalesce into the workflow has to follow this pattern .. all over the place. $this might be $this, but in many cases, it is a context object that bundles up necessary info including $this. With ext/AOP, all of that goes away. Objects can get back to just doing what their core objective was (even application services / models / controllers) and they don't have to care that a logger now wants to log something about what a controller is doing, or (taken a step further) that somewhere in the code an authentication aspect was registered to ensure a particular set of controllers is only accessed by users who are logged in. In short, the only aspect of this particular extension that does anything slightly related to parsing is it has a syntax for doing the engine level hooking. (Think of is as a DSL/syntax for setting smart breakpoints with a debugger). Also, consider how much simpler it would be to implement things like template engines... Not sure I follow here either. -ralph -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Aspect Oriented Programming in PHP
AOP is the future and a very awesome complement to OOP. It is a shame that very few are doing it and I think this would attract some good attention to PHP after traits (both are horizontal reuse mechanisms). On Fri, Aug 24, 2012 at 2:01 AM, Peter Nguyen pe...@likipe.se wrote: Well, you just have to know and check for the aspects I guess, if you're using wildcards in the joint points. It's no difference than knowing what PHP functions/classes/variables not to overwrite/overload. Besides, you can always debug_backtrace to find out which joint points was executed... Another option is not to use wildcards and define the joint point explicitly. 2012/8/24 Sebastian Krebs krebs@gmail.com 2012/8/24 Peter Nguyen pe...@likipe.se Your argument is a general issue when refactoring code. Whenever you change the name of a method/class, you need to change it in all the places that use it, even in the AOP definitions if you have it of course. The advice is just a PHP callable so it works in the same way. I talked about refactoring the joint points, not the advises, but thats not the point. If I refacter an identifier my IDE (I use PhpStorm, but the others should be that powerful too) supports me by searching for every occurence of the identifier, or even without the need to refactor stuff I can call find usage. With a string like $ 'Classname::method()' or $ 'Classname-method()' I need at least text search, that should work reliable, when no dynamic strings occur, because with $ 'Classname::' . $method it's getting hard, if not even impossible. One default case (it's mentioned in the quickstart of the extension) are the wildcards $ 'Classname::do*() I guess this would take much effort. Just refactoring is not that easy anymore. Don't get me wrong: I like AOP as idea and as concept, but I'm afraid, that it could lead to scary construction, where noone can trace, what happens when and why. Also as I mentioned I don't even have any better idea ;) Regards, Sebastian 2012/8/23 Sebastian Krebs krebs@gmail.com Hi, From my users point of view: I would like to see it. Maybe not in this implementation/syntax, especially because it hasn't a special syntax (but imo it should to make the impact more obvious/prominent). With the joint points as string and the common function call I can imagine it can get hard to find out, where a specific advise where attached, or which were attached at all, or just how many. For example I rename a method/class and I will not recognize, that a security advise gets lost, I may realize it as soon as I find my data on pastebin ;) But I have no idea how it could look like Regards, Sebastian Am 23.08.2012 16:36, schrieb Peter Nguyen: Hi, AOP (http://en.wikipedia.org/wiki/**Aspect-oriented_programming http://en.wikipedia.org/wiki/Aspect-oriented_programming) when used correctly, can make your application really modular. I've seen several implementations but they all require compiling of code beforehand. There is however a PECL extension now (https://github.com/AOP-PHP/**AOP https://github.com/AOP-PHP/AOP) that enable AOP in PHP directly. I was wondering if there are any interests/possibility to include AOP into the PHP core? Best regards, Peter -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- github.com/KingCrunch
Re: [PHP-DEV] Add runkit to PHP Runtime
This is a great idea (the runkit, not the rootkit). On Thu, Aug 2, 2012 at 1:12 PM, Kris Craig kris.cr...@gmail.com wrote: What do you think? I think I need to get my lens prescription updated. I thought the subject line read, Add *rootkit *to PHP Runtime and was already sharpening my pitchfork before I realized my error. For the record, I am firmly opposed to adding a rootkit to the PHP runtime. A runkit sounds pretty cool, though. ;) --Kris
Re: [PHP-DEV] A new idea on PHP6.
Now that we have Traits, lets bring in Aspects too! http://en.wikipedia.org/wiki/Aspect-oriented_programming Also, PHP is not necessarily evil by allowing non-OO code, but maybe we could do better at the non-OO code side of things by adding prototyped inheritance in a javascript-ish spirit to at least promote code reuse to those non-OO heretics. Yeah, this would definitely work *laughs incontrollably* On Thu, Jul 19, 2012 at 1:34 AM, Matt Wilson sha...@gmail.com wrote: I will also note that my phone cut off the part about this post not being serious. I, however, have no sense of humor. On Jul 18, 2012, at 11:17 PM, Ronald Chmara wrote: With PHP 6, lets start with a: Pure Object Oriented PHP ...idea, and extend it out, so we can have a: Structured Heuristic Idealistic Taxonomy ..so we reduce user confusion, and eliminate the vast majority of our userbase, (thus cutting down on bug reports, of course) so we can have a: Heuristic Accessible Readable Available Helpful ...language advance. (This is not meant as a serious post, but as a post to increase levity on this list. Your mileage may vary. Cape does not enable the wearer to fly.) -Ronabop -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RESULT] Choosing a distributed version control system for PHP
Awesome news, this particular decision tends not to be an easy one in open source software communities (well, perhaps now it is easier with all the traction git github have) so I think this is evidence of how good the RFC process is. Is there a github repository already?. Best regards and congratulations. David On Wed, Sep 7, 2011 at 4:57 PM, David Soria Parra d...@php.net wrote: Hi Internals, after 2 weeks of voting and discussion, I closed the votes today. The results are fairly straightforward. Most of the users want to move to a decentralized version control system. 52 want to switch to git 15 want to switch to Mercurial 1 for bazaar 13 want to stay with SVN I don't want to make a difference of who voted for what. I think the results are overwhelming in favor of Git. I'll continue with writing the implementation RFC for php-src. I would like to do the move for php-src until December (as I will be on vacation for the whole Oct). Let's see how this go. Any help is much appreciated. For everyone else, go read http:/progit.org, make yourself familar with Git. - David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RESULT] Choosing a distributed version control system for PHP
Yup, I know, actually I've just finished reading the RFC's implementation part and saw github just mentioned here and there, but not being the point of focus, which is the most correct attitude to have IMHO while choosing a DVCS (that's the only way Mercurial can steal some of the DVCS thunder: github out of the way, hehe). The question is, now, will github be part of the integration workflow?, or is that yet to be discussed?. I imagine the project wants to retain governability and I applaud that instead of using a 3rd party service as the master repository, however, given the social impact these services have —specially github— I think github must at least be part of the workflow, because, you know, the repository is distributed now, no place is necessarily special. Anyhow, what is the next step?, how could one help?. Regards, David On Thu, Sep 8, 2011 at 1:18 AM, Rasmus Lerdorf ras...@php.net wrote: On 09/07/2011 11:15 PM, dukeofgaming wrote: Awesome news, this particular decision tends not to be an easy one in open source software communities (well, perhaps now it is easier with all the traction git github have) so I think this is evidence of how good the RFC process is. Is there a github repository already?. Note the vote was for git, not github. And yes, there has been a github repo for a long time: https://github.com/php/php-src -Rasmus
Re: [PHP-DEV] [VOTE] Choosing a distributed version control system for PHP
The only think that worries me is that most of the time people choose the service and not the tool. On one hand you have Mercurial, a more than capable DVCS with the lowest barrier of entry IMHO (you will love it while you learn it), and the very good service that is Bitbucket, now kind of catching up to github (but not there yet). However, Bitbucket doesn't have —AFAIK— the quantity of users github has, and that would be extremely healthy for the project. On the other hand you have git, which is a very popular and powerful DVCS, however (you will pull your hairs out while learning it but will love it in the end) it is not as straight-forward to get working as Mercurial. Having current SVN-only contributors learn it might going to be quite a challenge. If I could vote I'd vote for mercurial, but then again, I bet having PHP on github will increase contributions very quickly. Damn. On Fri, Aug 26, 2011 at 1:48 AM, Lester Caine les...@lsces.co.uk wrote: David Muir wrote: FWIW, PEAR is already moving to GitHub. So who dictated that There should at least be a little consistency in PHP and this is just another example of everybody just doing what they want and sod the rest of us :( -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=**contacthttp://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/**index.phphttp://www.firebirdsql.org/index.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] Choosing a distributed version control system for PHP (or not). Call for Participation.
Hi, very glad this topic has resurfaced and I honesly think using a DVCS will be a game-changer for PHP. Just wanted to drop a couple of answers I've dedicated some time in at SE, several diagrams, to-point explanations and references that might be of uso to clear out introductory topics. http://programmers.stackexchange.com/questions/35074/im-a-subversion-geek-why-i-should-consider-or-not-consider-mercurial-or-git-or/35080#35080 http://programmers.stackexchange.com/questions/77475/how-to-choose-between-git-and-mercurial/77663#77663 http://programmers.stackexchange.com/questions/31558/version-control-for-small-team/31564#31564 In brief: either git or mercurial will be a great option, but if the majority of the dev-base has less experience with DVCS, there might be more frustration if you get introduced to DVCS with git than with mercurial, same goes for potential collaborators, so mercurial —IMHO— does lower the barrier of entry. Lots of people choose git over mercurial over github, but bitbucket is improving more frequently under Atlassian's watch. Since the project is big enough, git might be a better choice to accommodate PHP's most complex code workflows —which I'm totally unfamiliar with—. Mercurial, OTOH, has less power tools to play with than with wgit, but unless you really really need them, my take on this is: go with mercurial and lower the collaboration barrier as much as you can. Best regards, David On Mon, Aug 8, 2011 at 8:01 PM, David Muir davidkm...@gmail.com wrote: On 09/08/11 01:07, Lester Caine wrote: David Muir wrote: John Szakmeister, who is a Subversion developer himself, has a good comparison of svn, hg, bzr and git: http://www.szakmeister.net/blog/2011/feb/17/choosing-new-version-control-system/ Long story short, his company went with git. Makes good reading ... many other comparisons are now getting long in the tooth, and so don't cover the current playing field. Still it looks like 'best of a bad job' rather than 'this wins hands down' and does make a fair comparison of all the current problems, but I think the fact that he has not investigated submodules may actually negate their final results :( This was the main area that I needed to work well, but is still work in progress everywhere? He did mention submodules as a Pro for git, but you're right, he didn't compare it with Hg's subrepos and subhg and Bzr's nested trees, bzr-externals and scmproj. I have a feeling that git's native support for it is much more mature than the others. That said, it's not a feature I've looked into myself as it's not something I've actually needed. Cheers, David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] An implementation of a short syntax for closures
Hi, I've always thought that just supressing the function keyword could work as a shorthand, i.e. having ([param1 [, param2 [, ...]]]){...}. Somewhat similar to Ruby's lambda shorthand: http://slideshow.rubyforge.org/ruby19.html#40 Regards, David On Thu, Aug 4, 2011 at 2:23 AM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 08/04/2011 12:08 AM, Lazare Inepologlou wrote: $add = | $x |= | $y : $x |= $x+$y; This does not seem to match the syntax of any language I know of so people are going to have a hard time figuring out what this does. It's not even clear that |= is a new operator there due to the dangling |, which as you say conflicts with the regular | operator. Plus it is only useful in one limited type of trivial closure usage. In PHP we try really hard not to invent new unfamiliar syntax. We try to stick with things that have some basis in either the existing syntax or in other popular languages that the average PHP developer might be exposed to. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] An implementation of a short syntax for closures
On Thu, Aug 4, 2011 at 1:47 PM, Gwynne Raskind gwy...@darkrainfall.orgwrote: On Thu, Aug 4, 2011 at 09:12, Antony Dovgal t...@daylessday.org wrote: Btw, am I the only one to whom the proposed syntax seems kinda hieroglyphic? No. I don't see at all why we need this, just like I don't see why we needed an alternative (short) syntax for arrays. This kind of syntax additions that add *no* functionality, should not be in PHP. Yes, I believe we should stop this stream of alternative syntax proposals and concentrate on fixing existing functionality instead of adding less readable ways to do the same thing. I would really like to keep PHP code easily readable, not to turn it into perl-ish write-only gibberish. 100% agreed, both about the cryptic nature of the proposed syntax and the need to focus on fixing existing issues. Strong -1 on a new syntax. Aye, just realized watching the |= reminded me of perl... say, I think that is what an aneurysm feels like.
Re: [PHP-DEV] Can't vote yet, as RFC has options (Was: Re: [PHP-DEV] [VOTE] release process RFC)
On Mon, Jun 20, 2011 at 8:30 AM, Derick Rethans der...@php.net wrote: I am not generally against this RFC, but this point needs to be discussed first IMO. As having 5 active branches at the same time for the multiple major releases option is *not* workable. If its because of the constant merges, it would be workable if a DVCS was being used =) Regards, David
Re: [PHP-DEV] Give the Language a Rest motion (fwd)
On Thu, Jun 16, 2011 at 12:14 AM, Pascal COURTOIS pascal.court...@nouvo.com wrote: Le 16/06/2011 04:36, dukeofgaming a écrit : Hi, I think that —in any context— the if it aint broke don't fix it is a very depressing attitude to have, and a very wrong one in any open source community. What I feel depressing is the urge of the PHP core team to fix working features instead of focusing on the 1800 open bug tickets. Sorry if the question is dumb, but, how many core developers does PHP have?, how many in total (including non-core contributors)?. Regards, David
Re: [PHP-DEV] Give the Language a Rest motion (fwd)
On Thu, Jun 16, 2011 at 1:12 AM, Pascal COURTOIS pascal.court...@nouvo.comwrote: Le 16/06/2011 08:01, dukeofgaming a écrit : Sorry if the question is dumb, but, how many core developers does PHP have?, how many in total (including non-core contributors)?. That's not the point. Whatever the project is, every developer should fix existing bugs before even thinking about improving. That's the way I do and that's why there is no bug I'm aware in my programs. I really mean the question, regardless.
Re: [PHP-DEV] Give the Language a Rest motion (fwd)
Hi, I think that —in any context— the if it aint broke don't fix it is a very depressing attitude to have, and a very wrong one in any open source community. If the signal to noise ratio is the problem, I think its better to focus on that problem, not shutting down the signal. If PHP is a resource crunched project, I think its better to focus on that problem, not rejecting feature requests. (I might appear as impertinent with what I'm going to say, but bear with me, I'm being well-intentioned and mean no offense; just want to be honest). Regarding the signal to noise ratio, I have one question: how did traits get accepted?, having seen the kind of conversations in the lists it makes almost no sense to me how something so radical and complex could make its way to PHP so quickly and a simple and convenient thing like a short array syntax cannot, and something so basic as annotations raises so much pointless (just not to say ignorant) debate. Was it the to-the-point RFC and solid patch?, was it that the conversations were just on another level so not anyone could just say —or troll— traits are no solution! *spit*, lets do aspects instead!. I know it took some time, but while lurking the lists IIRC I never saw any opposition to traits... could anyone tell me what was the magic behind this?, could it be repeated?. Regarding resources, I think this is one of the main things rendering the community unhealthy (at least it feels like that to me) and I even feel bitterness in the air. I think that the definite solution to this is a DVCS like git and hosting the code at github, or like mercurial and hosting the code at bitbucket, please don't be angered at this suggestion (as I know the switch to SVN is a fairly recent one), you can ask around SVN geeks that went the distributed way and they will tell you things, wonderful things of how they don't know how could they could endure that much with that in their project, and if its an open source one, how much the switch has done in favor of contributions. Regardless of everything, I like that the PHP community has so much passion and energy, sometimes in a not constructive way, but that is a good problem to have in my opinion, really, don't take it for granted, it just needs a little direction. Best regards, David Vega On Wed, Jun 15, 2011 at 8:46 PM, Andi Gutmans a...@zend.com wrote: -Original Message- From: Pierre Joye [mailto:pierre@gmail.com] Sent: Wednesday, June 15, 2011 2:33 AM To: Andi Gutmans Cc: Derick Rethans; PHP Developers Mailing List Subject: Re: [PHP-DEV] Give the Language a Rest motion (fwd) On Wed, Jun 15, 2011 at 7:02 AM, Andi Gutmans a...@zend.com wrote: Hence my suggestion to bundle MongoDB extension and possibly work on additional extensions. Some of my suggestions probably rightfully didn't get much interest such as Thrift. See my comment in your other thread and below. Maybe we should consider making a list of extensions we think could be beneficial and the new mentorship program can actually help deliver some of them? I do not thnk it is a good thing to begin a discussion about this exact topic and then totally ignore it. I think it got lost in the very long and varying discussions. Will dig up and take a look. I had a couple of hectic weeks. I also think that it is somehow wrong to post something asking to do not propose new things when we finally have more people involved in proposals and discussions. Maybe that's just me me but I do think that the main problem we have (besides the ones we identified and try to fix right now) is the complete lack of open discussions about possible new features, in this list with new or existing contributors. I did not say we should not propose or have discussions (I am in favor of adding [] for arrays for example). But I am saying the bias should be not to include new language functionality unless it has very broad appeal serious upside impact. The bias should be against feature creep. Andi -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [IDEA/PRE-RFC] PHP Core Mentorship Program
Hi David, That would be awesome. I do want to contribute but haven't got time to get to know all PHP's quirks. I have some knowledge of compiler theory and low level C/C++ (memory management, system programming). Some stuff I had in mind to try implementing: - The object(...) language construct. - Constructor dereferentiation (i.e. new Foo()-bar()). But it would be nice to have some previous reference/insight/guidance of where and how to do it. I like the idea of a separate mailing list and I think the general idea would be a very healthy boost for the PHP internals community. I also think that it would be a god idea to build a knowledge base in the wiki and perhaps feed the PHP Internals part. Best regards, David Vega On Fri, Jun 10, 2011 at 11:39 AM, David Coallier dav...@php.net wrote: Hey all, Let me start by saying that this is merely an idea I'm trying to put together and before doing so, I need to see who would be interested. A short while ago, the Python community created something called The Python Core Mentorship Program [1][2] which is essentially an attempt to lower the barrier of entry to the Python core for new developers, students, etc. and connect everyone together in a more cohesive manner where people actually talk and interact. I strongly believe in such initiative and believe this is something we should also think about. Simply put, I'd love to put something together for the PHP core/internals where the goals of the program would be, not unlike the Python project, to get a few internals (Zend Contribs (Stas are you reading this? :P), Core contribs, PECL extensions developers, documentation maintainers) to be willing to help newcomers and provide a more comprehensive understanding of the contribution processes, internal trickeries, optimisations, etc. The general idea is to create a channel between the rest of the world and the internals of PHP where more experienced developers can transfer their knowledge and get a fresh perspectives from new developers that haven't approached the core before. Before continuing further into exploring this idea, we need to get volunteer mentors. The mentee process is likely to get a self-managed one and the mentors' role will hopefully be rather low in terms of time consumptions and the roles of the mentor will most likely be: - Introducing new developers to the processes - Answering questions - Helping with code review of patches Again, like the Python program and similarly to the GSOC projects, we should have a mailing list (restricted) dedicated only to the mentor (php-mentorship?) where anyone can ask the simpler questions. From this mailing list we should also be able to construct a solid baseline for new developers contributing to PHP. From the mailing list, we'll see what questions are coming over and over again we'll be able to build a wiki-faq-like sections for new contributors. I digress and here's what I'm hoping to achieve with this email: I want to get a few contributors from various aspects of the core including docs and pecl extensions willing to help new people. If you are interested, please raise your voice and if enough interest is displayed I'll get a proper wiki section started. Furthermore, one thing I am hoping this program will help bring is not only a stronger interest in the core and a fresh injection of talent but more importantly I hope we'll be able to contributors from our various communities that are scattered across the internet that barely ever interact with the internals. Hoping this email reaches as many of you and that my message is properly conveyed :-) P.S. This is really an attempt to find volunteers. If you are interested please feel free to contact me directly if you prefer so we can start organising whatever would have to be done: dav...@php.net References: [1]: http://pythonmentors.com/ [2]: http://jessenoller.com/2011/03/25/just-proposed-python-core-mentorship-program/ -- David Coallier Orchestra.io -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Callable type
+1 for callable, it is really more consistent. On Tue, Jun 7, 2011 at 3:44 PM, Matthew Weier O'Phinney weierophin...@php.net wrote: On 2011-06-07, David Zülke david.zue...@bitextender.com wrote: On 07.06.2011, at 22:31, Stas Malyshev wrote: Hi! callback is callable, the opposite could not be true. a string --or a closure-- is callable, but the string is not a callback According to our docs, which were out there for years, it is. One of the main and widespread complaints about PHP is the lack of any system in naming, design and documentation, it is sad to see how many people want to make it worse instead of making it better +1. I'm thinking it should be callback, or the docs should be adjusted. callable arguably does make more sense, but either way, it needs to be consistent, that's what matters most. Agreed, here. callback is the usage throughout the documentation to refer to anything that passes is_callable(). -- Matthew Weier O'Phinney Project Lead| matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Callable type
On Tue, Jun 7, 2011 at 4:41 PM, Matthew Weier O'Phinney weierophin...@php.net wrote: On 2011-06-07, dukeofgaming dukeofgam...@gmail.com wrote: --0016e68ee3e4bc4b0e04a525bac6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable +1 for callable, it is really more consistent. I was actually agreeing With David and Stas that callback was more consistent, and casting my vote for that. Oh. But then, shouldn't is_callable be deprecated for a more consistently named is_callback? Regards, David
Re: [PHP-DEV] JSON array/object syntax
On Mon, Jun 6, 2011 at 1:41 AM, Lester Caine les...@lsces.co.uk wrote: dukeofgaming wrote: Ok, I found that Ruby added support for a new JSONy syntax a little while ago, this is interesting: http://webonrails.com/2009/02/06/ruby-191-hash/ But it doesn't have anything to do with JSON interoperability. I'd rather no have to learn ruby either, but a scan of that document would seem to indicate that THEIR problem that was fixed was one of the way things were incorrectly ordered after using 'associate'. I'm seeing '=' as the 'associate' which makes perfect sense there, when they use ':' to indicate variables. Add the warnings that This only works if the key is a symbol. and one sees the sort of confusing mess that hopefully we are trying to avoid in PHP. I'm just trying to point out that the ubiquity of the general syntax looks like a good thing. Also, that JSON has nothing to do with the syntax because the syntax makes sense by itself since it has proved to be expressive enough to become respected in various communities. But the JSONy argument should be dropped asap if this proposal is to be taken seriously. I'm not saying PHP should copy Ruby's rules, please don't imply that. Regards, David
Re: [PHP-DEV] Object and Array Literals
On Mon, Jun 6, 2011 at 8:48 AM, Sean Coates s...@seancoates.com wrote: I was careful in the RFC to indicate that this is *not* JSON, but if others feel as strongly as you do about the use of this term, I think it can be removed without hurting the idea (as you indicated). Still, it is mentioned so many times that it could be unintentionally misleading IMHO. You're right that the RFC does not declare a syntax that will always validate as JSON, nor does it respect serialization rules, but I see it more as a declaration syntax than a serialization format, as it is proposed. The real goal is to improve interaction with third parties, which I think the proposed syntax would allow. That said, other than the \u syntax, I believe that the proposed declaration syntax would still allow JSON from a third party to me interpreted by PHP, in a way that makes sense in PHP. Can you provide an use case and code example of how that would look? Somewhat on a side note, I do not understand the statement that using a strict syntax would not conform with the PHP way or at least how it relates to this RFC. This is directly related to the JSON-non-strictness that everyone seems to want (me included). For example the following is completely invalid in JSON, but normally OK (for small values of OK) in PHP: (not-)JSON: {foo: 1} (not-)JSON: {'foo': 1} PHP: array(foo = 1) PHP: array('foo' = 1) (For anyone who doesn't follow, correct way in JSON is to use not '.) Thanks for the comments. As mentioned earlier, I think the resemblance to JSON is just a happy coincidence, the syntax makes enough sense by itself. You can argument that its familiarity/friendliness/ubiquity makes it a good option, but in its current state (i.e. not defining why JSON compatibility is justified) I'd say it is not complete. Regards, David
Re: [PHP-DEV] Re: Voting Process (was: [PHP-DEV] Re: Voting does not belong on the wiki! (Was: [PHP-DEV] 5.4 moving forward))
On Sun, Jun 5, 2011 at 5:20 PM, Pierre Joye pierre@gmail.com wrote: I'd to go with a 60% for language syntax, 50+1 for new exts or sapis. Other question is who can vote. For one, I like to have external people being able to vote, like frameworks/apps lead developers as well as @php.net in general (docs people at the same level than core devs, no diff). I have a little proposition here. I'm not —at least currently— known for any app or framework, but I'd like my voice to count, that is, if and only if the rest of the community thinks I make sane arguments that are worth considering. I'm perfectly aware that the fame one could gain from taking production code to visible success should be an indicator of an educated opinion, however, I think this might lead to a closed group who can vote, and I like the openness of this community, even if the general process is chaotic, it still gets the warm and fuzzy feeling of an open source community. OTOH, if a completely open group's votes were all considered, the final decision could just end up being a matter of numbers outnumbering other numbers. If I get it right, this is the current problem. So my proposal is that the voting privilege could be given on the basis of a *web of trust*, and if I'm not mistaken this is a little like what the concept of karma works here (I'm fairly new here). Not sure if there should be a voting to elect voters or if it could/should be something more lax, but I don't think the requirement to vote should be fame. Best regards, David
Re: [PHP-DEV] Bundling modern extensions
How about the Yaml extension?, it looks well maintained enough: http://pecl.php.net/package/yaml Regards, David On Sun, Jun 5, 2011 at 2:33 AM, Hannes Magnusson hannes.magnus...@gmail.com wrote: On Sun, Jun 5, 2011 at 01:00, Andi Gutmans a...@zend.com wrote: In parallel I'd also see if there are any key extensions which we think are mainstream, stable and well maintained enough to be included. For example, http comes to mind. People have been afraid of suggesting new exts to core due to the policy of moving stuff from core to pecl, rather then vice verca, which has failed miserably. The only people who don't like our *bang* you have all you may possibly want approach are the python lovers. Gearman and memcache(d) are definitely something we should be bundling too. ZMQ is also imo a good candidate. -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] JSON array/object syntax
Ok, I found that Ruby added support for a new JSONy syntax a little while ago, this is interesting: http://www.strictlyuntyped.com/2010/12/new-ruby-19-hash-syntax.html http://webonrails.com/2009/02/06/ruby-191-hash/ But it doesn't have anything to do with JSON interoperability. On Sat, Jun 4, 2011 at 11:32 AM, Anthony Ferrara ircmax...@gmail.comwrote: One advantage would be familiarity. New developers only need to worry about 1 syntax, rather than a new one for each language. I'm not saying if it's worth it or not, but there is something to be said for consistency and using already established patterns and syntaxes if it makes sense (aka: there is no compelling reason not to). So far I haven't seen any compelling reason not to do it. Not saying they aren't there, nor that there aren't justifiable reasons in the threads. Just that I don't find any of the reasons against it compelling enough to say it doesn't make sense to use a json-style syntax. Just my 0.02... On Sat, Jun 4, 2011 at 7:52 AM, David Zülke david.zue...@bitextender.com wrote: To clarify: I don't understand what the advantage would be, either. It seems that those demanding it somehow confuse or blur the lines between the declaration of data in the language and its representation in a serialization format. A few people in the thread demanded that it be a syntax that could also be consumed by all the JSON parsers out there, and I have no idea how that would be useful at all, since the construct per se isn't useful at all as PHP code and at least needs to be wrapped in ?php and ? tags, so you couldn't just evaluate it as JavaScript (which would be useless without assignment etc). I ignored that aspect as others covered it already (e.g. Pierre asking what the point was of this at all) and focused on the encoding issue that *would* occur if someone, somehow managed to find a useful way of taking advantage of such a notation (e.g. where it would be interchangeable with JS code or be evaluated as JSON by other JSON parsers) - namely the problem that you could produce *PHP code*, that, with some mingling and stripping, *PHP's own json_decode() could not process*. Perhaps I should have made that more clear, sorry. David On 04.06.2011, at 03:17, dukeofgaming wrote: Hi, After reading all the debate in the other thread it is still not clear to me what the real advantages are of adopting JSON syntax for native PHP types. Doing json_encode to an object and expect the code and output to be the same seems useless to me, and reading David Zülke's example it seems more like a pure-unicode issue to me: It is different from writing json_decode('ä\u0123'), because json_decode() in PHP only accepts UTF-8 encoded input; Give it a shot: ?php $chr = \xC3\xA4; // ä as UTF-8 var_dump(json_decode('[' . $chr . '\u00e4]')); var_dump(json_decode('[' . utf8_decode($chr) . '\u00e4]')); ? That'll produce: array(1) { [0]= string(4) ää } NULL Understand what the problem is now? If someone does this in a latin1-encoded file: ?php $fancyNewArray = {yay: ä}; ? Then that is valid as a PHP array (as it's a latin1 ä, so \xE4), but cannot be consumed by PHP's json_decode(). And that would be terribly inconsistent behavior. - It looks more like you want to do json_decode to PHP code hoping that will somehow fix json_decode... instead of fixing json_decode. Could someone advocating this please explain with use-cases and concrete punctualized examples the advantages of having such JSON approach to PHP. Regards, David Vega
Re: [PHP-DEV] Object and Array Literals
I like the idea of supporting both = and :. Would this work?: $foo = { 'bar' : function(){ echo 'baz'; } }; $foo-bar(); And I'm guessing this shouldn't work: $array = array('foo' : 'bar'); Regards, David On Sun, Jun 5, 2011 at 4:11 PM, Chris Stockton chrisstockto...@gmail.comwrote: Hello, On Sun, Jun 5, 2011 at 2:03 PM, Jordi Boggiano j.boggi...@seld.be wrote: Thanks for working on this. On Sun, Jun 5, 2011 at 3:30 AM, Sean Coates s...@seancoates.com wrote: Please read, and if you have a comment that is not already covered in the RFC, raise it here. I'm definitely open to discussion, but I would really love to keep this discussion civil. TBH, I dropped half-way through the original topic, so I'm sorry if I missed something, but why don't we just treat {foo:bar} as an array? json_decode() can do it, and it makes complete sense since PHP arrays are hashes too. I don't see much benefit to having this create an object by default, especially since even if you use that notation to send data to a JSON API, json_encode'ing a hash will create an object. It's the only pain point I really have, that I can't use true json-syntax without ending up with this messy pile of objects/arrays mixed together. If we do this, IMO the hashes should not be able to be defined with [], but that'll probably upset people, so I don't really care if it is possible. • Strictness of unquoted keys. This is just legacy crap honestly, if we make up new syntax, we shouldn't include the old mess in it. I think everyone is quoting their strings by now.. • Support = in addition to : as a key:value separator. Same as my point on [] above, I think adopting the JSON notation should be done fully, keeping this stuff in might be ok to make people happy, but it does not make much sense. • possibility of simply not supporting the \u### syntax for Unicode characters in literal strings (just like the rest of PHP). This is still PHP strings, they should behave as such. Sounds good to me. • Should mixed-format (numeric and associative arrays) be allowed? (e.g. [1,'two':2, 3]) Assuming we keep [] to arrays and {} to hashes as I said above, I'd say no. In the rare cases that it is useful you can still use array() if you really feel this is necessary.. I'm sure many people will disagree with this, and I don't really mind how it ends up syntactically speaking, but please really consider dropping the stdClass part, that'd really suck :/ Cheers I think there is a clear benefit to allow {} as well as [] being StdClass and array respectively. However, I understand your point as well as the point of others when they speak of the usefulness of StdClass, really this tells me perhaps we should look at adding some basic enhancements to StdClass (I.E. some methods for example), or perhaps a new class for default object creation. At the very least maybe a way to specify the default class. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Object and Array Literals
On Sun, Jun 5, 2011 at 6:06 PM, Sanford Whiteman sa...@cypressintegrated.com wrote: -- I do not feel that the acronym JSON has any clarifying nor edifying place in the RFC describing this syntax. Rather, I would suggest one of the following: · JavaScript-like [object|array] literal syntax · bare-bracket [object|array] literal syntax · short [object|array] literal syntax · compact [object|array] ... · quick [object|array] ... · colon-pair [object|array] ... I have actually been excited about the discussion of this feature area and anticipate my eventual +1 if JSON could be removed from the RFC. Even though the term doesn't affect the way the feature works, by upvoting the RFC one is approving of wording that may make it to the general public, and I think this would be bad for PHP. It might also be noted (h/t David Vega) that Ruby adopted a syntax similar to that proposed here and completely avoided using the term JSON in final documentation, as I hope will be done with PHP even if this RFC continues to use the term. Bravo for ponting that out, your argument has cleared my mind a little while trying to understand this side (I'm actually against the JSON interoperability argument [because it does not make sense to me], but not the syntax). After reading this new RFC and pondering about the JSONy implications, the multi-part conclusion that I reached is that: a) JSON is actually being mentioned to advocate for the syntax with for the sake of *familiarity*. b) Interoperability is being confused with familiarity. c) Actual interoperability of the syntax with JSON is just a happy coincidence (same as with Ruby) d) In no context this notation could function as JSON and PHP at the same time, mainly because PHP requires tags e) There is a strong resistance to change, I bet the detractors of this short syntax (even with the :) would change their opinion after using it, just the way some of us used to hate the idea of namespaces with \ and after using it changed our opinion (specially with the autoloading standard that actually reflects file structure, e.g. in Symfony2). f) If JSON ceased to exist in this very moment, supporters of the syntax would be still supporting it and perhaps detractors would accept it. The effect of mentioning JSON, and implying direct compatibility with JSON technologies and JSON itself is just adding FUD. +1 to removing references to JSON from the RFC, because [ ], { } and : make enough sense by themselves. Regards, David Vega
Re: [PHP-DEV] Voting does not belong on the wiki! (Was: [PHP-DEV] 5.4 moving forward)
How about a separate email topic dedicated to voting?, that would reduce the signal to noise ratio for votes (and increase it for opinions). Regards, David On Fri, Jun 3, 2011 at 10:25 AM, Martin Scotta martinsco...@gmail.comwrote: Martin Scotta On Fri, Jun 3, 2011 at 5:16 AM, Pierre Joye pierre@gmail.com wrote: hi Derick, On Fri, Jun 3, 2011 at 9:45 AM, Derick Rethans der...@php.net wrote: On Thu, 2 Jun 2011, Stas Malyshev wrote: I'd like to set up a vote for the undecided TODO features on wiki.php.net, anybody could help me with setting up the voting module there if there's such thing on the wiki? Or set me up with the access to wiki machine and I'll install it :) Voting on the wiki? Yuck. If you want participation, do it here on the mailinglist and store the record in the wiki. If all votes are showing up just in the wiki then there is no exposure on the list and things are easy to miss (especially with the huge amount of noise that's already on the list). Please re consider your opinion like noises on the list and other similar statements, thanks. As of the votes in the wiki, it is perfectly fine and valid, easy to manage and open. Much more easier than counting random votes in the ML, especially when discussions are split in many threads. The discussions and related activities do happen on the list and that's a good thing. Yes, but only who has wiki karma are allowed to vote. -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] JSON array/object syntax
Hi, After reading all the debate in the other thread it is still not clear to me what the real advantages are of adopting JSON syntax for native PHP types. Doing json_encode to an object and expect the code and output to be the same seems useless to me, and reading David Zülke's example it seems more like a pure-unicode issue to me: It is different from writing json_decode('ä\u0123'), because json_decode() in PHP only accepts UTF-8 encoded input; Give it a shot: ?php $chr = \xC3\xA4; // ä as UTF-8 var_dump(json_decode('[' . $chr . '\u00e4]')); var_dump(json_decode('[' . utf8_decode($chr) . '\u00e4]')); ? That'll produce: array(1) { [0]= string(4) ää } NULL Understand what the problem is now? If someone does this in a latin1-encoded file: ?php $fancyNewArray = {yay: ä}; ? Then that is valid as a PHP array (as it's a latin1 ä, so \xE4), but cannot be consumed by PHP's json_decode(). And that would be terribly inconsistent behavior. - It looks more like you want to do json_decode to PHP code hoping that will somehow fix json_decode... instead of fixing json_decode. Could someone advocating this please explain with use-cases and concrete punctualized examples the advantages of having such JSON approach to PHP. Regards, David Vega
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
State the case for JSON in a separate RFC and progress will be made, but I think there is a fundamental mistake here: serialization formats are the *means* for interoperability, not the ends. The only way I see JSONy syntax would help is if PHP code —with JSONy syntax— would be parsed by a JSON parser, and I don't think that is likely to happen... if you want PHP to have a data structure behave like JSON that is another story. Add use cases, syntax descriptions, and perhaps a patch for this JSON RFC and the main argument will be better understood; an RFC will help, visceral statements and personal attacks, on the other hand, won't, so I bet your time —and everybody else's— will be better spent in writing an RFC to defend it. Regards, David On Thu, Jun 2, 2011 at 4:22 PM, Pierre Joye pierre@gmail.com wrote: On Thu, Jun 2, 2011 at 10:19 PM, Sean Coates s...@seancoates.com wrote: If people vote on this now, will further discussion about how this SHOULD work be shut down with we already voted on this? which other discussions do you wish? Json is clearly not an option and not enough people (but a couple) likes or wants it. The RFC is about short array syntax and as far as I can see there is already a clear consensus for one of the proposed new syntax. I don't see why JSON (or JSON-like, or JavaScript Object Literal, or whatever the least politically-fired term of the moment) syntax is clearly not an option. I'm considering writing a new RFC that calls for first-class JSONishy syntax, but I have better things to do if it's already dead in the water. As much as I'd like to avoid drawing out this discussion, I think a premature vote that will be used as a political wedge to shut down all future syntaxes that don't use T_ARRAY is not in the best interest of PHP. You can still vote -1 on this RFC and try to block it. That's the purpose of the votes. But arguing endlessly why json-like syntax is better without an alternative RFC and patch won't bring you anywhere. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Wiki editing privileges
Hi, I remember having wiki editing privileges not so long ago, I was going to enter and add the entry for discussions at https://wiki.php.net/rfc/shortsyntaxforarrays but I cannot edit anymore. Would it be too much to ask to have them enabled?. Best regards, David Vega
Re: [PHP-DEV] DVCS
Hi, I thought it might be interesting for all to read some feedback I got from some questions I made to the Joomla community, specifically, the guys and gals that have been implementing the decoupling of the Joomla framework: the Joomla Platform. They currently still use svn officially but they have been experimenting with both mercurial and git. These are their responses so far: http://groups.google.com/group/joomla-dev-framework/browse_thread/thread/fd3b0151cc215c0e It may bring some insight to what a DVCS could do for the PHP community. Best regards, David On Thu, Apr 28, 2011 at 2:28 AM, Lester Caine les...@lsces.co.uk wrote: dukeofgaming wrote: http://programmers.stackexchange.com/questions/35074/im-a-subversion-geek-why-i-should-consider-or-not-consider-mercurial-or-git-or/35080#35080 So, I don't want to make debate here of wether centralized is better than distributed (because the point is moot), but I think its not a good situation for the community to have a previously open door to DVCSs now closed. Having been battling with various projects that have decided that 'git is good' or 'hg is best' ... I've been trying to live in the new world and failing. That link is looking like a nice CURRENT overview of the situation although things are still changing mainly for the good. My problem until recently was that 'subrepo' management in DVCS has always been playing catchup. Yesterday for the first time I checked out a 'super-project' matching one of the composite builds provided on an original CVS repo! Still not fully integrated into Eclipse, but hopefully even that will come with time. But now I can 'clone' the half dozen different builds and manage them in parallel with both github and bitbucket 'masters'. I'm using Mercurial and TortoiseHg which almost work transparently between Linux and Windows, and with hg-git access to the 'git is good' projects is also transparent even on windows. Next step this weekend IS to tidy up the SVN setup so that I have the PHP code locally mirrored as well -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Wiki editing privileges
Thanks, I also don't think that was the case. Regards, David On Wed, Jun 1, 2011 at 1:26 AM, Philip Olson phi...@roshambo.org wrote: On May 31, 2011, at 11:05 PM, dukeofgaming wrote: Hi, I remember having wiki editing privileges not so long ago, I was going to enter and add the entry for discussions at https://wiki.php.net/rfc/shortsyntaxforarrays but I cannot edit anymore. Would it be too much to ask to have them enabled?. I don't think anyone [intentionally] took away wiki editing rights, but you now have full access to the rfc namespace. Regards, Philip
Re: [PHP-DEV] DVCS
Hi Lester, AFAIK both mercurial and git support sub-repositories nicely now: http://mercurial.selenic.com/wiki/Subrepository http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html Regarding the graphical tools, I don't use them that much, but I see your point. Personally, I just occasionally use the Netbeans integration because it is easier to commit files in separate directories, but that is pretty much it since I think the rest is easier and quicker to do with the console, but I guess it will always be a matter of personal preference. I've been working with hg subrepos and they are quite nice. I'm still not that familiar with git submodules. BTW, you don't need to use python to customize/extend mercurial's behavior, you can use hooks: http://mercurial.selenic.com/wiki/Hook Best regards, David On Wed, Jun 1, 2011 at 1:56 AM, Lester Caine les...@lsces.co.uk wrote: dukeofgaming wrote: I thought it might be interesting for all to read some feedback I got from some questions I made to the Joomla community, specifically, the guys and gals that have been implementing the decoupling of the Joomla framework: the Joomla Platform. They currently still use svn officially but they have been experimenting with both mercurial and git. These are their responses so far: http://groups.google.com/group/joomla-dev-framework/browse_thread/thread/fd3b0151cc215c0e It may bring some insight to what a DVCS could do for the PHP community. I think that there are perhaps still a couple of separate problems here which the DVCS community need to get behind for any of them to become a 'front runner'. The main problem here IS 'subrepo' which is a concept that neither HG or GIT handle particularly well, but to my mind is essential for a very much modular project like PHP! While I have sort of managed to put together a 'checkout' of a set of packages which together make a single build of the target project, I'm still having to pull and commit changes manually to each subrepo - I don't get the simple overview of outstanding changes that was SO nice to work with in CVS! To try and put this in a 'PHP' context ... I DID have a list of extensions I was working with, and a 'sync' in ECLIPSE gave me a nice list of which ones had had changes pushed ... I could then go and either simply update to those changes on an extension by extension basis - or review the changes in each file so allow me to integrate other peoples changes with my own local 'tweaks'. This is something that DVCS SHOULD be perfect for, but the management tools for bundling a selection of parts of a project are not there yet, mainly because the core developers on both HG and GIT don't see then need because they don't need that type of working! I'm limping along with HG at the moment simply because it works on both Linux AND Windows, while GIT's windows support is still rather hit and miss when one is already using other unix tools on windows, but I do not have the same level of integration in Eclipse that CVS and SVN provide beautify straight out of the box. At least I can drop out of Eclipse into TortoiseHg and do the code management, but it's not an ideal way of working. If I was a 'console jockey' then much of this would probably be a lot less of a problem. One seems to need to write scripts to do what YOU want to do in both HG and GIT - and then need to learn Python to do that in HG :( But I never used CVS from the command line so a LOT of the reasoning for even the switch to SVN was irrelevant since Eclipse had already solved all of those 'problems'. At the current time I think that PHP would need to restructure how it is packaged up to provide a single repo in both HG or GIT. Keeping SVN ( I'd still prefer CVS here it works BETTER as a master for DVCS! ) as the master from which we CAN currently sync using HG or GIT is the best of a bad job currently. Unless some knows better? -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Wiki editing privileges
Hmm, I can edit pages within the RFC namespace but I cannot edit https://wiki.php.net/rfc. Regards, David On Wed, Jun 1, 2011 at 1:38 AM, dukeofgaming dukeofgam...@gmail.com wrote: Thanks, I also don't think that was the case. Regards, David On Wed, Jun 1, 2011 at 1:26 AM, Philip Olson phi...@roshambo.org wrote: On May 31, 2011, at 11:05 PM, dukeofgaming wrote: Hi, I remember having wiki editing privileges not so long ago, I was going to enter and add the entry for discussions at https://wiki.php.net/rfc/shortsyntaxforarrays but I cannot edit anymore. Would it be too much to ask to have them enabled?. I don't think anyone [intentionally] took away wiki editing rights, but you now have full access to the rfc namespace. Regards, Philip
Re: [PHP-DEV] DVCS
On Wed, Jun 1, 2011 at 2:37 AM, Lester Caine les...@lsces.co.uk wrote: Drak wrote: At the current time I think that PHP would need to restructure how it is packaged up to provide a single repo in both HG or GIT. Keeping SVN ( I'd still prefer CVS here it works BETTER as a master for DVCS! ) as the master from which we CAN currently sync using HG or GIT is the best of a bad job currently. Unless some knows better I know what you mean. There are solutions like submodules in GIT but it does require some small restructuring usually. By the way, TortoiseGIT is now quite excellent for Windows GUI. A new version 1.7.0 is just about to be released too. I'm a bit biased against GIT but overall, GIT is getting way more traction than Hg and github.com http://github.com excels in features compared to anything else. When TortoiseGIT runs in Linux as well - they will have caught up! TortoiseHg works transparently in both and on Mac I believe. My customer base is mainly windows biased while I've been running on Linux here for some years now. I need both platforms to do the same thing - which Eclipse has provided for several years, but the DVCS camps still need to address. Windows GIT is something different from Linux GIT at the moment - which is probably all that is putting me off it. Actually when I was forced to used GIT the windows side simply did not work at all, so I HAD to use hggit to get anything! From what I have seen also, IDE integration with GIT is starting to catchup both in NetBeans and Eclipse - and already way ahead of the pack is phpStorm for VCS integration, but it's not free. hggit + Mercurial Eclipse + Eclipse means I could not care less what the target is EXCEPT that one can't write a project that is JUST the set of sub-modules that you want to pull together. IDEALLY - both GIT and HG would just pull stuff from which ever is providing a particular library? So say Smarty could be on one while ADOdb is on the other ... The core PHP code does not need to be so distributed, but being able to pull PECL modules from a number of sources to add to a core clone of the code could be useful? Perhaps, it would depend how teams are structured, but even it was a single repository for everything I think stuff would work fine. My opinion is that the reason behind sub-repositories is to include code from vendors, not that much to modularize development of a single big project, why?, because of the distributed nature of a DVCS: imagine that there is a PECL team, and that team makes a fork of the main PHP repository, and they focus on that fork (every separate repository can be regarded as a fork) and they handle all their work integration, and then someone (after an ammount of work is done) pulls back from the main repo (the one where last integrations are agreed to be added, central if you must call it that) to ensure everything still runs ok, and then ask to the final integrator to pull and merge their work: done. Oh, and HG supports svn and git as subrepos now. Regards, David
Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)
After that argument, I think I'm against : now too. +1 to = Could { } be implemented for objects too then?. Regards, David On Wed, Jun 1, 2011 at 4:36 AM, Ford, Mike m.f...@leedsmet.ac.uk wrote: -Original Message- From: ekne...@gmail.com [mailto:ekne...@gmail.com] On Behalf Of Etienne Kneuss Sent: 01 June 2011 01:57 To: internals@lists.php.net Subject: Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux) +1 for a short array syntax. But only if you keep it consistent, PHP has always been using = for key/val association, I don't see any reason to suddenly provide key: val, unless what you want is to confuse people. Hear, hear and hear, hear to that! ['a': 'b'] just feels completely un-PHP-like, and I'd be totally against it. If the desire is to have a native JSON syntax so that you can eval() imported JSON, then I'm completely anti that, too -- that's a case where I'd far rather be explicit and use json_decode(). And since, no matter how you slice it, you're never going to get a complete fit between native PHP structures and JSON encoding, I don't believe you should even try. I just can't see the problem with saying: PHP arrays (and maybe objects?) look like *this*, and if you want to import/export them from/to a JSON representation, there are functions to do it like *this*. This seems to be the perfectly sensible approach of other languages I've used recently (although my perl is somewhat out-of-date, and my python even more out-of-daterer and minimal at that!). Even ECMAScript is going down the route of explicit conversion with JSON.parse() and JSON.stringify() in ECMAScript 5! All in all, still +1 for [1, 2=2, 'a'='b'], and -several million (for style) for any syntax involving colons. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507 City Campus, Portland Way, LEEDS, LS1 3HE, United Kingdom E: m.f...@leedsmet.ac.uk T: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
On Wed, Jun 1, 2011 at 12:19 PM, Pierre Joye pierre@gmail.com wrote: Reminder: Pls add your votes here: https://wiki.php.net/rfc/shortsyntaxforarrays/vote Who is allowed to vote?, are userland votes still going to count?, if so, how does one qualify as userland voter?. Best regards, David Vega
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
On Wed, Jun 1, 2011 at 2:38 PM, Philip Olson phi...@roshambo.org wrote: Reminder: Pls add your votes here: https://wiki.php.net/rfc/shortsyntaxforarrays/vote Who is allowed to vote?, are userland votes still going to count?, if so, how does one qualify as userland voter?. I think the one that is active can be a voter. Or maybe the ones that have any karma on php environment is considered a voter. I'm choosing to ignore this voting mechanism because it feels wrong. And besides, this RFC is outdated and still being reviewed for comments. In other words, nobody knows what they are voting on. Regards, Philip Yup, it feels rushed. The RFC should be cleaned up and I think this are the main items: - Ditch : - Ditch the JSON topic or open a separate RFC with it - Introduce the { } syntax for objects and change the title Regards, David
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
I still don't get it, the idea of making it look like json wont make it json, it will be PHP, and if you dare to write you jsony object/array with single quoted strings wont break the code even when its not JSON. I'll say it again: not even Javascript supports 100% valid JSON. I'll say it even more times: Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON JSON even has its own mime type. The idea of JSON as a first-class citizen is a fallacy IMHO. The concept itsel is not ugly, but for god's sake, lets put it in a separate RFC and lets decide con the actual RFC. Perhaps the JSON idea could benefit from autoboxing and a native class?: https://wiki.php.net/rfc/autoboxing JSON is a serializarion format, not a data structure, you coud write an associative array and if PHP knew the way, it could be autointerpreted as JSON, no need to make PHP code look like JSON. I think that the *BEHAVIOR* of arrays/objects as JSON and without the intervention of serialization functions should be in a separate RFC. There is really no point to make PHP *look* like JSON to handle JSON natively . This JSON matter and short array/object syntax are different issues just the way ?= and ? were. Could someone get Douglas Crockford in here?, rofl. Regards, David
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
Hi, I'm glad the topic has been picked up again, but I think there is an inconsistency in the proposal now that we are talking about being JSON-ish: JSON describes objects, not arrays. Then, what if [] were used for arrays and {} for objects?, so that: [1,2,3] //array(0=1, 1=2, 2=3) ['one':1, 'two':2, 'three' : 3] // array('one'=1, 'two'=2, 'three' = 3) ['one':1, 'two':2, 'three' : 3] // (object)array('one'=1, 'two'=2, 'three' = 3) Regards, David On Tue, May 31, 2011 at 4:25 PM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! Stas, I didn't understand your point about eval() and security. What did you mean? I meant if PHP has JSON syntax as native, e.g. you can say something like: $a = {a:b}; Then the temptation would be to write something like: // $json_string is {a:b} $a = eval($json_string); just as Javascript programmers sometimes do. That would have the same security implications as it has in Javasctipt - somebody could inject executable code there, etc. Of course, nobody forces you to do this, but the temptation would be there. Also, with full JSON support it is not entirely clear to me what {a: b} would mean - is it an array or an object? In JS, it's definitely an object, but in PHP objects are almost never used to store pure state without behavior, because we have hashtable arrays, while JS only has vector arrays. So here we have some unclear point (which does not happen with [] syntax, since with [] it's obvious we're talking about arrays, just as in many other languages). -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
On Tue, May 31, 2011 at 4:36 PM, dukeofgaming dukeofgam...@gmail.comwrote: Hi, I'm glad the topic has been picked up again, but I think there is an inconsistency in the proposal now that we are talking about being JSON-ish: JSON describes objects, not arrays. Then, what if [] were used for arrays and {} for objects?, so that: [1,2,3] //array(0=1, 1=2, 2=3) ['one':1, 'two':2, 'three' : 3] // array('one'=1, 'two'=2, 'three' = 3) ['one':1, 'two':2, 'three' : 3] // (object)array('one'=1, 'two'=2, 'three' = 3) Err, I meant: {'one':1, 'two':2, 'three' : 3} // (object)array('one'=1, 'two'=2, 'three' = 3)
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
Guys, as I said earlier, not even javascript (from javascript object notation, as in JSON) is 100% interoperable with JSON because single quotes are valid in javascript and not in json. I say : is way more cleaner than = and it is a good opportunity to adopt it.
Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)
On Tue, May 31, 2011 at 7:29 PM, Dan Birken bir...@gmail.com wrote: +1 To be honest, ['a': 'b'] or ['a' = 'b'] is so much better than array('a' = 'b') for general use I don't even care which one is picked, as long as one of them is picked. -Dan +1 to that too. Even when I've never liked that much = and would love to see : make an entrance instead . I'm afraid that if : is associated with the JSON interop argument and the later is discarded then : will be discarded too, much like what happened with the echo shortcut (?=) and the short tags (?). Perhaps the idea of JSON interop could be taken to another RFC and get less noise and better ideas as a separate topic. Regards, David
Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)
On Tue, May 31, 2011 at 9:27 PM, Rasmus ras...@lerdorf.com wrote: On 05/31/2011 05:42 PM, dukeofgaming wrote: I'm afraid that if : is associated with the JSON interop argument and the later is discarded then : will be discarded too, much like what happened with the echo shortcut (?=) and the short tags (?). Perhaps the idea of JSON interop could be taken to another RFC and get less noise and better ideas as a separate topic. ?= has been decoupled from short tags in 5.4 and is always available. -Rasmus Yep, I know, and thank you very much for that (I did see your commit a couple of hours after you posted it). I think there was a lot of confusion and fear (myself included) when ? were deprecated, e.g. the Kohana project used to have them and recommend them too, but they removed the practice later and stopped recommending them. Anyhow, I think : vs = is the only thing left to decide on this proposal. I was thinking that if : was to be introduced, perhaps array('a':'A',...) should also be added for consistency, and that is extra work. In my opinion adopting : would be nice, but it would also be noise for the developer community, perhaps good noise but noise nonetheless. The healthy thing to do here IMHO, would be putting introduction of : as a separate RFC, perhaps part of a JSON interoperability RFC, but as Adam just replied, PHP is not JSON and = is a very fundamental thing to change, so I have mixed feelings about this. Also, can we agree on the topic of introducing { } for objects to the proposal?. Best regards, David
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
Also, take a peak at this: http://www.phpsadness.com/sad/45 And compare it with this: http://perldoc.perl.org/perldsc.html#Declaration-of-a-HASH-OF-COMPLEX-RECORDS Regards, David Vega On Wed, Jun 1, 2011 at 12:15 AM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! I agree, it would be a break a lot of code. But I'd rather see some fundamental changes at that level (call it PHP 6, make it not BC with PHP 5.x or earlier), and remove the cruft and standardize on some of the slop. Fundamental changes means throw out your production code and start developing a new one. Guess how many PHP shops with existing code would be happy to do it. It's nice to rant about how PHP function are inconsistent and stuff, but no project was seriously impeded by it ever. At most it is mildly irritating. Huge BC break, on the other hand, would mean all major apps/libraries/frameworks become instantly not available, and who knows when they catch up. At this point, you might as well have a new language. Shorter array syntax seems like an unnecessary addon, will create more Since many experienced people are supporting it, I'd think that while it seems unnecessary to you, it may seem otherwise for them. I would help with the Unicode project if I could. I am not sure why it was so tough, but I imagine people infinitely smarter than I am were Read this (esp. first answer): http://stackoverflow.com/q/6162484/214196 It's about Perl, but gives you an impression why it is so tough. Making JSON style arrays seems stupid to me. When I look at a PHP script I expect PHP syntax. Not stolen pieces from a bunch of other languages (yes, some of it is that way already, but let's not keep the trend going please?) Why not? If the pieces are good, stealing them is good. It's how progress happens - you steal good pieces and add couple of your own, and hope the result is good enough that somebody else would want to steal stuff from it :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)
On Wed, Jun 1, 2011 at 12:35 AM, Michael Shadle mike...@gmail.com wrote: I don't really want to stand on my soapbox any longer, as it's obvious where the crowd leans on this one, but I need to clarify a couple points a bit and feel obligated to reply to another. On Tue, May 31, 2011 at 10:15 PM, Stas Malyshev smalys...@sugarcrm.com wrote: Fundamental changes means throw out your production code and start developing a new one. Guess how many PHP shops with existing code would be happy to do it. It's nice to rant about how PHP function are inconsistent and stuff, but no project was seriously impeded by it ever. At most it is mildly irritating. Huge BC break, on the other hand, would mean all major apps/libraries/frameworks become instantly not available, and who knows when they catch up. At this point, you might as well have a new language. This is understood, but it was a crackpot example. IMHO, adding more ways to express the same thing in a well-established language is more or less the same. It's relearning something you thought you already knew; yes, one breaks BC, but that is why you'd have to classify it a different major version. I'm done on that one. Like I said, it's a crackpot example. Since many experienced people are supporting it, I'd think that while it seems unnecessary to you, it may seem otherwise for them. Many experienced people are also against it. AFAIK, it was because they didn't want to maintain/implement it. Don't know if this was before the patch was provided. If a handful of experienced people decided to go forward with my crackpot idea above, would you be in support, just because they are? Also, you're implying that this is a *necessary* change for these experienced people. Is there something I am missing that PHP is *not* handling currently and requires this *necessary* change? (No) Read this (esp. first answer): http://stackoverflow.com/q/6162484/214196 It's about Perl, but gives you an impression why it is so tough. I figured it was tough, based on the amount of effort/time people spent. Sad to see that it seems abandoned though. Why not? If the pieces are good, stealing them is good. It's how progress happens - you steal good pieces and add couple of your own, and hope the result is good enough that somebody else would want to steal stuff from it While a language is maturing, I would probably agree. I consider PHP quite mature now. I'd say the proof is in the pudding based on the numbers. My chief concerns are these: IMHO, JSON-style syntax is *not* as readable as PHP array syntax. It's shorthanding something that is pretty short as well. Currently, if I want to find an array in code, I can search just for array or Array or = or variations thereof. This adds yet another type of grep I have to run through. One that I am not sure can be easily accomplished (wouldn't it be matching quite a lot more because of it's bare nature? Now we've got to look up neat ways to combine and grep for :?[]{} etc.) Also, now you have coders on the same project using their personal preference. If something isn't broken, why fix it? That was the basis on my original comment about things that actually were underway or brought up due to issues. Before I get off my sandbox, and go back to the shadows on the dev list, someone privately replied to me and said this will help because it will its hurting lots of people's eyes (and wrists on the long term) - I'm taking that as a joke. Weird, I didn't mean to reply privately, must have mistaken the reply to all button. Anyhow, I did say it tongue-in-cheek, but the shorter syntax is easier on the eyes for the nested case. Just FTR I'll copy most of my email here: Stolen?, why not learned?. Java has great architectural stuff and if wasn't for other languages (and developers educated on them) we wouldn't have stuff like exceptions, reflection, and —in the future— traits. You write as if PHP could not or should not improve, and that is a very wrong attitude to have IMHO. The shorter syntaxes are more readable and thus an improvement. You said: Is it hurting anyone to type out array() or something? I say its hurting lots of people's eyes (and wrists on the long term, tsk tsk). But its not going to be an obligatory syntax, you will always be able to use array() if you enjoy it; personally, I don't, and I don't think the proposers and supporters enjoy it that much either. --- Regards, David
Re: [PHP-DEV] Constructor object instance dereferentiation
On Sun, May 22, 2011 at 3:16 AM, Ferenc Kovacs i...@tyrael.hu wrote: hi. it was already discussion, Felipe created an RFC and a patch, the responses was all positive, so I think if nobody changed their mind, we could move this from Under Discussion to Accepted/Implemented as I said before, it would be in good pair with the already implemented array dereferencing (https://wiki.php.net/rfc/functionarraydereferencing) http://marc.info/?l=php-internalsm=129080024516125w=2 https://wiki.php.net/rfc/instance-method-call Tyrael Hi, Nice, it would indeed make sense to include it with array dereferencing. This feature would enter in the PHP 5.4 release along with array dereferencing, is this correct?. Regards, David
[PHP-DEV] Constructor object instance dereferentiation
Hi, I was wondering if object dereferentiation after constructor call is something that has been discussed already. This is, being able to do something like: new MyClass()-setSomething(); Instead of: $var = new MyClass(); $var-setSomething(); Regards, David Vega
Re: [PHP-DEV] Re: Is it true that short_open_tag is deprecated in PHP 6?
@Michael Those are interesting ideas, I think you can register by yourself on the wiki, so you can add the RFC. OTOH, and again, I must say I really think the echo shortcut should be regarded as a separate issue, and now that there was some consensus we shouldn't deviate from the topic. In the end I think it is going to be as bad to have short open tags turned off by default. Hosting services still meddle with the php.ini and some even let you make your own customizations to it (or at least to a subset of it). But again, can we first agree on the echo shortcut feature to be decoupled from short tags?. No agreements === no progress. BTW, what is your open source project? @Thomas I agree on dropping % for good, I personally don't know any project that uses it and don't think there is currently any point to them anymore. Also, I do use '? ' instead of '?' (originall I thought it might throw an error, then it became habit), although I try not tu use ? as much as ?=. Having the space as a requirement (i.e. ?for(... would throw an error) would fix the XML situation, is this what you are saying?. @all Can we decide on decoupling ?= before going back to the general short tag matter? On Thu, May 19, 2011 at 10:35 AM, Thomas Hruska thru...@cubiclesoft.comwrote: On 5/19/2011 12:23 AM, Arvids Godjuks wrote: It's essentially the same what I said - move it out of stort_tags and make it On permanently. As I remember the decision to remove short_tags was made together with register_globals, magic_quotes and other legacy stuff. I can be that I remember wrongly, but really do people really use% ? Would be **really** nice if '?' with a whitespace as the next byte was also detected (i.e. '? ', '?\n', etc). (Single-quotes have been added to aid readability.) The '? ' short tag is syntactic sugary convenience that is **widely** used: Internal corporate servers, personal machines, and millions upon millions of websites. The results and financial costs of cleaning up the upgrade fallout of removing the '? ' short tag are incalculable. Comparing short tags to magic_quotes/register_globals is apples to oranges. The two are so vastly different and not in the same class. The latter is a failed security measure. The former is a syntactic sugary convenience. Every PHP userland developer I know understands the risks associated with magic_quotes and register_globals but, at the same time, they use the '? ' short tag extensively wherever possible. Or, perhaps more simply put: If you remove the syntactic sugary convenience of the '? ' short tag, you'll have an army of developers dropping by shortly after the release of PHP 6 and they will be incredibly unhappy. But you just go ahead and remove the '? ' short tag for PHP 6. You'll be adding it back into PHP 6.0.1. The ONLY reason anyone types '?php ' in the first place is because '? ' isn't guaranteed to work everywhere. And that rule really only applies to open source software and certain web hosts, which is a very small segment of the total PHP market share. It would probably be fine if you removed the _option_ itself but merged '? ' detection into the core. I don't know anyone who uses anything but '? ', so it won't likely be a huge loss for anyone if '% ' support is dropped (but I could be wrong about that). The important part of this discussion is making sure convenient functionality doesn't just vanish for stupid reasons. I recognize there will be breakage regardless because it is a new major version, but looking ahead one extra byte isn't going to kill you. -- Thomas Hruska CubicleSoft President Barebones CMS is a high-performance, open source content management system for web developers operating in a team environment. An open source CubicleSoft initiative. Your choice of a MIT or LGPL license. http://barebonescms.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Is it true that short_open_tag is deprecated in PHP 6?
On Thu, May 19, 2011 at 11:17 AM, Philip Olson phi...@roshambo.org wrote: @all Can we decide on decoupling ?= before going back to the general short tag matter? It feels like decoupling ?= from short_open_tag will happen. And I've not seen objections or reasons for not doing it, so think we can safely assume that it's been decided. Awesome
[PHP-DEV] Regarding the echo short tag
Hi, I just wanted to ask what is the community's feeling on keeping the echo shortcut. I know short tags are kind of deprecated and I think it is the right call, however, I really really think the echo shortcut ?= should be kept regardless of plain short tags, which are kind of pointless. I've read the RFC regarding this and I think the second + third option are the only sane ones. Regarding syntax, I do like ?:$var and would maybe also advocate for %=$var or % $var. I think another option could be a valid namespaced XML notation php:var / (which is still shorter than ?php echo $var?), but maybe this later has bigger implications that I'm too stupid right now to realize (for better or worse). I'm personally still using them since the benefit and enjoyment of working them supersedes the worst case scenario, which is a global find replace of ?= to ?php echo. I tell my coworkers to enjoy them while they still can, however this is a luxury that can be only had with custom development, not open-source projects due to the obvious problems with portability given that short_open_tags is now off by default. Best regards, David Vega
Re: [PHP-DEV] Regarding the echo short tag
Should this go in Accepted then?. Regards, David On Wed, May 18, 2011 at 1:16 PM, Ferenc Kovacs i...@tyrael.hu wrote: On Wednesday, May 18, 2011, dukeofgaming dukeofgam...@gmail.com wrote: Hi, I just wanted to ask what is the community's feeling on keeping the echo shortcut. I know short tags are kind of deprecated and I think it is the right call, however, I really really think the echo shortcut ?= should be kept regardless of plain short tags, which are kind of pointless. I've read the RFC regarding this and I think the second + third option are the only sane ones. Regarding syntax, I do like ?:$var and would maybe also advocate for %=$var or % $var. I think another option could be a valid namespaced XML notation php:var / (which is still shorter than ?php echo $var?), but maybe this later has bigger implications that I'm too stupid right now to realize (for better or worse). I'm personally still using them since the benefit and enjoyment of working them supersedes the worst case scenario, which is a global find replace of ?= to ?php echo. I tell my coworkers to enjoy them while they still can, however this is a luxury that can be only had with custom development, not open-source projects due to the obvious problems with portability given that short_open_tags is now off by default. Best regards, David Vega I thought we alredy decided to keep the short echo. Tyrael
Re: [PHP-DEV] Re: Is it true that short_open_tag is deprecated in PHP 6?
Hi, I'm that somebody Tyrael is talking about. FTR, I'm all for deprecating short tags, but I do feel the echo shortcut is a separate issue. Perhaps if ?php= was implemented a greater deal of people on both sides of the discussion would be happier. Best regards, David On Wed, May 18, 2011 at 2:13 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Tue, Apr 14, 2009 at 8:06 PM, Philip Olson phi...@roshambo.org wrote: PLEASE, let the dead horse be! Apparently, this horse is not as dead as some would like it to be :) The horse is not dead or if so then no proper burial service was given. People are still waiting for the invitations and wanting to hear the eulogy. So, instead I'll make the following assumptions and engrave them into this topics tombstone: - short_open_tag is fully alive - short_open_tag is PHP_INI_SYSTEM|PHP_INI_PERDIR - all distributed php.ini files disable it (5.3+) - the default will be enabled, forever, unless #5 is used - --disable-short-tags will exist, forever - no new alternative syntax will be implemented, ever That's the situation people should understand and since this horse is considered dead I will: - update php.ini ini descriptions to reflect this - update documentation to reflect this - mark http://wiki.php.net/rfc/shortags as declined - point to the declined rfc when people suggest these alternatives All discussion is over unless a human knows the above synopsis is false, because CVS has spoken. RIP. apparently somebody else brought up the shortag(specifically the ?= tag) topic again, and I've noticed that you moved the rfc from declined to In discussion recently (https://wiki.php.net/rfc/shortags?do=revisions), so I would like to know that are these rules still hold, or did something happened since this decision? I couldn't find the suggested clarification in the docs either (maybe looked at the wrong place) Tyrael
Re: [PHP-DEV] Re: Is it true that short_open_tag is deprecated in PHP 6?
So what would be there to discuss or agree on?, now that the topic is at hand. Regards, David On Wed, May 18, 2011 at 9:05 PM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! As far as I remember there weren't any serious objections to decoupling ?= and leaving it always enabled. It doesn't interfere with other PI tags in a file, and nobody else is going to come along and use it on us. That's what I think too, but since there was no agreement fixed on that, I put it into discussion part. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] annotations again
Hi, On Wed, May 11, 2011 at 12:41 AM, Lester Caine les...@lsces.co.uk wrote: guilhermebla...@gmail.com wrote: So, please stop saying no to every feature request that comes in and start to discuss the actual impact of each feature. I think that MY only problem with you 'adding annotations because it is missing' is simply that I've already been doing it for years - just not calling it 'annotations' ... its 'documentation' and always has been ... It is really troubling to read that statement. Seems there are still some that don't really have a clue of what annotations are, even when the RFC clearly links to them. Annotations ARE NOT documentation; in the case of PHP, documentation is being used as annotations because there is no language implementation, which exists in other languages (Java, .NET) and they are widely used. Also, some use annotations as documentation (e.g. store the class version), but again, annotations ARE NOT documentation. Don't let the @ notation shared with docblock fool you. Guilherme, I think its easy to assume that people already have some sense of what annotations are, but perhaps the wiki entry could be more educational about it?. The first time I read about annotations it was from this link: http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html; perhaps an intro like that could help to make the case for annotations crystal clear?. The real problem at present is that the whole ecosystem is now so disjointed that PHP5.2 is the last version that is still fairly fully supported, but people are pushing for 5.4 before 5.3 has been properly put to bed. We need to finish of what is already added fully before pushing more new stuff in? That INCLUDES in the ecosystem! And we still have the hole that is unicode ... This is another thing that troubles me when I read this list. How does the PHP core dev community sets priorities?, is there some sort of roadmap?, is there a process to create this roadmap?, or is it just all a generalized best intention to do things. I'm aware that the more features the more has to be maintained, but, what I see is that there is lot of potential for the core dev community to grow and at its current state it doesn't seem to be able scale due to the lack of a roadmap/process. I'm not trying to be a douche here, just saying: I see lots of criticism towards everything and very few agreements. Best regards, David Vega
Re: [PHP-DEV] annotations again
On Wed, May 11, 2011 at 2:59 AM, Lars Schultz lars.schu...@toolpark.comwrote: Am 11.05.2011 09:35, schrieb dukeofgaming: Que?. Are you aware that you cannot implement interface methods?. Sorry. my bad. I mixed implementation with specification, but it would work, no? Eh, well, in a weird and complex way I'd guess =P. If it were about implementing a workaround to annotations for class metadata I'd use mixins and magic methods, but that doesn't win over annotations, not by a long shot. I really think the dilemma of whether annotations are useful or not is moot. What an argument. I'm not saying they are not useful. I am saying they can be done with what we already have. I've got tons of code which could run faster if the core-devs finally decided to take my aproach over theirs...;) Also citings of .NET and Java makes me wanna scream, because I don't want those languages. I want PHP, which has been my faithful servant for over 12 years! I rarely use Java, I personally hate .NET, and PHP is the language that has been giving me my bread and butter since I started as a developer. I'm just saying that as far as language design goes, this is not something new and it has been succesfully taken advantage of for years. Also, and if I'm not mistaken, PHP has already taken from Java's example with exceptions and the interfaces you love =P.
Re: [PHP-DEV] annotations again
On Wed, May 11, 2011 at 2:45 AM, Rasmus Lerdorf ras...@lerdorf.com wrote: The roadmap is in the form of a feature list which you can find at http://wiki.php.net/etcwiki.php.net/etc There is never going to be complete agreement on any feature, but once there is enough agreement from the main stakeholders in a certain feature and the implementation looks feasible both from a technical perspective and from actually having someone willing to do the work, it gets assigned to a release. The link doesn't work, but I'm assuming it is this one?: https://wiki.php.net/todo In the case of annotations there were some serious stakeholders, like Matthew, Sebastian and others who really do understand what annotations are and why they are needed, but they did not agree with the proposed approach. That's why we have the RFCs and that's why these discussions flare up around release time. It triggers people to take a really serious look at a feature to see how it would work for them. In other words, the ideal situation to move this particular case forward is to have more stakeholders join the discussion, right?. An issue that I see here is that it is not that easy to join in the discussion because: a) They would need to be already in the list to have an easy way to access all the messages b) The thread is too disperse to follow in http://news.php.net/php.internals/ c) The public mirror of the newsgroup is faulty, see http://news.php.net/php.internals/52242 for example *command too long: XPATH 4dc826b1.4090...@lerdorf.com 4dc82a36.8090...@lerdorf.com 4dc83401.2090...@sugarcrm.com 4dc8d122.3050...@lsces.co.uk 4dc8f125.2010...@toolpark.com 4dc8fb1a.7040...@lerdorf.com* My suggestion for this —and it would be a rather disruptive one, I know— is to move the lists to Google Groups, or at least create one or two as an experiment, say: php-userland and php-dev. BTW, Guilherme is an important stakeholder too, he has participated in Doctrine2 annotation-related work: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php And yes there is a lot of noise. You will see quite a few uninformed opinions, and a few informed ones. We have always kept things completely open for anyone to have their say. This openness gives people access, but it also often gives people the sense that there is complete chaos. We are not .Net. That I understand, respect and applaud. Still, I think a better process would provide more transparency (openness !== transparency), which is an issue I've seen others complain about. This way, people willing to implement their own feature might understand easier that if they help out with existing actionable PHP problems, the community could shift more easily their attention to their proposals. The way I see it, PHP has moved by inertia all these years, and it has worked, but I think there are measures that could be taken to lead the discussions towards a more productive path. For example, is there anyone at all that does some kind of moderation?, and I don't mean the coercive type, but the hey guys, this seems off-topic, can you start this discussion on another email thread? type of moderation. Best regards, David Vega
Re: [PHP-DEV] 5.4 again
On Wed, May 11, 2011 at 2:52 AM, Michael Wallner m...@php.net wrote: On 05/10/2011 01:04 PM, Stefan Marr wrote: The whole thing required a lot of, what I would characterize as, hand-holding. Internals is not the most open community and needs not only good arguments, but persistence. And, well, it also seem to require to get in touch with the right people... And now the whole discussion about 5.4 goes again in a direction where it will probably be stalled in the end. I am not to optimistic about an actual release date within 2011. Don't lose your head on it. If you look at the output buffering code contained in trunk (which is to become 5.4), you may discover that it has been written exactly 5 years ago. *gasps*
Re: [PHP-DEV] annotations again
On Wed, May 11, 2011 at 4:30 AM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 05/11/2011 01:39 AM, dukeofgaming wrote: The link doesn't work, but I'm assuming it is this one?: https://wiki.php.net/todo That was supposed to be wiki.php.net/rfc (iPad auto-correct messed it up) I see. I have actually read most RFCs, but I do feel something is meesing. Perhaps if RFCs were categorized by potential release in the wiki —or alternatively, an additional Intented PHP version field— then agreements coud get easier, because I don't see consistent PHP version information for RFCs that could lead to an actual roadmap. I don't think we need to lower the participation bar further here. It doesn't take very long to find a threaded version of the list if that is what you think is holding people back. All the lists are here, http://php.markmail.org/search/ for example. But honestly, subscribing to a mailing list and watching it for a while before participating is not too much to ask from people who want to participate. My suggestion for this —and it would be a rather disruptive one, I know— is to move the lists to Google Groups, or at least create one or two as an experiment, say: php-userland and php-dev. We have such a user list already. Many of them actually, but the main one is php-general. Again, refer to the above link where you can see that php-general gets way more traffic than the internals list, so there is no lack of participation there. I wholeheartedly agree, but sometimes it is the small details that lead to dissuasion (e.g. having to look for the right/best mirror). In general I've found Google Groups mailing lists more approachable/usable. I see now that there are nice mirrors, but in general the mirror solution feels fragmented. Just my opinion here. BTW, Guilherme is an important stakeholder too, he has participated in Doctrine2 annotation-related work: Of course he is. But like I said, we need all the major stakeholders to reach some sort of agreement on large efforts like this. How could we get them here?. I know there is no magical answer but if we do need them here something must be done, right? (e.g. make the RFC more appealing for technical debate?). The way I see it, PHP has moved by inertia all these years, and it has worked, but I think there are measures that could be taken to lead the discussions towards a more productive path. For example, is there anyone at all that does some kind of moderation?, and I don't mean the coercive type, but the hey guys, this seems off-topic, can you start this discussion on another email thread? type of moderation. Of course. I've often sent private emails to people to politely suggest they take things offline and others regularly step in as well. But, is there such a role/responsibility/structure within the community?, and I'm really not talking about hierarchy or bureaucracy, just that I've seen it is important that there is someone that commits to such a role and not just leave it to other's good will. Best regards, David
Re: [PHP-DEV] annotations again
On Wed, May 11, 2011 at 11:59 AM, Rasmus Lerdorf ras...@lerdorf.com wrote: My main concern is the trickle-down effect a major low-level engine addition causes. Your patch is just the tip of the iceberg which will cause dozens of people weeks of work to account for the new code all across the PHP ecosystem. The most complicated being the opcode cache support which really only can be written by a handful of people due to the complexity involved. Combine that with the fact that other projects who currently use annotations, perhaps not to the level of Doctrine, but still, state that they would have a hard time switching to this new approach it becomes really hard to commit all these people and all this time to this. We are severely resource-constrained when it comes to people who can write solid low-level C code and we have to be very careful what we ask our volunteers to spend their time on. A volunteer developer who isn't excited about a feature is going to drag her feet and it will sit solidly at the bottom of the priority list for months, if not years. If a key piece of the eco-system isn't updated because of this one addition, it means that potential PHP 5.4 users may have to wait 6, 12, 18 months before they can migrate to the new version. Therefore, low-level engine changes, syntax additions, or entirely new grammars as is the case here, face an uphill battle. If there is a way to currently solve the problem without major changes, even if it is an 80% solution that will weigh heavily against accepting the new code. Without broad support and enthusiasm, especially from the people who have historically been the ones that write the code and track down and fix the bugs, low-level features like this are doomed, no matter how well-intentioned they are. That explanation sheds a lot of light on the general situation, thanks. Something I wanted to ask —regarding resources— is, is GSOC being leveraged this year in any way?. I'm guessing there could be lots of enthusiasm packed there, perhanos not that much for C writing, but for clearing the way for C writers.
Re: [PHP-DEV] annotations again
On Wed, May 11, 2011 at 12:29 PM, guilhermebla...@gmail.com guilhermebla...@gmail.com wrote: Hi Larz, On Wed, May 11, 2011 at 3:35 AM, Lars Schultz lars.schu...@toolpark.com wrote: Am 11.05.2011 00:28, schrieb guilhermebla...@gmail.com: - Entities with knowledge about its persistence information That must be something I simply have no knowledge about. But isn't it just a theoretical difference, because in practice, the code being annotations or PHP-Code is kept within the class, therefore the entity is not separated from its persistence information...but then I don't really understand the problem in the first place;) I hope you have OO architecture knowledge. By having entity implementing an interface/abstract class, you make your domain classes depending on persistence package. This dependency breaks OO encapsulation of packages. By having the code (annotations) within the class you just meta classify each property/method of your class. You probably don't know, but annotations that you use in Doctrine follows a standard document usually referred as JPA (or JSR-317), second version. So, you may be surprised, but any persistence tool that follows this document would be able to support this Entity. One good example is how ORM package of Doctrine works and you're able to have your Entity schemaless with almost 0 changes in ODM package (read as CouchDB and MongoDB). I think part of the problem on the discussion —regarding the acceptance of the feature— is that annotations are being seen just as a cute feature, instead of an architectural advantage to all good PHP code (i.e. OO taking advantage of design patterns) and its implications. In summary: they are huge. If simple reflection can tell the developers what the code is, annotations let them know what it can be in depending on their context (i.e. behavior is decoupled). - Resources being wasted Now you sound like Rasmus when he talks about his assembly-history. Do you really expect Annotations to perform better than hard-wired php-code? Yes, and built-in support is WAY faster. If I'm not mistaken, the current comment-parsing solutions are so slow that the annotated classes and methods and attributes *NEED* the metadata to be cached in separate PHP code in order to function, otherwise it would be practically impossible to use them in production sites; conversely, if they were supported natively caching would not be absolutely necessary. Is this the case?, if so, I think it is a strong use case to be considered for the RFC. BTW, why is it rejected in the wiki now?. Is it completely completely rejected?, or just postponed?... if it is just cataloged as declined for now, perhaps it will be harder to retake for discussion later if it appears as declined?.
Re: [PHP-DEV] annotations again
On Wed, May 11, 2011 at 4:57 PM, guilhermebla...@gmail.com guilhermebla...@gmail.com wrote: Hi duke, I moved it to rejected in pro of a new proposal. I briefly drafted it here: https://wiki.php.net/rfc/annotations-in-docblock There's a lot of things to be officially defined, but basic idea is there. I expect to have a chat with interested core devs to see what can be done in this subject and find some common sense. =) Ok, so the agreed direction now would be to have some initial support for annotations in comments to achieve syntax and data uniformity, and after its necessity/utility is obvious to everybody then we can move to native support?. Is this correct?. BTW, I love the idea of using JSON as value.
Re: [PHP-DEV] 5.4 again
so the problem is, that the userland is under-represented in the development, because they usually not present on the mailing list and on irc, where discussions and decisions happen, and they usually have different priorities and expectations about the PHP language than the core devs. to make things worse, they cannot write patches for the core, and the core devs rarely work on something which they don't particularly need or like. and I think that the only option where we can change that, is that us, the php userland devs has to be more active on the mailing lists, irc, bug tracking, writing RFCs etc. Why not open a Google Groups list?, having every message recorded publicly and being easy to join-in I'd bet that the situation would change. I've seen it work really well for other open source projects, such as Joomla and Symfony. Regards, David Vega
Re: [PHP-DEV] 5.4 again
On Tue, May 10, 2011 at 2:42 PM, Ferenc Kovacs i...@tyrael.hu wrote: On Tue, May 10, 2011 at 9:28 PM, dukeofgaming dukeofgam...@gmail.comwrote: so the problem is, that the userland is under-represented in the development, because they usually not present on the mailing list and on irc, where discussions and decisions happen, and they usually have different priorities and expectations about the PHP language than the core devs. to make things worse, they cannot write patches for the core, and the core devs rarely work on something which they don't particularly need or like. and I think that the only option where we can change that, is that us, the php userland devs has to be more active on the mailing lists, irc, bug tracking, writing RFCs etc. Why not open a Google Groups list?, having every message recorded publicly and being easy to join-in I'd bet that the situation would change. I've seen it work really well for other open source projects, such as Joomla and Symfony. you can already do that through http://marc.info/?l=php-internals or the newsgroup, see http://php.net/mailing-lists.php albeit google groups is better imho Tyrael Yeah, I forgot to mention that everything is threaded there, so its easier to follow. Regards, David Vega
Re: [PHP-DEV] 5.4 again
On Mon, May 9, 2011 at 12:44 PM, Ferenc Kovacs i...@tyrael.hu wrote: That's simply not true. But just because one group of users feel strongly about something doesn't mean it should go in. There has to be some level of curation or we end up with every feature under the sun resulting in a huge mess. Are you sure? Please take a look at every topic defined on wiki page. Is there ANY topic to be discussed that came from userland? If you say yes, please point me to the thread. What I clearly see there is that every feature defined there came from users with php-src karma. there is at least one, mine but I also think that the core devs and the php userland/community is too far away, we would need more people from the userland to contribute to the development of the php language. http://www.slideshare.net/andreizm/the-good-the-bad-and-the-ugly-what-happened-to-unicode-and-php-6 http://www.slideshare.net/andreizm/the-good-the-bad-and-the-ugly-what-happened-to-unicode-and-php-6 “Because it’s nearly impossible toparticipate on Internals if yourpoo-throwing arm isn’t strong.” — @coates “Those with talent, competence, energy,and good ideas over a period of time - and who outlast the rest - tend to be the main drivers behind PHPdevelopment.” — @a Tyrael Hi, After having some experience participating in other open-source communities, specially Joomla (but also Mootools, Doctrine and Symfony), my first impression when subscribing and reading this list was: wow, its hostile, and I automatically refrained from wanting to participate and chose just to observe for the meantime. I know every community is different, but, even if a single person states something that might look like a problem it is an indicator that you might have it. I think the PHP community could benefit from a process like Python's PEP Workflow: http://www.python.org/dev/peps/pep-0001/#pep-work-flow. Personal attacks achieve nothing, and contributing to open-source is MORE than contributing code, and even if you do contribute, it doesn't look like it is even an automatic way to get the needed attention. I've seen Guilherme post several times asking for feedback (i.e. building upon his work, not just criticizing him) and I have never seen it. I don't think Guilherme loves spending his afternoons advancing in a patch without the slightest sense of community direction. Being brutally honest, looks to me that this generalized attitude/culture might actually be scaring willing devs away, and the community itself needs some kind of direction. Here is a recommended watch: O'Reilly MySQL CE 2010: Jono Bacon, The Engines Of Community: http://blip.tv/file/3495291 Best regards, David
Re: [PHP-DEV] DVCS
Hi, I'm not a frequent poster in the list but I thought I'd really should give my 1 cent here when I saw popular being an argument for using DVCSs, its not, and its neither fashion nor cargo cult, it is just a plain eye opener experience of how neither SVN or CVS are the base of all versioning (two of its creators —Brian Fitzpatrick and Ben Collins-Sussman— have acknowledged this by saying sorry about that with regards to Subversion) and that better and more natural ways to collaborate and integrate code. I could provide an epically long argument here, but instead I'll link to the one I've already made, diagrams and graphics included =): http://programmers.stackexchange.com/questions/35074/im-a-subversion-geek-why-i-should-consider-or-not-consider-mercurial-or-git-or/35080#35080 So, I don't want to make debate here of wether centralized is better than distributed (because the point is moot), but I think its not a good situation for the community to have a previously open door to DVCSs now closed. Perhaps a solution can be found to even open the door to Mercurial (that is an excellent place to start with DVCSs because its simplicity and straight-forwardness) in addition to git in such a way that doesn't stress the server?. Regards, David On Wed, Apr 27, 2011 at 9:40 PM, Drak d...@zikula.org wrote: On 28 April 2011 07:55, Ben Schmidt mail_ben_schm...@yahoo.com.au wrote: I realise that at least for now, PHP is sticking with SVN. No problems. I realise this is not the topic of discussion but I have to say, that overall, a switch to DVCS would make a huge difference to PHP development life cycles. Git for one, makes contributing and integration of patches a completely different experience. It encourages more community participation without impinging on quality since you don't need to grant commit permissions. The whole workflow of creating and integrating patches is much faster and more simple because you can switch context from branch to branch almost instantly allowing those with commit permissions to verify if a contribution is worth merging or not. It's much less work than SVN and the ease naturally attracts contributors. Merging is not a pita like with SVN. However, given the recent security breach there is another side: Tampering with a git repository is virtually impossible because every commit hash is generated from the previous ones, so if your servers were compromised again, a change in the past history would require alteration every single commit hash since that change and the resulting HEAD hash would be different. Since hashes are based on the commit contents it's just not feasible even if SHA1 was one day compromised that you could successfully tamper with a previous commit and engineer the calculations so the current HEAD hash remained unchanged. If a commit blob (on the file-system) was altered manually, your git repo would simply fail to validate the next time you use it. In every scenario you'd know immediately something was wrong and not have to go looking for it commit by commit. Something to consider again in the future at least. Regards, Drak
Re: [PHP-DEV] DVCS
Hi Ben, I'm sorry I did a wrong remark there, but I see you saw what I meant. The nice thing about open source projects is that communities develop naturally around them, it becomes an ecosystem, everything tends to lean towards balance, when a change is intended to be made it should be allowed to develop organically. Point here is: lets not try to force DVCSs but rather keep the door open so the community can pass through it whenever it feels ready, so the dilema of current devs vs potential devs never happens. My advice here is —if current devs are willing— to pilot test a DVCS on a small part of the project where it can be used primarily (as in not with subversion); this would be a very healthy exercise to understand the why of this generalized DVCS-ish concern. Another advice is to open the discussion towards the choice of a DVCS in comparison to the project's interests and demographics (e.g. if there are more windows users than mac/linux, mercurial would be preferred, if its the other way around there is an underlying git community, git might be best). To all who doubt DVCS, this is a good read for you: http://hginit.com/00.html In relation to Drak's remarks, yes, I think the maturity of the tools has contributed to its increased usage, and also, the very cool services around them, such as github.com and bitbucket.org. Finally, I think from here on, the conversation should be focused on finding a technical solution to the load problem (I'm not familiar with the setup, but if I think of something I'll post it). Regards, David On Wed, Apr 27, 2011 at 10:29 PM, Ben Schmidt mail_ben_schm...@yahoo.com.au wrote: Just for the recordI didn't say popularity was a reason to use a DVCS. I said the popularity of DVCSes might cause server strain (if a lot of people want to convert the public SVN repo to a distributed one, downloading all the changes in the repo, which SVN really wasn't designed for, that would be a heavy load--and positively correlated to popularity: more popular, more conversions, more load). I agree with your closing point, though: I'd love to see us look for a low-load way of providing an Hg mirror and/or a Git mirror. I also think that either a mirror or a change of VCS may attract developers in the medium-term. However, I also think that current developers carry a lot more weight than potential developers, and it's important for them to be able to work in a way that is comfortable for them. So a mirror or two would be nice, and I'd push for that, but a change of official repo I will merely suggest be considered longer term. Ben. On 28/04/11 1:07 PM, dukeofgaming wrote: Hi, I'm not a frequent poster in the list but I thought I'd really should give my 1 cent here when I saw popular being an argument for using DVCSs, its not, and its neither fashion nor cargo cult, it is just a plain eye opener experience of how neither SVN or CVS are the base of all versioning (two of its creators —Brian Fitzpatrick and Ben Collins-Sussman— have acknowledged this by saying sorry about that with regards to Subversion) and that better and more natural ways to collaborate and integrate code. I could provide an epically long argument here, but instead I'll link to the one I've already made, diagrams and graphics included =): http://programmers.stackexchange.com/questions/35074/im-a-subversion-geek-why-i-should-consider-or-not-consider-mercurial-or-git-or/35080#35080 So, I don't want to make debate here of wether centralized is better than distributed (because the point is moot), but I think its not a good situation for the community to have a previously open door to DVCSs now closed. Perhaps a solution can be found to even open the door to Mercurial (that is an excellent place to start with DVCSs because its simplicity and straight-forwardness) in addition to git in such a way that doesn't stress the server?. Regards, David On Wed, Apr 27, 2011 at 9:40 PM, Drakd...@zikula.org wrote: On 28 April 2011 07:55, Ben Schmidtmail_ben_schm...@yahoo.com.au wrote: I realise that at least for now, PHP is sticking with SVN. No problems. I realise this is not the topic of discussion but I have to say, that overall, a switch to DVCS would make a huge difference to PHP development life cycles. Git for one, makes contributing and integration of patches a completely different experience. It encourages more community participation without impinging on quality since you don't need to grant commit permissions. The whole workflow of creating and integrating patches is much faster and more simple because you can switch context from branch to branch almost instantly allowing those with commit permissions to verify if a contribution is worth merging or not. It's much less work than SVN and the ease naturally attracts contributors. Merging is not a pita like with SVN. However, given the recent security breach there is another side
Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator
Hi, just to drop an opinion on something I felt natural when reading this: how about a word instead?: $value = 'Not set' unless $a['key']; I think it would be way more readable. Regards, David On Fri, Apr 8, 2011 at 2:02 AM, Adam Richardson simples...@gmail.comwrote: We need to be careful about changing the beahviour of existing operators. Indeed. The '?' character already is special, so using '??' seems like a safe, practical approach. However, I'd prefer maintaining the form of the standard ternary operator with the colon ($value = $var['bar'] ?? : 'Bar was not set'; // value =Bar was not) so the '??' operator could be applied in any situation that one would normally use the standard ternary operator. // standard $value = isset($a[$key]) ? $a[$key] : 'Not set'; // new ?? double ternary that performs isset check and omits second expression $value = $a[$key] ?? : 'Not set'; // new ?? double ternary that performs isset check and uses second expression $value = $a[$key] ?? strtoupper($a[$key]) : 'Not set'; Granted, the last example might be infrequent, but I think there's also a value in keeping the form of the double ternary (if used at all) the same as the standard ternary operator for consistency sake. Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com
Re: [PHP-DEV] git anyone?
Yet another one here: http://hginit.com/00.html http://hginit.com/00.htmlThe title says it all: Subversion re-education. It is actualyy a somewhat neutral article even though the page is a mercurial tutorial. Regards, David http://hginit.com/00.html On Thu, Dec 2, 2010 at 12:44 AM, Larry Garfield la...@garfieldtech.comwrote: The Drupal project's decision making process for moving to Git is documented extensively here: http://groups.drupal.org/node/48818 Just another data point. --Larry Garfield On Wednesday, December 01, 2010 2:52:53 pm dukeofgaming wrote: Hi, I was following this path to push the adoption of a DVCS for the Joomla project and I started to create the required documentation to make an informed argument and evaluation, I made some diagrams to make the case for their need for good team development and workflows, feel free to borrow any content/diagrams from here http://docs.joomla.org/Dvcs If an RFC is started I'd love to help. I have experience with git and mercurial. http://docs.joomla.org/DvcsRegards, David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] git anyone?
Its actually faster to use the command line when u have enough practice; picture yourself merging branches or something more complicated, I think its easier typing stuff as you think it than finding your way around a GUI, command line reacts faster than a GUI too. I use the IDE integration though, but not the shell integration, at all. I agree on visualizing repository tree on the GUI though. In the end its up to each individual. Regards, David On Thu, Dec 2, 2010 at 3:12 AM, Lester Caine les...@lsces.co.uk wrote: dukeofgaming wrote: Yet another one here:http://hginit.com/00.html http://hginit.com/00.htmlThe title says it all: Subversion re-education. It is actualyy a somewhat neutral article even though the page is a mercurial tutorial. Actually this probably point up one of the fundamental differences between the different ways of working. 'Most people work with Mercurial through the command line' ... fill in your own package ... Personally I very rairly use any of these from the command line, since Eclipse has fully integrated facilities. The statement 'it just works from the cammand line' only applies if that is what you are still using, but even CVS I would have to dig out the manual to use the command line. Productivity wise, having to pull out of the IDE to do code management is the main problem with switching from CVS/SVN to any of the alternatives, but the main thing I can't understand is how people actually MANAGE with command line when dealing with a large number of changes? A graphical facility is almost essential when navigating around complex code trees and viewing diffs which are more than a few dozen lines? ( Pierre this is probably one of the reasons I had so much trouble building PHP on windows ... simply because I have used graphic IDE's since C++ Builder 1 days and before :( Command line working is a somewhat different mind set ... and prior to C++ I was working on hand coded machine code ... ) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations
I toast to that. Get rid of T_VAR already. Regards, David On Thu, Dec 2, 2010 at 3:34 AM, Patrick ALLAERT patrickalla...@php.netwrote: 2010/11/30 Kalle Sommer Nielsen ka...@php.net: Hi 2010/11/30 Patrick ALLAERT patrickalla...@php.net: With this patch, something looks inconsistent to me: Both properties and methods have a visibility (public|protected|private) and a keyword: var (T_VAR) and function (T_FUNCTION) respectively. However private var $foo; generates a fatal error but private function foo(){} not? The var keyword is an alias of the public keyword for BC with PHP4. So it would be illogically to declare a property both private and public at the same time ;-) Shouldn't we get rid of that kind of pre-PHP5 stuff _before_ introducing the possible omission of T_FUNCTION? Patrick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations
How about deprecation then? On Thu, Dec 2, 2010 at 3:58 AM, André Rømcke a...@ez.no wrote: On Thu, Dec 2, 2010 at 10:34 AM, Patrick ALLAERT patrickalla...@php.net wrote: 2010/11/30 Kalle Sommer Nielsen ka...@php.net: Hi 2010/11/30 Patrick ALLAERT patrickalla...@php.net: With this patch, something looks inconsistent to me: Both properties and methods have a visibility (public|protected|private) and a keyword: var (T_VAR) and function (T_FUNCTION) respectively. However private var $foo; generates a fatal error but private function foo(){} not? The var keyword is an alias of the public keyword for BC with PHP4. So it would be illogically to declare a property both private and public at the same time ;-) Shouldn't we get rid of that kind of pre-PHP5 stuff _before_ introducing the possible omission of T_FUNCTION? Why? This will break lots of code, does it improve anything while at it? Is 'var' hindering anything? Is it taking up a lot of code? If it is removed then that should be in trunk aka 6.0 the 2nd , and not in 5.x.
Re: [PHP-DEV] git anyone?
Such IDE integration exists for mercurial, both for Eclipse and Netbeans, also at shell level. I really don't get why you say there is no easy way to rollback changes, because there is. I do manage package updates and installations through SVN (e.g. updating symfony, doctrine), I just don't use SVN to work with other people. I believe that managing packages and working with people should not be regarded as the same thing when talking about versioning systems. I think the main and general drive of people for adopting a DVCS is just that, better workflows, and fortunately, some of them have actually worried about interoperability, meaning its possible to import files from other (D)VCSs. Regards, David On Thu, Dec 2, 2010 at 4:02 AM, Lester Caine les...@lsces.co.uk wrote: dukeofgaming wrote: Its actually faster to use the command line when u have enough practice; picture yourself merging branches or something more complicated, I think its easier typing stuff as you think it than finding your way around a GUI, command line reacts faster than a GUI too. I use the IDE integration though, but not the shell integration, at all. I agree on visualizing repository tree on the GUI though. In the end its up to each individual. This is the key here. When working on PHP projects via CVS and SVN I get a view of all the files which have changed in the IDE. I can then review those changes and only need to select those which do not clash with my own local changes. I can also immediately see committed changes that NEED to be rolled back because they DO clash with the areas that I am maintaining! Simply automatically merging from the command line does not work FOR ME. DVCS in theory provides a nice way for me to manage my own builds of these projects, but the black hole is now how the clash problems are handled as there is no easy way to roll back a change that has broken something else. Adding the complexity of multiple packages across several projects ... smarty, adodb and the like, or building the internal extensions which use libraries from the likes of apache, firebird ... in theory should be simplified by the use of a DVCS approach, but the reality is that it is still very early days and while people are running to a number of camps there needs to be a more tidy integration path rather than the current diversity that has been created. I think that what we actually need is a complete rethink of what the problems are ... including managing the user projects rather than JUST raw source code ... and agree a level of operation rather than the current approach of slagging off the paths that you do not agree with. Every package has problems and none of them offer a single solution? -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] git anyone?
Hi, I was following this path to push the adoption of a DVCS for the Joomla project and I started to create the required documentation to make an informed argument and evaluation, I made some diagrams to make the case for their need for good team development and workflows, feel free to borrow any content/diagrams from here http://docs.joomla.org/Dvcs If an RFC is started I'd love to help. I have experience with git and mercurial. http://docs.joomla.org/DvcsRegards, David 2010/12/1 Johannes Schlüter johan...@schlueters.de On Wed, 2010-12-01 at 10:01 -0500, David Soria Parra wrote: On 2010-12-01, Pierre Joye pierre@gmail.com wrote: hi, I think we have enough feedback about this topic. We will come back with a detailed proposal explaining how it could be done, which tools, etc. I think it would be good to have people willing to help out with evaluating certain DVCS. In particular we need someone for BZR to put together a good RFC. I'll probably help evaluating Git and Mercurial. An evaluation requires a clear set of goals first. Like: Why change? What is broken? What can be improved? What are existing requirements? Once that is done one can start evaluating specific tools. johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] git anyone?
Hi, I've never participated on the lists, but this was a topic I could just not look away from. My take on this is that it all boils down to the statistics of the developers and contributors, as Gwynne said, there is really no much merit on technical aspects of the tools... but rather how the community plans to use other tools around it. My preferred DVCS is mercurial due to its portability (no messing with bash consoles in Windows, using it is the same for all platforms) and the fact that I use Netbeans as my main IDE and it comes by default with the mercurial plugin (the Netbeans project uses mercurial). I also like mercurial because Bitbucket.org is comparable enough to github, and more generous with its free accounts (free private repositories and unlimited space). I also like git, but I stick with mercurial. I have never used bazaar... and I have never used svn for team development, fortunately =). Regards, David On Tue, Nov 30, 2010 at 11:21 AM, Lester Caine les...@lsces.co.uk wrote: Gwynne Raskind wrote: *Googles.* *Reads.* Well... dang. Go Wez!! Magic just what I was looking for as well. -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php