[PHP-DEV] Fix for bug #63437

2013-03-05 Thread Anatol Belski
Hi,

I've reworked the patch from
http://nebm.ist.utl.pt/~glopes/misc/date_period_interval_ser.diff
(mentioned by tony2001) for bug #63437, that seems to fix the issue. That
patch was ported back to 5.3 and adapted to the current 5.4+. Both
variants are posted to the ticket.

Also the test for bug #52113 delivers more plausible results and should be
fixed when the patch is applied.

Regards

Anatol

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Fix for bug #63437

2013-03-05 Thread Anatol Belski
Sorry, the correct one is bug #53437 ...

On Tue, March 5, 2013 12:42, Anatol Belski wrote:
 Hi,


 I've reworked the patch from
 http://nebm.ist.utl.pt/~glopes/misc/date_period_interval_ser.diff
 (mentioned by tony2001) for bug #63437, that seems to fix the issue. That
 patch was ported back to 5.3 and adapted to the current 5.4+. Both variants
 are posted to the ticket.

 Also the test for bug #52113 delivers more plausible results and should
 be fixed when the patch is applied.

 Regards


 Anatol


 --
 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] Getting separate outputs with Date Functions

2013-03-05 Thread Paul Taulborg
On Wed, Feb 20, 2013 at 1:54 PM, David Soria Parra d...@php.net wrote:
 On 2013-02-19, Stas Malyshev smalys...@sugarcrm.com wrote:
 Hi!

 echo date_create('@1361240634')-format('Y-m-d');
 // output: 2013-02-19

 echo date('Y-m-d',1361240634);
 // output: 2013-02-18

 timestamp dates are created with UTC TZ, date() assumes your configured TZ.

 I ran into this myself and I personally consider date() assuming your
 configured TZ A bug. Timestamps are defined as UTC and the behaviour of
 DateTime is correct there, that it always assume UTC. date() should do
 the same. But then date() behaviour has been that way since ages
 and probably a lot of code out there is assuming the current TZ when
 using date().


Hi David,

I made a patch for a similar issue here:
https://bugs.php.net/bug.php?id=63615

I wonder if this would fix your issue as well.

I pulled it as a random bug fix, but did note that there is some
discrepancy on whether this is intended behavior or not. I'm with Stas
that we should either fix it and make it consistent, or document why
it isn't.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP User Survey

2013-03-05 Thread Paul Reinheimer
Hi Everyone,

So I threw this idea out there, then I sat down and tried to come up with
questions I'd want answered. There's a bunch, those questions are easy.
Then I tried to focus my questions, I wanted questions that could possibly
affect or guide the development of PHP as a language. That got much harder.
Recognizing that much of how PHP advances is scratch the itch makes it
harder still.

Here I've got a few questions, as well as my thinking behind them:

(I think this question is useful to group responses, we might see radically
different responses from people deploying to a few servers versus hundreds)
How many servers do you deploy code to
1
2-5
5-20
20-100
100+

(I'm not sure how this should steer PHP, except possibly trying to devote
more resources to package maintainers if they're a large chunk of our user
base)
How do you install PHP on your production machines
 - Package (RPM, DEV)
 - Install from source
 - Executable from php.net (windows)

(I'm not sure how this answer steers PHP as a language, but it might be
useful for trends over time?)
What server do you use in production:
 - Apache
 - IIS
 - nginx

(How quickly are these new features being picked up in the language as a
whole)
Which of the following are you using today:
 - Namespaces
 - Closures
 - [other stuff]

(Where are people, also useful for grouping results)
What version of PHP are you using in Production
--

(what motivates people to upgrade?)
When do you upgrade to a new release of php e.g. 5.3 - 5.4
 - As soon as released
 - wait for the x.1 release
 - Once our OpCode cache supports it
 - When previous version hits EOL
 - When a new feature warrants the upgrade
 - When my Framework (Zend/Symfony/cake) or Software (Wordpress, Gallery,
etc) requires it


(This, I think, is the biggest question in the survey)
Please rank the following in order of importance to you:
 - New language features
 - Language Speed
 - Language stability
 - Backwards compatibility between releases

