Re: [PHP-DEV] [RFC] Simplified Array API for extensions

2013-04-03 Thread Stas Malyshev
Hi! > https://wiki.php.net/rfc/php-array-api Nice API, I am a bit worried though about conversion routines. Specifically, php_array_zval_to_double() uses different conversion algorithm than PHP's standard zval to double conversion, which may result in different results in edge cases. Also, these

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-03 Thread Stas Malyshev
Hi! > Added new constant CURL_WRAPPERS_ENABLE in (include 5.4) > https://github.com/php/php-src/commit/d7f709a032a40cb475042b43db07a4698a2488b7 I must say the process of how it was done was not very good. Not only there were no substantial discussion on adding this new thing in stable version be

Re: [PHP-DEV] Improve Warning when loading Zend Ext as PHP module

2013-04-03 Thread Stas Malyshev
Hi! > https://github.com/johannes/php-src/commit/a1301253a44de3997548cbd8f83e38d79e4c331c > the PHP module loader will, in case of an error, check for Zend > Extension symbols and give a more verbose error . Sounds like a good idea. -- Stanislav Malyshev, Software Architect SugarCRM: http://www

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-03 Thread Stas Malyshev
Hi! > There is absolutely no need for a RFC for it. > Heck, even that initial curtesy mail was more then I would have expected. Agree, no need for full scale RFC for one constant. However, sending an email to the list and actually waiting for feedback is exactly what I would expect, especially de

Re: [PHP-DEV] Proposal to document all of Zend and PHP API and SAPI layers

2013-04-05 Thread Stas Malyshev
Hi! > I am also aware of some documentation included in the PHP manual > currently, which should also be completed, and included, with all of the > API in a searchable format, just like PHP is in userland. That is a good idea. Do it :) > Ideally, it would be nice to document the AP

Re: [PHP-DEV] Re: libmagic 5.14 upgrade

2013-04-06 Thread Stas Malyshev
Hi! > I've invested more time and here's almost cleaned up patch > > http://belski.net/phpz/finfo/finfo_5.14_10.patch.gz > > The tests pass, valgrind is happy, as well Windows. I've noticed no > behaviour change, except - as the data is updated and one might see > different (eventually better) r

Re: [PHP-DEV] [PROPOSAL] add a leading backslash to classname when serializing/var_exporting

2013-04-09 Thread Stas Malyshev
Hi! > I proposal to add a leading backslash to all classnames (not only ns > names, since no harm, consistent and make sense) when doing serialize, > var_export etc. I'm not sure what this has to do with serialize. For var_export it may be useful but the use case looks kind of limited. I can'

Re: [PHP-DEV] Re: libmagic 5.14 upgrade

2013-04-11 Thread Stas Malyshev
Hi! > Just a curious question – would it be possible to add some code > directly to upstream, so you wouldn't have to engulf > yet-another-library into PHP source tree? > > It's always a security nightmare to have various copies of libraries > at various places of the system. Not sure about what

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-12 Thread Stas Malyshev
Hi! > 5.3 users might depend on some part of the behavior and have learned to > live with bugs. We shouldn't kick "features" at this stage. I agree, for 5.4 too. We had it for a long time, and however buggy or broken it is, there might be people that use it, and stable version implies promise the

Re: [PHP-DEV] OPcache optimizer improvement in PHP-5.5?

2013-04-12 Thread Stas Malyshev
Hi! > I don't think this is a safe optimization. In the following case it would > output 'b' and not 'a' which is the correct result: > > a.php: > define('FOO', 'a'); > include('b.php'); > ?> > > b.php: > define('FOO', 'b'); > echo FOO; > ?> > > It is certainly not likely for a constant to be

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-12 Thread Stas Malyshev
Hi! > I don't know who suggested getting rid of it in 5.3 or 5.4, that is > ofcourse seriously stupid thing to do. > The original request was to kill it dead in 5.5, and remove the > constant again from 5.3 and 5.4. OK, I agree with that. I think origination of this was Pierre's comment to apply

Re: [PHP-DEV] OPcache optimizer improvement in PHP-5.5?

2013-04-12 Thread Stas Malyshev
Hi! > I may commit it into master and pecl, but it means that pecl branch is > going to be ahead of PHP-5.5. In general, I think there's no harm in trying out new stuff on PECL - and marking those as alpha/beta initially - pecl has a mechanism to choose if you want only stable or also bleeding ed

