Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-27 Thread Hans-Jürgen Petrich
Am 25.02.2013, 20:03 Uhr, schrieb Terry Ellison : On 03/02/13 15:27, Hans-Juergen Petrich wrote: In this example (using php-5.4.11 on Linux) the memory will grow non-stop: for ( $fp = fopen('/dev/urandom', 'rb'); true;) { eval ('$ano_fnc = func

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-25 Thread Terry Ellison
On 03/02/13 15:27, Hans-Juergen Petrich wrote: In this example (using php-5.4.11 on Linux) the memory will grow non-stop: for ( $fp = fopen('/dev/urandom', 'rb'); true;) { eval ('$ano_fnc = function() {$x = "'.bin2hex(fread($fp, mt_rand(1, 1))).'";};'); echo "Mem usage: ".memory_g

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-06 Thread Hans-Jürgen Petrich
Am 05.02.2013, 20:53 Uhr, schrieb Terry Ellison : On 04/02/13 10:57, Ángel González wrote: The memory will stop growing (on my machine) at ~2491584 bytes and the loop is able to run forever, creating each eval() furthermore uniqe ano-function's but not endless-filling Zend-inter

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-05 Thread Terry Ellison
On 04/02/13 10:57, Ángel González wrote: The memory will stop growing (on my machine) at ~2491584 bytes and the loop is able to run forever, creating each eval() furthermore uniqe ano-function's but not endless-filling Zend-internal tables. but this still leaves the function record itself in t

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-04 Thread Hans-Jürgen Petrich
Am 04.02.2013, 17:57 Uhr, schrieb "Ángel González" : Hans-Jürgen Petrich wrote: Hi Terry and all thank you very much for your response. The only thing that confused me about what you say that the second *doesn't* grow Yes, about that i was [and am still :-)] also confused... why the 2nd one

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-04 Thread Hans-Jürgen Petrich
Am 04.02.2013, 19:11 Uhr, schrieb Terry Ellison : Hi Terry and all thank you very much for your response. The only thing that confused me about what you say that the second *doesn't* grow Yes, about that i was [and am still :-)] also confused... why the 2nd one won't grow *non-stop* so I ch

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-04 Thread Terry Ellison
Hi Terry and all thank you very much for your response. The only thing that confused me about what you say that the second *doesn't* grow Yes, about that i was [and am still :-)] also confused... why the 2nd one won't grow *non-stop* so I checked and it does -- just the same as the first. R

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-04 Thread Ángel González
Hans-Jürgen Petrich wrote: > Hi Terry and all > thank you very much for your response. > >> The only thing that confused me about what you say that the second >> *doesn't* grow > Yes, about that i was [and am still :-)] also confused... why the 2nd > one won't grow *non-stop* > >> so I checked and

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Hans-Juergen Petrich
Hello Then again, your code still does not make sense to me ... Fully understand :-) Not want wasting your time with my specific situation... but there are situation where it make sense :-) For example... in my situation, i have time intensive (mathematically) operations to do in pure p

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Hans-Jürgen Petrich
Hi Terry and all thank you very much for your response. The only thing that confused me about what you say that the second *doesn't* grow Yes, about that i was [and am still :-)] also confused... why the 2nd one won't grow *non-stop* so I checked and it does -- just the same as the first.

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Sebastian Krebs
2013/2/3 Sebastian Bergmann > Am 03.02.2013 18:07, schrieb Sebastian Bergmann: > > Can you explain why you are using eval() instead of a real anonymous > > function? Thanks! > > Please ignore my email; I mixed up create_function() and eval(). Then > again, your code still does not make sense to

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Sebastian Bergmann
Am 03.02.2013 18:07, schrieb Sebastian Bergmann: > Can you explain why you are using eval() instead of a real anonymous > function? Thanks! Please ignore my email; I mixed up create_function() and eval(). Then again, your code still does not make sense to me ... -- Sebastian Bergmann

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Sebastian Bergmann
Am 03.02.2013 16:27, schrieb Hans-Juergen Petrich: > Is there one who can explain this? Can you explain why you are using eval() instead of a real anonymous function? Thanks! -- Sebastian BergmannCo-Founder and Principal Consultant http://sebastian-bergmann.de/

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Ángel González
On 03/02/13 16:27, Hans-Juergen Petrich wrote: > The only different in the second example is the fixed body length of > the eval()-created anoymous function. > I wondering why the memory in the second code-example will be freed at > some point while in the first example not. > > I don't think it's