Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-04-01 Thread Alban LEROUX
t your (non-Windows) prompt you get a nice little > description of what it does. > > -Rasmus > --20cf307d046c3ddbde049fcb0b8f-- -- Alban Leroux s...@paradoxal.org Web developper -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Array Dereferencing

2010-06-09 Thread Alban LEROUX
cost, that we gain. If we want this functionality, then Mathieu Suen's idea is better IMHO: http://www.mail-archive.com/internals@lists.php.net/msg46764.html eg. (new Foo())->bar() Tyrael Yes my only possible objection is that's less readable. -- Alban Leroux s...@paradoxal.org W

Re: [PHP-DEV] [RFC] Array Dereferencing

2010-06-09 Thread Alban LEROUX
oblem i see, is could be a name conflict like : function Foo() { // ... } class Foo() { public __create() { // ... } } Foo(); // Instanciate the class or call the function ? I hope this idea can help/inspire you. Regards, -- Alban Leroux s...@paradoxal.org Web developper -- PHP Internals - PHP

Re: [PHP-DEV] Constant and expression ?

2010-05-21 Thread Alban LEROUX
tant should not be incremented but should be shifted left. After the manner which is implemented don't affect me. Can be a " enum " keyword or a stuff like " iota ". -- Alban Leroux s...@paradoxal.org Web developper -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Constant and expression ?

2010-05-19 Thread Alban LEROUX
ue, or literal, and generate a notice for the developer to change the const to literal for gaining performance. What do you think? Tyrael That's could be very useful to define flag, something like that : class foo { const CASE_1 = 1 << 1; const CASE_2 = 1 << 2;

[PHP-DEV] Re: A critique of PHP 6

2010-04-20 Thread Alban LEROUX
CONST VALUES. -1 but yes for matematical (or logical) operation like this : class foo { const OPTION_1 = 1 <<  0; const OPTION_2 = 1 <<  1; const OPTION_3 = 1 <<  2; const OPTION_4 = 1 <<  3; } 4. PARAMETER ORDER. +1 Thank you for your time,

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Alban
7;foo')?:42; > > Simple and clean. > > -Rasmus Yes, as you say, simple and clean ! Have I miss something like that in php ? -- Alban Leroux -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Alban
o'] ?= 'default'; I am aware that I am repeating myself and that I seem insistant. It is difficult to express ideas clearly when one is not very comfortable with English and I apologize for that :) -- Alban Leroux s...@paradoxal.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Alban
Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit : > On 21.11.2009, at 06:12, Alban wrote: > >> This is not a big problem but if a solution exists, this would be so >> cool ! Especialy when we have to check existance of twenty or more key >> in array. Code

Re: [PHP-DEV] suggestion about ternary operator

2009-11-20 Thread Alban
Le Fri, 20 Nov 2009 23:28:39 -0600, Larry Garfield a écrit : > On Friday 20 November 2009 11:12:29 pm Alban wrote: > >> This is not a big problem but if a solution exists, this would be so >> cool ! Especialy when we have to check existance of twenty or more key >> in

[PHP-DEV] suggestion about ternary operator

2009-11-20 Thread Alban
ar($var, $default) { return ((isset($var)) ? $var : $default); } So is it possible to make a little improvement on this operator or introduce a new operator or a core function which do that ? What's your feeling about it ? -- Alban Leroux s...@paradoxal.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Custom Factories (SPL)

2009-11-19 Thread Alban
Le Thu, 19 Nov 2009 12:06:19 +0100, Mathieu Suen a écrit : > Alban a écrit : >> Le Thu, 19 Nov 2009 02:24:01 +, Jared Williams a écrit : >> >>>> -Original Message- >>>> From: Robert Lemke [mailto:rob...@typo3.org] Sent: 18 November 2009 >

Re: [PHP-DEV] RFC: Custom Factories (SPL)

2009-11-18 Thread Alban
hich is allready created. // you register the service Services::register('databaseConnexion', new databaseConnexionFactory ('mysql', array('server', 'database', 'user', 'password'))); // and call it $db = Services::load('databaseConnexion'); How PHP should treat the singleton ? getInstance() is just a convention. Create a service mechanism directly in php implies that php implements singleton model too. -- Alban Leroux s...@paradoxal.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] alternative to the fopen() hack in autoloaders

2009-11-10 Thread Alban
istence reason : try { include 'file'; // if we are sure about data sort in get_included_files, just do : $fullFileName = array_pop(get_included_files()); // ... } catch(phpParseIncludeException $e) { // ... } catch(missingIncludeException $e) { // ... } catch(includeException $e) { // ... } regards, Alban Leroux s...@paradoxal.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: RFC: Replacing errors with Exceptions

2009-08-03 Thread Alban
Le Fri, 31 Jul 2009 11:35:45 +0200, Hannes Magnusson a écrit : > I just realized we don't link to that function from the simplexml docs. > > I'll add some "see also" links and add an "errors" section mentioning it > too. > > -Hannes Thank you for the documentation :) -- PHP Internals - PHP Ru

Re: [PHP-DEV] Re: RFC: Replacing errors with Exceptions

2009-07-30 Thread Alban
>Le Thu, 30 Jul 2009 10:48:49 +0200, Hannes Magnusson a écrit : > > Are you intentionally ignoring what I've said previously in the thread? > Please stop using SimpleXML as an example. You do not need @. libxml_use_internal_errors(true); > [...] > > Again. The examples you are looking for are ne

[PHP-DEV] Re: RFC: Replacing errors with Exceptions

2009-07-29 Thread Alban
Le Fri, 24 Jul 2009 15:23:21 +0200, user a écrit : > I published a (work in progress) RFC today about replacing certain > errors with exceptions. I know that there already was something similiar > on the php6dev blog, but this is not completly the same, so awating your > comments: > > http://wiki

Re: [PHP-DEV] Type hinting - Request for Discussion

2009-07-10 Thread Alban
Le Fri, 10 Jul 2009 16:16:51 +0100, Alain Williams a écrit : > On Fri, Jul 10, 2009 at 10:57:22AM -0400, Alban wrote: >> Le Fri, 10 Jul 2009 14:23:24 +0100, Alain Williams a écrit : >> >> > On Fri, Jul 10, 2009 at 08:45:55AM -0400, Alban wrote: >> >> Hello

Re: [PHP-DEV] Type hinting - Request for Discussion

2009-07-10 Thread Alban
Le Fri, 10 Jul 2009 14:23:24 +0100, Alain Williams a écrit : > On Fri, Jul 10, 2009 at 08:45:55AM -0400, Alban wrote: >> Hello all, >> >> I don't understand why you focus on " Strict / Weak " question. > > It is really about: > > * type ch

Re: [PHP-DEV] Type hinting - Request for Discussion

2009-07-10 Thread Alban
Le Thu, 09 Jul 2009 21:11:31 +0200, Geoffrey Sneddon a écrit : > On 9 Jul 2009, at 18:20, Lukas Kahwe Smith wrote: > > >> On 09.07.2009, at 10:39, Paul Biggar wrote: >> I think we can take Lukas's RFC and either change it or write something based on it for weak typing only. If pe