Re: [PHP-DEV] Importing namespaced functions

2013-04-18 Thread Stas Malyshev
Hi! > One of the shortcomings of namespaced functions in PHP is that it is > not possible to import them as you can do with classes and > namespaces. For code that is not in the same namespace as the > function, you must always reference at least one part of the > namespace in order to call it. W

Re: [PHP-DEV] Object Type Casting

2013-04-24 Thread Stas Malyshev
Hi! > Are there any plans to add object type casting support in PHP? > > For example: > $circle = (Circle) ShapeFactory::createShape('circle'); > $circle->radius = 10; > echo $circle->getArea(); What is this supposed to do? I.e. what createShape returns and what (Circle) operator is doing to it

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Remove curl wrappers: ext/curl/config.m4 ext/curl/config.w32 ext/curl/interface.c ext/curl/php_curl.h ext/curl/streams.c ext/standard/basic_functions.c

2013-04-25 Thread Stas Malyshev
Hi! > Shouldn't we > > Keep CURL_WRAPPERS_ENABLED defined to 0 ? > > or remove it from PHP-5.4 before 5.4.15 ? > (was not included in any "official" version yet) Since the wrappers are gone, I think we should just drop it. If I don't hear any objections and nobody beats me to it, I'll do it thi

Re: [PHP-DEV] Continued try blocks

2013-04-29 Thread Stas Malyshev
Hi! > this has quite a few issues and feels like abusing exceptions for > regular control flow. > The primary issue is that "throw" is a terminating operation. A I agree. If your code can handle the problem, it should not throw. If it throws, the control should not go back there, since the code a

Re: [PHP-DEV] Continued try blocks

2013-04-30 Thread Stas Malyshev
Hi! > It's a point of view, not something the language should enforce. It is a point of view that any proper language should enforce. Languages always enforce certain style, certain ideas and certain paradigm - be it computer languages or natural languages. You can decide from now on in your lang

Re: [PHP-DEV] property de-referencing

2013-04-30 Thread Stas Malyshev
Hi! > I'm proposing we need a way to statically reference an object property - > the object property itself, not it's value: You probably have use case for that, and it should be pretty easy to write a class that does that, but why it should be in the language? It certainly doesn't look like some

Re: [PHP-DEV] property de-referencing

2013-04-30 Thread Stas Malyshev
Hi! > In C#, they had the intention to introduce the operator infoof(...) to > get the reflection, not only of properties, but of virtually everything > in the language. They abandoned the idea because it is really hard to do > that for overloaded functions and they did not want to do all that wor

Re: [PHP-DEV] property de-referencing

2013-04-30 Thread Stas Malyshev
Hi! > Any PHP dev who works with a mainstream framework does this daily, but > the frameworks rely on strings for property-names. What's wrong with strings? Just because it doesn't have three levels of objects on it, doesn't mean it's not OK to use it. > We now have static property-references, w

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-06 Thread Stas Malyshev
Hi! > Here is another example from a real case (Horde_Date) Looks like the case of doing it wrong. In most cases it doesn't even need regexp, in others, generic regexp with post-parsing would probably be more efficient as this seems to do 20+ passes through the string. -- Stanislav Malyshev, S

Re: [PHP-DEV] Continued try blocks

2013-05-07 Thread Stas Malyshev
Hi! > The feature exists in > Python: > http://stackoverflow.com/questions/574730/python-how-to-ignore-an-exception-and-proceed, I don't think it does what is proposed - except/pass just catches an exception and does nothing, it does not return in the place where exception was thrown down the st

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Stas Malyshev
Hi! > And today we have the problem that we cannot use in any useful manner > trigger_error in libraries, when we don't know where the error > originates from. You debug today trigger_error's in libraries with > putting a debug_print_backtrace behind the trigger_error. I think you Why not use a d

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Stas Malyshev
Hi! > If you do user_error('whatever') it'll show, as the line number for that > error, the line number on which that user_error() call is made. It'd be > nice if you could control the line number and file name that was displayed. > eg. If you need additional information to accompany the error,

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Stas Malyshev
Hi! > Classes without the ability to overload the comparison operator could be > considered kinda useless as well. That's demonstrably false - classes are very useful right now in PHP yet no overloading of operators exists. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Stas Malyshev
Hi! > I wrote https://wiki.php.net/rfc/comparable a couple of years ago — > there's a patch there that would probably still apply without too much > work to master. About the only difference was that I didn't double > underscore the magic method (in line with both Java and PHP interfaces > like Co

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Stas Malyshev
Hi! > So the error messages your library produces have the same consistent > look and feel to them that PHP's errors do? While it may be nice, I don't think it is worth changing the PHP API for. Error messages have very defined api, which has the place in the source where they were actually produ