(I think this is useful in terms of rating priorities. If everyone uses a
big framework, then we should temper their opinions against those of the
framework authors/maintainers)
Do you use any of the following frameworks (check all that apply)
 - Zend Framework
 - Symphony
 - Cake
 - Code Igniter
 - ...

(Can we convince people with C to help out in the language? Send just PHP
developers to work on tests? Documentation?)
What other languages do you know:
 - C
 - C++
 - Perl
 - Python
 - Ruby


I think you can see that I was challenged by a lot of the questions to
answer how it might affect the future of PHP. Some other questions to pull
apart classes of responses might be helpful (are you a: hosting provider,
development agency, deploying your own corporate code, etc.) but I'm really
having trouble coming up with good questions that I think could affect
things. Without those I'm not sure how useful the survey is to people on
this list.



paul




On Wed, Feb 27, 2013 at 5:38 AM, Lester Caine les...@lsces.co.uk wrote:

 Pierre Joye wrote:

 hi,

 On Wed, Feb 27, 2013 at 9:53 AM, Lester Caine les...@lsces.co.uk wrote:

  I was in a van with my son-in-law yesterday and we got around to
 discussing
 websites and the like. I run his sites, but HE uses Joomla, so although
 it's
 PHP he has no interest in the language as such as long as Joomla works.
 So
 this morning I though 'What ARE people using with PHP? expecting to see
 a
 large chunk of the 90 odd % of websites actually using PHP to be using
 something to hide that, and got something of a surprise ...
 http://w3techs.com/**technologies/history_overview/**
 content_management/allhttp://w3techs.com/technologies/history_overview/content_management/all
 makes interesting reading, and so while I was anticipating that a large
 chunk of users would be excluded from 'PHP' related questions, the
 reverse
 seems to be the truth?


 We have discussed that hundred of times in the past. However let me
 try to compare with other mainstream products, in an understandable
 way:

 a company A delivers materials to a cell manufacturer   The
 manufacturer sells ready to be used cells to end users. End users do
 not care if the cell use a chip from Company A or B as long as it
 works.

 the manufacturer reports needsfeedback to the company A, based on its
 customers feedback and needs

 PHP is the company A, Joomla/Wordpressco are the cell manufacturers.


 But the point is that apart perhaps for Wordpress, the 'cell
 manufacturers' are possibly only a very small percentage of the PHP user
 base? The piece of information we are missing is the split of users between
 'cell manufacturer' type users and those that are using PHP direct? What
 part of the 68% of people 'not using a cms system' are using some other
 'cell manufacturer' and what part are just using PHP ... but even then,
 where a 'cell manufacturer' is no longer around, the end user needs help
 from PHP to port their website ... which is were a number of my own
 

Re: [PHP-DEV] [VOTE] Improved Linux process title support in the CLI SAPI

2013-03-05 Thread Keyur Govande
On Fri, Feb 22, 2013 at 3:06 PM, Keyur Govande keyurgova...@gmail.comwrote:

 On Fri, Feb 22, 2013 at 2:59 PM, Hannes Magnusson 
 hannes.magnus...@gmail.com wrote:

 On Fri, Feb 22, 2013 at 11:52 AM, Rasmus Lerdorf ras...@lerdorf.com
 wrote:
  On 02/22/2013 11:48 AM, Hannes Magnusson wrote:
  On Thu, Feb 21, 2013 at 4:42 PM, Keyur Govande keyurgova...@gmail.com
 wrote:
  Hi everyone,
 
  With the 2 weeks discussion period up, I'm moving this RFC to the
 Voting
  stage. I'd like to get this into 5.5.
 
  Most of the reaction has been positive and is archived here:
  http://marc.info/?t=13602158203r=1w=2
 
  Just out of curiosity, I don't see it covered in the other thread; Is
  there a reason why it cannot support sapi/fpm?
 
  fpm has its own implementation already. I suppose we could swap out the
  one in fpm and replace it with this one, but that seems like a separate
  decision.

 Right, which makes me worry about the function name.. cli_*.

 -Hannes


 If FPM wants to use these too, the implementation can be easily shared and
 the wrappers around these can be created and called php_fpm_*. The reason
 for CLI in the names was to indicate the limited availability of these
 methods.


Voting is now closed. The RFC is accepted with 28 for and 1 against. Thanks
everyone!


