Re: [PHP-DEV] Bug tracker cannot connect to database
WORKSFORME Details? On Thu, Nov 19, 2009 at 11:38 PM, Edward Z. Yang ezy...@mit.edu wrote: I don't know if this is the right list to report to, but bugs.php.net is currently non-functional. Cheers, Edward -- 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] Bug tracker cannot connect to database
Derick jumpstarted mysql on the server just now. -Hannes On Fri, Nov 20, 2009 at 09:17, Ronald Chmara rona...@gmail.com wrote: WORKSFORME Details? On Thu, Nov 19, 2009 at 11:38 PM, Edward Z. Yang ezy...@mit.edu wrote: I don't know if this is the right list to report to, but bugs.php.net is currently non-functional. Cheers, Edward -- 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Closures and $this
On Thu, Nov 19, 2009 at 4:29 PM, Jelrik van Hal jelri...@jelrikvh.nl wrote: Victor, I do wholeheartedly agree with you about the mess things will be when allowing $this to refer to different things in different contexts of calling the same closure (B, C and D): I think it'll prove very difficult to keep track of which call will end up doing exactly what in which environment. I think any mechanism for rebinding $this (whether automagical or explicit) will be too, well, weird. I can imagine a system of rebinding $this being both consistent and useful, but it adds too much complexity: to understand what's going on, you not only need to understand closures, but you need to know how they interact with PHP's OO system, you need to know what rebinding is (it doesn't happen anywhere else that I can think of), and you need to know how the rebinding system works. JavaScript's approach actually fairly confusing--and this is despite the fact that the language has always had it. Also, I'm wondering why people think there should be a $this inside a closure. As stated in the RFC/Wiki, closures are not thought out to be used alongside OO-code. Why would we want to couple them? I see the use of closures, but not as OO-related tools using $this. What is the problem with proposal (0), leaving it as it is now? I do think it would be nice if function() use ($this) { ... } worked, and bound $this in the same way that it bound any other variable, instead of producing Cannot use $this as lexical variable. This would eliminate the need to do: $obj = $this; $fn = function() use ($obj) { // use $obj as if it were $this } Was this how things used to work, before http://wiki.php.net/rfc/closures/removal-of-this happened? Michael -- http://beebo.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: clarification on maximum string sizes in PHP on 64 bit linux
The problem with the segfault in memcpy from bug 50207 was that the pointer result-value.str.val is a 64 bit unsigned integer, and of course result-value.str.len is a signed 32 bit integer. The value of you're right, len is declared as int and it's indeed 32bit under 64bit Linux. It must be changed to long in order to have proper arithmetic with strings longer than 0x7fff bytes. I think it can't be changed in neither 5.2 nor 5.3, or it will break binary compatibility. Perhaps the change should be submited into 5.4 and 6.0 branches. -jv -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] SVN Account Request: ondercsn
I have many projects about php ( not coding for an application or website; directly about php functions etc.) and would like to help to improve php. For example asterisk server functions. That's why i need an svn account to help developing of php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-DOC] __autoload() and exceptions
On Fri, Nov 20, 2009 at 20:51, Brandon Savage bran...@brandonsavage.net wrote: All, I was playing around today with the autoload functions and I discovered that in PHP 5.3, __autoload() can throw, and scripts can catch, exceptions. This is in direct contradiction to the documentation: http://php.net/manual/en/language.oop5.autoload.php I have filed a bug report with the internals team (http://bugs.php.net/bug.php?id=50250) in the event that this behavior is unintended; however, if this is in fact a new feature in PHP 5.3, I want to make sure that we document it properly. Does anyone know the true story? Thats a good question, and of the top of top of my head I don't recall any commits or discussion about this. So, is this intended behavior as of PHP 5.3.0 or may this change again in the future? -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-DOC] __autoload() and exceptions
On Nov 20, 2009, at 3:05 PM, Hannes Magnusson wrote: On Fri, Nov 20, 2009 at 20:51, Brandon Savage bran...@brandonsavage.net wrote: All, I was playing around today with the autoload functions and I discovered that in PHP 5.3, __autoload() can throw, and scripts can catch, exceptions. This is in direct contradiction to the documentation: http://php.net/manual/en/language.oop5.autoload.php I have filed a bug report with the internals team (http://bugs.php.net/bug.php?id=50250) in the event that this behavior is unintended; however, if this is in fact a new feature in PHP 5.3, I want to make sure that we document it properly. Does anyone know the true story? Thats a good question, and of the top of top of my head I don't recall any commits or discussion about this. So, is this intended behavior as of PHP 5.3.0 or may this change again in the future? -Hannes Therein seems to lay the question. As I said, I filed a bug, so we'll see if it gets closed as bogus or not. If it does I'll change the documentation myself. Brandon -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] SVN Account Request: ondercsn
nder coskun wrote: I have many projects about php ( not coding for an application or website; directly about php functions etc.) and would like to help to improve php. For example asterisk server functions. That's why i need an svn account to help developing of php This README should help get you started: http://svn.php.net/viewvc/php/php-src/trunk/README.SUBMITTING_PATCH?view=markup Chris -- Blog: http://blogs.oracle.com/opal Twitter: http://twitter.com/ghrd -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Intervals representation with brackets
Hello, I'm working on two classes, Interval and IntervalList which describe an interval and a list of intervals. These intervals are defined using the Interval class: ?php $interval = new Interval((int) $from, (int) $to); ? These intervals can be stored in a list of intervals, using IntervalList: ?php $list = new IntervalList(); $list-add($interval_1); $list-add($interval_2); ? IntervalList's functions are: - inverse(); which returns an IntervalList object - intersection(); which returns an IntervalList object of intervals which are contained by every interval of this list. To be easier, what do you think about: ?php // An interval with [ ] $interval = [ (int) $from, (int) $to ]; ? ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? Regards, Samuel ROZE. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Intervals representation with brackets
On Fri, Nov 20, 2009 at 22:56, Samuel ROZE samuel.r...@gmail.com wrote: [...] ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? This made no sense to me. Are you suggesting new object operator? Short-syntax-array? What exactly are you asking/informing/reporting/whatever? -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Intervals representation with brackets
http://code.google.com/p/foundation-kit/source/browse/trunk/FKRange.php http://code.google.com/p/foundation-kit/source/browse/trunk/FKIndexSet.php On Fri, Nov 20, 2009 at 1:56 PM, Samuel ROZE samuel.r...@gmail.com wrote: Hello, I'm working on two classes, Interval and IntervalList which describe an interval and a list of intervals. These intervals are defined using the Interval class: ?php $interval = new Interval((int) $from, (int) $to); ? These intervals can be stored in a list of intervals, using IntervalList: ?php $list = new IntervalList(); $list-add($interval_1); $list-add($interval_2); ? IntervalList's functions are: - inverse(); which returns an IntervalList object - intersection(); which returns an IntervalList object of intervals which are contained by every interval of this list. To be easier, what do you think about: ?php // An interval with [ ] $interval = [ (int) $from, (int) $to ]; ? ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? Regards, Samuel ROZE. -- 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] Intervals representation with brackets
Samuel ROZE wrote: Hello, I'm working on two classes, Interval and IntervalList which describe an interval and a list of intervals. These intervals are defined using the Interval class: ?php $interval = new Interval((int) $from, (int) $to); ? These intervals can be stored in a list of intervals, using IntervalList: ?php $list = new IntervalList(); $list-add($interval_1); $list-add($interval_2); ? IntervalList's functions are: - inverse(); which returns an IntervalList object - intersection(); which returns an IntervalList object of intervals which are contained by every interval of this list. To be easier, what do you think about: ?php // An interval with [ ] $interval = [ (int) $from, (int) $to ]; ? ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? No chance that top-level square brackets will mean intervals, sorry. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Intervals representation with brackets
Are you suggesting new object operator? Short-syntax-array? Short-syntax-interval ! :-) What exactly are you asking/informing/reporting/whatever? I'm just asking if, for you, brackets can represent intervals... -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Intervals representation with brackets
It's clear. ;-) Thanks. 2009/11/20 Rasmus Lerdorf ras...@lerdorf.com: Samuel ROZE wrote: Hello, I'm working on two classes, Interval and IntervalList which describe an interval and a list of intervals. These intervals are defined using the Interval class: ?php $interval = new Interval((int) $from, (int) $to); ? These intervals can be stored in a list of intervals, using IntervalList: ?php $list = new IntervalList(); $list-add($interval_1); $list-add($interval_2); ? IntervalList's functions are: - inverse(); which returns an IntervalList object - intersection(); which returns an IntervalList object of intervals which are contained by every interval of this list. To be easier, what do you think about: ?php // An interval with [ ] $interval = [ (int) $from, (int) $to ]; ? ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? No chance that top-level square brackets will mean intervals, sorry. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Intervals representation with brackets
Hi, This isn't bad, but it's not really what i want, and... what I wrote! ;-) Samuel. 2009/11/20 mm w 0xcafef...@gmail.com: http://code.google.com/p/foundation-kit/source/browse/trunk/FKRange.php http://code.google.com/p/foundation-kit/source/browse/trunk/FKIndexSet.php On Fri, Nov 20, 2009 at 1:56 PM, Samuel ROZE samuel.r...@gmail.com wrote: Hello, I'm working on two classes, Interval and IntervalList which describe an interval and a list of intervals. These intervals are defined using the Interval class: ?php $interval = new Interval((int) $from, (int) $to); ? These intervals can be stored in a list of intervals, using IntervalList: ?php $list = new IntervalList(); $list-add($interval_1); $list-add($interval_2); ? IntervalList's functions are: - inverse(); which returns an IntervalList object - intersection(); which returns an IntervalList object of intervals which are contained by every interval of this list. To be easier, what do you think about: ?php // An interval with [ ] $interval = [ (int) $from, (int) $to ]; ? ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? Regards, Samuel ROZE. -- 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Intervals representation with brackets
Hello, Even if you are introducing a new syntax, your approach is wrong to get intersection and interval, I was not talkative but the samples I gave you expose several cases // This isn't bad, but it's not really what i want, and... what I wrote! ;-) so I guess you don't even understand what your are doing ? playing with range, you may read the documentation about those objects into the Apple Foundation those are following the same model, dealing with list of ranges. anyway what you exposed was really unclear, try to be more didactic, we don't have crystal balls, and somehow Ijust trolled you like you did, so please we are people we need a context. Best, On Fri, Nov 20, 2009 at 2:22 PM, Samuel ROZE samuel.r...@gmail.com wrote: Hi, This isn't bad, but it's not really what i want, and... what I wrote! ;-) Samuel. 2009/11/20 mm w 0xcafef...@gmail.com: http://code.google.com/p/foundation-kit/source/browse/trunk/FKRange.php http://code.google.com/p/foundation-kit/source/browse/trunk/FKIndexSet.php On Fri, Nov 20, 2009 at 1:56 PM, Samuel ROZE samuel.r...@gmail.com wrote: Hello, I'm working on two classes, Interval and IntervalList which describe an interval and a list of intervals. These intervals are defined using the Interval class: ?php $interval = new Interval((int) $from, (int) $to); ? These intervals can be stored in a list of intervals, using IntervalList: ?php $list = new IntervalList(); $list-add($interval_1); $list-add($interval_2); ? IntervalList's functions are: - inverse(); which returns an IntervalList object - intersection(); which returns an IntervalList object of intervals which are contained by every interval of this list. To be easier, what do you think about: ?php // An interval with [ ] $interval = [ (int) $from, (int) $to ]; ? ?php // A list of intervals $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; $list_2 = [$from_1, $to_1] + ... + $interval_n; ? Regards, Samuel ROZE. -- 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] suggestion about ternary operator
hi all, Since the new conditionnal operator ternary was introduced in php 5.3, I'm little confuse about it. The documentations says : Since PHP 5.3, it is possible to leave out the middle part of the ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise. I think it is not very usefull because most of the time, in PHP, we need to check the existance only of a var or return a default value. $foo = isset($myArray['foo']) ? $myArray['foo'] : 'default'; I can't use the new syntax for that : // raise a warning if $myArray['foo'] not exists and return 'default' $foo = $myArray['foo'] ?: 'default'; // return 'default' if $myArray['foo'] not exists or equals '', 0, false, null $foo = @$myArray['foo'] ?: 'default'; // return true or 'default' $foo = isset($myArray['foo']) ?: 'default'; This is the same thing like using if (isset($var)) instead of if ($var), developpers always use isset() because they known that cause a warning with array and this can be evaluated to false. If they want test if $var equals 0, '' or null, they use empty(). I don't know about you, but personnaly, I use certainly 99 % of the time isset() and 1% empty(). So if the short ternary operator would be more usefull if it just test the existance of a variable. 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 would be be lighter and clear. Since i use PHP, I always have in my 'common function file' a function like that : function getIssetVar($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] suggestion about ternary operator
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 array. Code would be be lighter and clear. I cannot comment on the rest of your post right now, but if you are checking for the existence of a bunch of keys in an associative array and setting defaults if they are not set, the following will be considerably faster and easier to read: $my_array += array( 'a' = 'A', 'b' = 'B', 'c' = 'C', ); That will set $my_array['a'] to A iff it doesn't exist, ['b'] to B iff it doesn't exist, etc. That is far nicer to read than a bunch of ternaries, short-circuited or no. You can even stick the defaults array into a function and call it from various places to ensure your array always has the same sane defaults. -- Larry Garfield la...@garfieldtech.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] suggestion about ternary operator
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 array. Code would be be lighter and clear. I cannot comment on the rest of your post right now, but if you are checking for the existence of a bunch of keys in an associative array and setting defaults if they are not set, the following will be considerably faster and easier to read: $my_array += array( 'a' = 'A', 'b' = 'B', 'c' = 'C', ); That will set $my_array['a'] to A iff it doesn't exist, ['b'] to B iff it doesn't exist, etc. That is far nicer to read than a bunch of ternaries, short-circuited or no. You can even stick the defaults array into a function and call it from various places to ensure your array always has the same sane defaults. Yes, union operator is a pretty solution for arrays. -- Alban Leroux s...@paradoxal.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Updated RFC: Zend Signal Handling
Lucas and I have re-visited the Zend Signal Handling RFC and have updated the patches for both the 5.3 branch and Trunk: http://wiki.php.net/rfc/zendsignals We updated the patches to deal with a bug fix that allows timeouts within the user space shutdown functions, previously multiple timeouts would not occur. To deal with this we reset the signal handlers on a timeout so that the user shutdown function can once again get a signal and behave accordingly. Per the Chicago developer meeting, it was determined that the windows timeouts are not asynchronous and thus there isn't currently any special handling required for critical sections on the windows builds. We would like to hear about any other issues/feedback with this patch, and if there's no objections get this checked in as it will assist with getting more stability for signal handling (specific example is the use of spin-locks with APC). Thanks!, -shire -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php