[PHP-DEV] 5.4.15 and PHP 5.3.25 released!

2013-05-09 Thread Stas Malyshev
Hello! The PHP development team announces the immediate availability of PHP 5.4.15 and PHP 5.3.25. These releases fix about 10 bugs. All users of PHP are encouraged to upgrade to PHP 5.4. PHP 5.3.25 is recommended for those wishing to remain on the 5.3 series. The full list of changes are recorde

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Address feature request #38917 for native SPKAC (HTML5 keygen element) support: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_spki_

2013-05-10 Thread Stas Malyshev
Hi! >> Any chance of getting this into PHP 5.5? This patch has been waiting >> around since 2006 ... > > I had to say no, we are in RC now, no new feature. I'd say 5.5.0 probably not, but see no problem with 5.5.1 - adding new self-contained functions, which is what it seems to be doing, was l

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Address feature request #38917 for native SPKAC (HTML5 keygen element) support: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_spki_

2013-05-11 Thread Stas Malyshev
Hi! > I'd to disagree. Besides the lack of testing (openssl is stable, or do > we begin to say feature a is not and feature b is beta but everything > else is stable?), the nightmare about what is available in which > version is really not what we should do. Where's the "nightmare"? Each function

Re: [PHP-DEV] [RFC] Internal operator overloading and GMP improvements

2013-05-12 Thread Stas Malyshev
Hi! > Why would this be confusing? I'd agree if this happened in userland (people > could wonder why the operators are swapped), but internally we are already > dealing with this anyway. E.g. when you implement compare_objects you have > to be aware of this (to understand stuff like the return 1 t

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Address feature request #38917 for native SPKAC (HTML5 keygen element) support: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_spki_

2013-05-12 Thread Stas Malyshev
Hi! > Not really, features freeze means features free, not less not much. We > can't keep adding things endlessly and expect a release in a > foreseeable period. You seem not have misunderstood me, I was talking about 5.5.1, i.e. post 5.5.0 release. > Those with interest to have them in PECL. It

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Address feature request #38917 for native SPKAC (HTML5 keygen element) support: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_spki_

2013-05-13 Thread Stas Malyshev
Hi! > I did not, it makes little difference. We agreed that new features go > to php-next not in next point release, avoiding the mess about > figuring out which one gets in which point release. No we did not agree to that. We never agreed to nothing being added in point releases at all, and it m

Re: [PHP-DEV] Memory leak in include()/require() ?

2013-05-16 Thread Stas Malyshev
Hi! > hi, did anyone come across the memory leak of require()/include(), > I just saw this bug report: https://bugs.php.net/bug.php?id=47038, > but it was closed with nothing explained. This bug report was closed because the bug it describes was fixed. It is explained so right on the bug page.

Re: [PHP-DEV] Memory leak in include()/require() ?

2013-05-16 Thread Stas Malyshev
Hi! > I found that the memory leak is actually related to APC, > even with the latest version of PHP (5.3.25) and latest version of APC > (3.1.13), Please submit the bug on bugs.php.net with package "apc" - putting there reproducing script and describing exactly what you see when it is running.

[PHP-DEV] Re: [PHP-CVS] com php-src: Add optional second arg to unserialize(): ext/standard/basic_functions.c ext/standard/tests/serialize/serialization_error_001.phpt ext/standard/tests/serialize/uns

2013-05-17 Thread Stas Malyshev
Hi! > Imho this should have been briefly discussed on internals beforehand. At > least to me this seems rather dubious (why is it needed? why are you > manually parsing a part of the DLL serialization?) and also clashes with > Stas' proposed changes to unserialize. I don't remember any discussion

Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale?

2013-05-23 Thread Stas Malyshev
Hi! > I'm probably not the typical PHP user; I spend 99% of my PHP time > using the CLI (and not web SAPIs). > This means that I frequently run PHP without an .ini file. As a I'm not sure how this follows - CLI is capable of using ini file just like the rest of SAPIs. Why not create it? > The "U