[PHP-DEV] Memory warning hook

2013-03-05 Thread nathan
As PHP applications are turning into large frameworks one of the issues
arriving is memory management. One of the issues is that many frameworks use
sophisticated caching techniques to make accessing the same data quickly,
this improves speed it is at the cost of memory. Often the developer knows
these areas that cache and often times already have functions in place to
clear out the cache, however in the case where PHP is approaching or exceeds
memory limits PHP runs the GC then dies if it cannot allocate enough memory.
If we implemented memory warning triggers or user function that will be
called before the GC is executed which allows the user to try and free up
some memory on their own. This hopefully would give more flexibility to
allowing these advanced caching techniques but at the same time allow the
cache to be cleared out in case memory is getting low.

 

Thoughts?

 

Thanks,

Software Developer

Nathan Bruer

 



Re: [PHP-DEV] Memory warning hook

2013-03-05 Thread Tom Boutell
Can't you do this already? memory_limit can be fetched via ini_read,
and together with memory_get_usage you should be able to check for
this sort of thing. Admittedly having to parse memory_limit (which can
be in various units) is not perfect.

On Tue, Mar 5, 2013 at 1:23 PM,  nat...@starin.biz wrote:
 As PHP applications are turning into large frameworks one of the issues
 arriving is memory management. One of the issues is that many frameworks use
 sophisticated caching techniques to make accessing the same data quickly,
 this improves speed it is at the cost of memory. Often the developer knows
 these areas that cache and often times already have functions in place to
 clear out the cache, however in the case where PHP is approaching or exceeds
 memory limits PHP runs the GC then dies if it cannot allocate enough memory.
 If we implemented memory warning triggers or user function that will be
 called before the GC is executed which allows the user to try and free up
 some memory on their own. This hopefully would give more flexibility to
 allowing these advanced caching techniques but at the same time allow the
 cache to be cleared out in case memory is getting low.



 Thoughts?



 Thanks,

 Software Developer

 Nathan Bruer






-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Memory warning hook

2013-03-05 Thread Johannes Schlüter
On Tue, 2013-03-05 at 12:23 -0600, nat...@starin.biz wrote:
 As PHP applications are turning into large frameworks one of the issues
 arriving is memory management. One of the issues is that many frameworks use
 sophisticated caching techniques to make accessing the same data quickly,
 this improves speed it is at the cost of memory. Often the developer knows
 these areas that cache and often times already have functions in place to
 clear out the cache, however in the case where PHP is approaching or exceeds
 memory limits PHP runs the GC then dies if it cannot allocate enough memory.
 If we implemented memory warning triggers or user function that will be
 called before the GC is executed which allows the user to try and free up
 some memory on their own. This hopefully would give more flexibility to
 allowing these advanced caching techniques but at the same time allow the
 cache to be cleared out in case memory is getting low.

Running the GC is most likely faster than most cleanup routines a user
could run, also usually there is not that much stuff cached in PHP
scripts. If a PHP script has tons of data, which it can easily throw
away, in memory this sounds like a smell of an bad architecture. Cache
cache-worthy stuff in memcache or such and fetch only the data you need.

Also: What should happen if the system runs out of memory while doing
the cleanup? Anything sane doesn't sound good either.

johannes



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Memory warning hook

2013-03-05 Thread Lazare Inepologlou
2013/3/5 Tom Boutell t...@punkave.com

 Can't you do this already? memory_limit can be fetched via ini_read,
 and together with memory_get_usage you should be able to check for
 this sort of thing. Admittedly having to parse memory_limit (which can
 be in various units) is not perfect.


This is not the same at all. When are you going to run this code? Memory
allocations happen all the time. What Nathan asked for is an event that is
triggered when the memory consumption reaches a threshold.

However, there is a different solution, which is better IMHO in the case of
caches: weak references. A weak reference automatically frees the memory of
the object, when the memory is needed.
http://php.net/manual/en/book.weakref.php.