Re: [PHP-DEV] Bug #64910: Line number of $e = new Exception vs. line number of throw $e

2013-05-23 Thread Stas Malyshev
Hi! > Derick agrees with me that this is a bug. We propose to update the file > and line properties of the exception object in the > zend_throw_exception_internal() and zend_throw_exception() functions. > > Would such a change be accepted? Does it require an RFC? On one hand, I think it make

Re: [PHP-DEV] Cannot call constructor

2013-05-23 Thread Stas Malyshev
Hi! > Right now, to avoid this situation, you have to do: > if (method_exists(get_parent_class(), '__construct')) > parent::__construct(); > > If you don't check for the method existing, you get: > Fatal error: Cannot call constructor ... This makes a lot of sense. I think we also discussed this

Re: [PHP-DEV] Bug #64910: Line number of $e = new Exception vs. line number of throw $e

2013-05-23 Thread Stas Malyshev
Hi! >> the code does "throw new", it is always useful. So how you would >> propose >> to solve this? > > rethrow $e; Yes, this is definitely an option, but requires a new keyword. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Inter

Re: [PHP-DEV] Bug #64910: Line number of $e = new Exception vs. line number of throw $e

2013-05-24 Thread Stas Malyshev
Hi! > As a PHP programmer, I would always expect the file/line to refer to > the throw statement that has thrown it last. If I wanted to keep track It is rather surprising that you would expect that as a PHP programmer, since it never worked this way in PHP, and no PHP code works this way either.

Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale?

2013-05-25 Thread Stas Malyshev
Hi! > I did not do a very good job explaining what I meant. I meant to say > that requiring the timezone to be set prevents you from running > without an ini file without any warnings. This is a big annoyance. If you insist on using the tool in a wrong way, you will be annoyed as the tool would n

Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale?

2013-05-26 Thread Stas Malyshev
Hi! > As more and more site/services are being hosted in the cloud, allowing > requests to be handled locally geographically, in different timezones, > does it make ANY sense in setting a timezone at all other than UTC? There's no relation between location of the server/site and the timezone. If

Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale?

2013-05-26 Thread Stas Malyshev
Hi! > Which is really not that nice. Why is running without an ini file even > an option if it's punished by default behavior? So you want -n to be removed? Probably is not going to happen. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 --

Re: [PHP-DEV] Proposal for better UTF-8 handling

2013-05-26 Thread Stas Malyshev
Hi! > I agree with Nikita — I'm not against adding more Unicode/charset > handling functions if they make sense (and I haven't looked at the > code for this particular proposal yet), particularly if they'd be part > of a default build, but enough water has hopefully passed under the Did you mean

Re: [PHP-DEV] Proposal for better UTF-8 handling

2013-05-27 Thread Stas Malyshev
Hi! > I did mean would — one issue with much of our internationalisation > code is that it's in extensions (intl, iconv, mbstring) that are > inconsistently deployed by shared hosting providers. Having some basic Shared hosting providers are completely capable of building their PHP offerings the

Re: [PHP-DEV] [VOTE] CURLFile uploading API

2013-06-03 Thread Stas Malyshev
Hi! > I recently gave a presentation on the upcoming php version, and somebody > asked why did we introduce an OOP way for this when everything else in > ext/curl is procedural. It needed an object, so it had the object API. Since people also asked for procedural way to create it (no idea why, bu

[PHP-DEV] PHP 5.4.16 and PHP 5.3.26 released!

2013-06-06 Thread Stas Malyshev
Hello! The PHP development team announces the immediate availability of PHP 5.4.16 and PHP 5.3.26. These releases fix about 15 bugs, including CVE-2013-2110. All users of PHP are encouraged to upgrade to PHP 5.4.16. PHP 5.3.26 is recommended for those wishing to remain on the 5.3 series. For sour

Re: [PHP-DEV] [RFC] Internal operator overloading and GMP improvements

2013-06-07 Thread Stas Malyshev
Hi! > If there is no more feedback on the RFC, then I'll start voting in a day or > two. I would suggest splitting this RFC into two - the operator overloading one and the GMP one. Converting GMP to objects has little to do with overloading (even if needed for GMP to benefit from it) so I think i

Re: [PHP-DEV] PHP 5.4.16 and PHP 5.3.26 released!

2013-06-08 Thread Stas Malyshev
Hi! > Yes, they should be made public. Not doing this is a process issue. Rather absence of process issue - right now we pretty much have no process of handling security bugs. I'm trying to do what makes sense but sometimes things fall through the cracks - like forgetting to check all the bugs fo

Re: [PHP-DEV] [RFC] Internal operator overloading and GMP improvements

2013-06-08 Thread Stas Malyshev
Hi! > My main interest here is improving the usability of GMP - the operator > overloading is just a means to that goal. With that in mind, I think it I understand that, but operator overloading is not the GMP-only change. It is a change deep in the core of the engine, and as such should be consi

Re: [PHP-DEV] PHP 5.4.16 and PHP 5.3.26 released!

2013-06-08 Thread Stas Malyshev
Hi! > be great. (Perfect would be if that script would also translate NEWS > to HTML, see README.RELEASE_PROCESS for HTML requirements .. even Something like this: https://gist.github.com/smalyshev/5736464 If it looks good, I'll add it into phpWeb/bin. -- Stanislav Malyshev, Software Architect

Re: [PHP-DEV] Re: #53437

2013-06-10 Thread Stas Malyshev
Hi! > As I mentioned previously, that small piece is easy fixable, though it > possibly makes that place not portable between 32 and 64 bit. The main > intention is to fix the unserialization crash, which IMHO interleaves this > small deviation. What you mean by not portable? Different code, diff

Re: [PHP-DEV] Re: #53437

2013-06-10 Thread Stas Malyshev
Hi! > Stas, Johannes? We have to fix this crash, in one way or another. The > current patch is good imo. I'm ok with this in 5.4 but I'd really like to fix the var_dump issue if possible. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- P

Re: [PHP-DEV] PHP 5.4.16 and PHP 5.3.26 released!

2013-06-10 Thread Stas Malyshev
Hi! > Please also add html escaping for the entry (some entres contain i.e. "->") Done, added it to bin/news2html on phpweb. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscri

[PHP-DEV] Re: test bug60322

2013-06-13 Thread Stas Malyshev
Hi! > tests/output/bug60322.phpt - var_dump(ob_get_clean()); prints > string(0) "" instead of bool(false); > 5.3/4/5 recent builds Produces false for me. As it should be. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PH

[PHP-DEV] Re: test bug60322

2013-06-13 Thread Stas Malyshev
Hi! > Fails on 5 boxes here. > > What's your settings? It would be much more useful to know what is *your* settings, since it is where the tests are failing. But never mind, I think I know where the problem is. The loop in the test: while(ob_get_clean()); is wrong, since it would terminate at

[PHP-DEV] pull reqs broken in bugs.php.net?

2013-06-16 Thread Stas Malyshev
Hi! I've noticed some strange things happening with pull requests links in bugs.php.net. For example, this one: https://bugs.php.net/bug.php?id=64549 Has link to completely unrelated php-gtk pull. I don't even see why would they link - there's nothing in common between the two. How it happened?

Re: [PHP-DEV] About to end 5.3

2013-06-20 Thread Stas Malyshev
Hi! > Good bye 5.3, you were a great step for PHP! > Looking forward to a bright and open future! Thank you Johannes for all you work on 5.3! -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing L

Re: [PHP-DEV] Disabling the GC during shutdown

2013-06-20 Thread Stas Malyshev
Hi! > Yes, that is what's happening here. zval_mark_grey() is trying to walk > through the object's hash table, but the first bucket is already freed, so > when it tries to access it bad things happen. Why is this specific to shutdown? Hashtables are freed all the time, what specific shutdown is

Re: [PHP-DEV] Case insensitivity no longer locale specific

2013-06-20 Thread Stas Malyshev
Hi! > I'd like to put an example in the 5.5 migration documentation for the > "Case insensitivity no longer locale specific" section. Can someone > please provide one? Some locales (Turkish one for example) have very unexpected rules of lowercasing and uppercasing - IIRC Turkish locale lowercase

Re: [PHP-DEV] Disabling the GC during shutdown

2013-06-20 Thread Stas Malyshev
Hi! > Honestly, I am not sure. Every report that I've seen has it happening at > shutdown. Could very well be a coincidence. Well, if we don't know why or if it's shutdown only, disabling on shutdown wouldn't do much good. > I have a patch which prevents the > segfault: > https://github.com/i

[PHP-DEV] Fix for grapheme bug 61860

2013-06-23 Thread Stas Malyshev
Hi! I've started working on fixing bug #61860 (where grapheme case insensitive functions mess up offsets for complex case folding) and ended up rewriting the string search functions to use proper ICU API for that - USearch. All tests seem to be passing just fine, and it is what it should be doing

Re: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-25 Thread Stas Malyshev
Hi! > In such a case you do not need any `$e`variable. Netbeans for example > always highlight's these variables because it is not used anywhere. > But I think it looks a bit cleaner if the variable could be omitted, > if it's not needed ;-) I don't think we need to change the language because Ne

Re: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-25 Thread Stas Malyshev
Hi! > IMO actually it *makes* the code clearer, because $ignoredException is > not used, though a variable name like $ignored is self-explanatory, > too. It's not used by you - which btw is usually not a good idea - if you've got an exception, you usually should somehow react to it - at least log

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-25 Thread Stas Malyshev
Hi! > Hey all, > > I want to throw out this draft RFC to get the concept floating around and > get feedback early. > > https://wiki.php.net/rfc/protocol_type_hinting I'm not sure I understand why it is good to have this. This way of checking interfaces is very expensive (since you need to scan

Re: [PHP-DEV] RE: Announcing RFC 'Anonymous Catches'

2013-06-25 Thread Stas Malyshev
Hi! > If I'm to understand this RFC correctly, it is nothing more than a > random suggestion someone posed in the form of a tweet and the author is > saying why not add it since it's not hard to implement. So in summation Well, here we go - this is why not add it, because it makes working with su

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-25 Thread Stas Malyshev
Hi! > This may sound trivial, but imagine this. Right now Zend and Symfony have > very similar providers for certain tasks. One of the ones that comes to > mind (besides logging) is caching. If you want to use a Zend component in > an Symfony app while still using caching today, you'd need to shim

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-25 Thread Stas Malyshev
Hi! > See my reply to Laruence, it's not more expensive... I don't see how you can see it's not - it does method matching on every call. It just doesn't make sense that doing something N times is faster than doing something 1 time. That may be true only if you load classes you don't ever need (no

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-25 Thread Stas Malyshev
Hi! > Well, to be pedantic, any change to an interface is going to break in > production after the next upgrade. No matter what you're doing. Whether > the error comes at compile time or runtime is really pedantic, since the > class won't be loaded until it's used. So you may not hit it at compile

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-25 Thread Stas Malyshev
Hi! > So nobody should ever use libraries, because they can't be sure of that > code... So... Libraries have classes and interfaces for exactly this reason - so you can be reasonably sure what's in them or at least have easy way to check it. > It's checking that fatal method-not-defined erros wo

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-06-26 Thread Stas Malyshev
Hi! > Currently PHP doesn't support what could be a good feature for code > quality, return typing (or if you prefer to call it: return type > hinting). What changed since the last time we discussed this? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-26 Thread Stas Malyshev
Hi! > I think we should. And I think we should turn all non-engine related > fatals into exceptions. But both are beyond the scope of this proposal... So, the question of what is the difference between the two errors remains unanswered. If the whole diff is that one of the errors has word "recove

Re: [PHP-DEV] UNKNOW:0, what is it?

2013-06-26 Thread Stas Malyshev
Hi! > Again, I have a segfault with RecursiveDirectoryIterator when I extend > it. This time, I have a very strange value on my SplFileInfo extension > (subclass). When I var_dump the value, I have UNKNOWN:0. This is not a > string, not null, not false, just UNKNOW:0, without type. Any idea of

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-27 Thread Stas Malyshev
Hi! > > I'm assuming that you do know the difference between > E_RECOVERABLE_ERROR and E_ERROR. And the difference is not trivial... Could you please explain what is the non-trivial difference relevant to this case and how it is relevant? Could you also explain why making undefined function produc

Re: [PHP-DEV] RFC: Protocol Type Hinting

2013-06-27 Thread Stas Malyshev
Hi! > No, my point was that you pulled the card "those languages don't have > these structural typing thigns". And I showed one reason they don't. Sorry, it was you who pulled the card of "other dynamic languages have duck typing". I have showed that what other dynamic languages have and what the

Re: [PHP-DEV] Cherry picking #60560 for php 5.4

2013-06-28 Thread Stas Malyshev
Hi! > Bug #60560 was fixed in trunk while PHP 5.4 was in its RC phases. The fix > was never merged back to the 5.4 branch, meaning it's only avaailable on > the 5.5 release. > > Could we cherry pick it for the 5.4 branch ? > > The relevant commit is > http://git.php.net/?p=php-src.git;a=commit;h

Re: [PHP-DEV] session.name limitation fix or not fix?

2013-06-28 Thread Stas Malyshev
Hi! > I was browsing bugs and found old feature request that can be fixed easily. > > Request #35703 when session_name("123") consist only digits, should warning > https://bugs.php.net/bug.php?id=35703&thanks=1 > > session.name cannot be integer like string, since it will be initialized as > "lo

Re: [PHP-DEV] Session Id Collisions

2013-06-28 Thread Stas Malyshev
Hi! > Sorry for the delay. > I've finally updated the strict session patch. I'll review it ASAP, probably on the weekend. Unfortunately, we've missed the window for 5.5 API changes, if there's any API change, but we can still do it in master. -- Stanislav Malyshev, Software Architect SugarCRM:

[PHP-DEV] IntlTimeZone::getOffset?

2013-06-30 Thread Stas Malyshev
Hi! I have a question about IntlTimeZone::getOffset - what is the first parameter it accepts? Is it UTC timestamp? The type is double, but I'm not sure what exactly this double is supposed to mean. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

[PHP-DEV] Re: IntlTimeZone::getOffset?

2013-06-30 Thread Stas Malyshev
Hi! > It can be a UTC timestamp (if $local is false), but note it's in > milliseconds since the epoch, not seconds. The documentation is here: It looks like it's the only place in PHP where we represent date this way. Given that this function has no docs at all, it's even more confusing. Can't w

[PHP-DEV] Re: IntlTimeZone::getOffset?

2013-06-30 Thread Stas Malyshev
Hi! > This is not correct. Some functions in IntlCalendar also use this > direct representation of UDate, see e.g. > > http://pt2.php.net/manual/en/intlcalendar.getnow.php > http://pt2.php.net/manual/en/intlcalendar.gettime.php OK, I see. > As far as I know, there's not any strictly technical

Re: [PHP-DEV] Re: [VOTE] Apparmor change_hat functionality for php-fpm

2013-07-02 Thread Stas Malyshev
Hi! > I closed the vote. And I'm wondering if there is a minimum number of votes > a proposal needs to get accepted? > Well if there isn't it is accepted, and I'll move it to the right section. It looks like it is a pretty specialized feature, so no wonder it didn't have too many people voting. I

Re: [PHP-DEV] String Size Refactor Progress

2013-07-03 Thread Stas Malyshev
Hi! > The problem is that changing 's' from int to size_t can (and does) cause > segfaults. But if we refactor string lengths to be size_t, we can not allow code that still relies on it being int, if sizeof(size_t) != sizeof(int). It would just produce wrong length. I'd actually prefer segfault

[PHP-DEV] PHP 5.4.17 released!

2013-07-04 Thread Stas Malyshev
Hello! The PHP development team announces the immediate availability of PHP 5.4.17. About 20 bugs were fixed. All users of PHP are encouraged to upgrade to this release. For source downloads of PHP 5.4.17 please visit our downloads page: http://www.php.net/downloads.php Windows binaries can be f

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-07-11 Thread Stas Malyshev
Hi! > Thanks for your input Sara, everything sounds very interesting. In all > fairness I haven't looked at HHVM but I from what you described about > this particular feature sounds good. > > Should I conclude that there's enough interest for this feature and > move from a gist to a RFC? If so, I

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-07-11 Thread Stas Malyshev
Hi! > 1) HHVM isn't just running FB. A number of sites have either already started using HHVM, or intend to soon. Were could I read about those? > 2) The "static compilation" description is grossly outdated information. I guess my knowledge about HHVM is a bit out of date, which is no wonder a