Having said that, none of these solutions scale up to multiple servers.
This is why shared cache systems like memcached are recommended.




 On Tue, Mar 5, 2013 at 1:23 PM,  nat...@starin.biz wrote:
  As PHP applications are turning into large frameworks one of the issues
  arriving is memory management. One of the issues is that many frameworks
 use
  sophisticated caching techniques to make accessing the same data quickly,
  this improves speed it is at the cost of memory. Often the developer
 knows
  these areas that cache and often times already have functions in place to
  clear out the cache, however in the case where PHP is approaching or
 exceeds
  memory limits PHP runs the GC then dies if it cannot allocate enough
 memory.
  If we implemented memory warning triggers or user function that will be
  called before the GC is executed which allows the user to try and free up
  some memory on their own. This hopefully would give more flexibility to
  allowing these advanced caching techniques but at the same time allow the
  cache to be cleared out in case memory is getting low.
 
 
 
  Thoughts?
 
 
 
  Thanks,
 
  Software Developer
 
  Nathan Bruer
 
 
 



 --
 Tom Boutell
 P'unk Avenue
 215 755 1330
 punkave.com
 window.punkave.com

 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


Lazare INEPOLOGLOU
Ingénieur Logiciel


Re: [PHP-DEV] Memory warning hook

2013-03-05 Thread Sebastian Krebs
2013/3/5 Lazare Inepologlou linep...@gmail.com

 2013/3/5 Tom Boutell t...@punkave.com

  Can't you do this already? memory_limit can be fetched via ini_read,
  and together with memory_get_usage you should be able to check for
  this sort of thing. Admittedly having to parse memory_limit (which can
  be in various units) is not perfect.
 

 This is not the same at all. When are you going to run this code? Memory
 allocations happen all the time. What Nathan asked for is an event that is
 triggered when the memory consumption reaches a threshold.


You can use ticks :)

http://php.net/control-structures.declare#control-structures.declare.ticks




 However, there is a different solution, which is better IMHO in the case of
 caches: weak references. A weak reference automatically frees the memory of
 the object, when the memory is needed.
 http://php.net/manual/en/book.weakref.php.

 Having said that, none of these solutions scale up to multiple servers.
 This is why shared cache systems like memcached are recommended.


Well, maybe I don't understand, what you are trying to tell, but if you run
out of memory, this of course only affects one server on its own.






  On Tue, Mar 5, 2013 at 1:23 PM,  nat...@starin.biz wrote:
   As PHP applications are turning into large frameworks one of the issues
   arriving is memory management. One of the issues is that many
 frameworks
  use
   sophisticated caching techniques to make accessing the same data
 quickly,
   this improves speed it is at the cost of memory. Often the developer
  knows
   these areas that cache and often times already have functions in place
 to
   clear out the cache, however in the case where PHP is approaching or
  exceeds
   memory limits PHP runs the GC then dies if it cannot allocate enough
  memory.
   If we implemented memory warning triggers or user function that will
 be
   called before the GC is executed which allows the user to try and free
 up
   some memory on their own. This hopefully would give more flexibility to
   allowing these advanced caching techniques but at the same time allow
 the
   cache to be cleared out in case memory is getting low.
  
  
  
   Thoughts?
  
  
  
   Thanks,
  
   Software Developer
  
   Nathan Bruer
  
  
  
 
 
 
  --
  Tom Boutell
  P'unk Avenue
  215 755 1330
  punkave.com
  window.punkave.com
 
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 Lazare INEPOLOGLOU
 Ingénieur Logiciel




-- 
github.com/KingCrunch


RE: [PHP-DEV] Memory warning hook

2013-03-05 Thread nathan
This is not the same at all. When are you going to run this code? Memory 
allocations happen all the time. What Nathan asked for is an event that is 
triggered when the memory consumption reaches a threshold.

However, there is a different solution, which is better IMHO in the case of
caches: weak references. A weak reference automatically frees the memory of 
the object, when the memory is needed.
http://php.net/manual/en/book.weakref.php.

Having said that, none of these solutions scale up to multiple servers.
This is why shared cache systems like memcached are recommended.

I agree this probably is a good solution and I personally do use it along with 
shared memory tools, however there may be cases where the dev may gain more 
benefit from having a memory-warning installable trigger in place. This would 
allow things like allowing the dev to release certain cache objects before 
others or something completely different that I have not thought of yet.

 Running the GC is most likely faster than most cleanup routines a user could 
 run, also usually there is not that much stuff cached in PHP scripts. If a 
 PHP script has tons of data, which it can easily throw away, in memory 
 this sounds like a smell of an bad architecture. Cache cache-worthy stuff in 
 memcache or such and fetch only the data you need.

Also: What should happen if the system runs out of memory while doing the 
cleanup? Anything sane doesn't sound good either.
Yes running the GC is much faster except they are two completely different 
processes... in my example the dev is keeping references to data for possible 
future use later on however it's not possible to know when to release these 
references so php's GC can collect them if the user does not implement 
something quite juristic like ticks or frequent function calls throughout a 
code base.

You can use ticks :)

http://php.net/control-structures.declare#control-structures.declare.ticks

Yes Ticks are something useable (like said above) however I have found ticks 
are clunky, frequently shunned, and you'd be ticking for no reason most of the 
time.


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Getting separate outputs with Date Functions

2013-03-05 Thread Steve Clay

On Wed, Feb 20, 2013 at 1:54 PM, David Soria Parra d...@php.net wrote:

I ran into this myself and I personally consider date() assuming your 
configured TZ A
bug.


The description for date() says local time/date = considering TZ is not a 
bug.


Timestamps are defined as UTC and the behaviour of DateTime is correct there, 
that it
always assume UTC. date() should do the same.


I rather think DateTime::__construct/date_create were wrongly designed for ignoring the 
second parameter. Timestamps specify a uniform reference of time, but just

because you use them doesn't imply you're sitting in any particular TZ.


Steve Clay
--
http://www.mrclay.org/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP User Survey

2013-03-05 Thread David Muir



When do you upgrade to a new release of php e.g. 5.3 - 5.4
  - As soon as released
  - wait for the x.1 release
  - Once our OpCode cache supports it
  - When previous version hits EOL
  - When a new feature warrants the upgrade
  - When my Framework (Zend/Symfony/cake) or Software (Wordpress, Gallery,
etc) requires it


You should add:
When my distro/hosting company upgrades.


Cheers,
David

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP User Survey

2013-03-05 Thread Kris Craig
On Tue, Mar 5, 2013 at 7:45 PM, David Muir davidkm...@gmail.com wrote:


  When do you upgrade to a new release of php e.g. 5.3 - 5.4
   - As soon as released
   - wait for the x.1 release
   - Once our OpCode cache supports it
   - When previous version hits EOL
   - When a new feature warrants the upgrade
   - When my Framework (Zend/Symfony/cake) or Software (Wordpress, Gallery,
 etc) requires it


 You should add:
 When my distro/hosting company upgrades.


 Cheers,
 David


 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


It's also important that we figure out how we will go about getting an
accurate sampling.  Questions about Drupal usage might yield deceptively
low results if the polls are being promoted more heavily in Wordpress
communities, for example.

These are the questions I think we have to answer:


   1. Are these surveys invitation-only, open to the public, or both?  My
   vote would be for the latter option; i.e. certain targetted surveys may be
   invitation-only while others would be open to all.
   2. Aside from the obvious posting on the PHP website, how can we go
   about promoting survey participation in such a way that ensures (or at
   least tries to ensure) equal or semi-equal participation across a diverse
   multitude of user communities and demographics?
   3. What sorts of demographics do we want to identify among a given
   survey's sampling?  For example, do we want to add questions to determine
   what percentage of respondents have a newbie/intermediate/expert
   understanding of PHP, which respondents use certain apps and operating
   systems, etc?


There are also some other broader questions we'll need to answer, such as
what procedures we use to decide when to do surveys and what those surveys
should contain, how/when to publish the results of completed surveys, etc.

I'm sure I'm just scratching the surface here, but before we delve too
deeply into what questions should be asked in the first survey, I think
there are some basic questions we ourselves need to answer first.  =)

--Kris


[PHP-DEV] VCS Account Request: mehdone

2013-03-05 Thread Mehdi Bakhtiari
I want to start reading the source code and contribute to the development of 
the PHP runtime.


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: VCS Account Request: mehdone

2013-03-05 Thread PHP Group
VCS Account Rejected: mehdone rejected by bjori /o\


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: VCS Account Request: sverbeek

2013-03-05 Thread PHP Group
VCS Account Rejected: sverbeek rejected by bjori /o\


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php