Re: [PHP-DEV] Pull requests report (17/7/2013)

2013-07-17 Thread Stas Malyshev
Hi! > What do you think about closing older PR ( > 28 days) ? I think we shouldn't do this - some of them are for RFCs that are being worked on or discussed or proposed, so unless we know it's a stale patch that is abandoned or will never be merged we shouldn't close them. -- Stanislav Malyshev

Re: [PHP-DEV] Pull requests report (17/7/2013)

2013-07-18 Thread Stas Malyshev
Hi! > Indeed we started with the easy ones... there isn't any reason simple > patches > won't get merged very quickly. There's a very simple reason - there are not enough people with enough knowledge about PHP internals to properly evaluate patches that do it on regular basis. Even the simplest p

Re: [PHP-DEV] SPL Binary Tree, Graph

2013-07-18 Thread Stas Malyshev
Hi! > I would like to ask you what is your opinion about implementing Binary Tree > and Graph data structures in SPL in addition to existing ones? IMHO it Sure, why not? But I'd suggest first proposing the API for the classes in the form of the RFC (https://wiki.php.net/rfc) and explanation what

Re: [PHP-DEV] Compatibility changes for 5.5

2013-07-18 Thread Stas Malyshev
Hi! > Much the same as https://bugs.php.net/bug.php?id=49348 since 5.5 > trying to access an uninitialized property of an object throws a > notice but isn’t listed anywhere as a change that I can see. Read access to uninitialized variable should produce notice, that's how it was in PHP for very l

Re: [PHP-DEV] Compatibility changes for 5.5

2013-07-19 Thread Stas Malyshev
Hi! > Understood. But given for the entire 5 series it was valid I feel people > finding their code randomly breaking now would expect to see it in the > documentation somewhere. It is still valid, and still works the same, just produces notice. -- Stanislav Malyshev, Software Architect SugarCR

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-20 Thread Stas Malyshev
Hi! > I cannot believe this is true now, but I ask list before I fix doc. I don't think there's something that needs to be fixed. "Undefined" means "it depends on implementation and we do not want to commit to a specific behavior here because implementations may change". This is a fair warning ag

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-20 Thread Stas Malyshev
Hi! >> If there aren't comments, I'll rewrite the example. >> >> >> There were comments. I explicitly told you that that the behavior is > defined as undefined. You CHOSE to ignore that comment. You CHOSE to > break the documentation. Besides that, asking for comments and committing the same d

Re: [PHP-DEV] Language constructs and callability

2013-07-20 Thread Stas Malyshev
Hi! > Is there a reason that echo/print couldn't be implemented as functions > with some sort of backwards compatibility layer? isset/etc make sense to Yes, the reason is not fixing what isn't broken :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ex

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-20 Thread Stas Malyshev
Hi! > I agree that we should not rush to commit changes in the midst of > on-going discussion. However, I have to just add to this notion of > undefined behavior that by your definition ALL of PHP is undefined > behavior. Everything we do is an implementation detail. What This is certainly not tr

[PHP-DEV] phar bug #65028

2013-07-22 Thread Stas Malyshev
Hi! I was looking at bug https://bugs.php.net/bug.php?id=65028 and looks like it happens because phar writes manifest after HALT_COMPILER(); ?> and first 4 bytes of manifest are manifest length (little-endian), but when it read the header, it checks if there's \r\n after ?>. So if length has lowes

[PHP-DEV] warning in php_spl.c

2013-07-22 Thread Stas Malyshev
Hi! Building PHP 5.5 with newer compiler on Mac, I'm getting this warning: /Users/smalyshev/php-5.5/ext/spl/php_spl.c:803:35: warning: format specifies type 'unsigned int' but the argument has type 'intptr_t' (aka 'long') [-Wformat] spprintf(&hex, 32, "%016x%016x", hash_handle, hash

Re: [PHP-DEV] [RFC] Importing namespaced functions

2013-07-23 Thread Stas Malyshev
Hi! > But actually I don't see: Why is "use" not enough? As far as I can see your > example, why it would introduce a BC, doesn't really match to original Consider this: use a\b\c as foo; foo(); Now it would resolve to global function foo(). If use were changed to apply to functions, it would

Re: [PHP-DEV] [RFC] Importing namespaced functions

2013-07-23 Thread Stas Malyshev
Hi! > But if I explicitly import "foo" this way, this is intended :? No, it's a BC break and as such is not acceptable. > Additional I have _never_ seen any core- or user-function, whose name > could be a classname to. Of course I've never seen every function ever > written, but even if this a

<    4   5   6   7   8   9   10   11   12   13   >