Re: [PHP-DEV] New function proposal

2015-10-13 Thread Mattias Gonzalez
Thanks all for the responses! I agree that it isnt a core functionallity, but it would be nice to have it always there to use. thank you for thinking its a good idea guys! 2015-10-10 17:22 GMT-03:00 Johannes Schlüter : > On Thu, 2015-10-08 at 12:05 -0300, Mattias

Re: [PHP-DEV] New function proposal

2015-10-10 Thread Johannes Schlüter
On Thu, 2015-10-08 at 12:05 -0300, Mattias Gonzalez wrote: > I wanted to propose the "var_die($var)" functionallity. This can easily be done in userland. There is no relevant performance gain. I see no reason to add this to core. Having this in your userland library has the benefit that you can

[PHP-DEV] New function proposal

2015-10-09 Thread Mattias Gonzalez
I wanted to propose the "var_die($var)" functionallity. My mates and i use a lot var_dump($var);die; Since die() wont print an array just a string, i think it´ll be very useful. It should do the var_dump($var);and die(); what do you think?

Re: [PHP-DEV] New function proposal

2015-10-09 Thread Sherif Ramadan
I think this is the most awesomest fantastical idea since sliced bread. +~0 On Thu, Oct 8, 2015 at 11:05 AM, Mattias Gonzalez wrote: > I wanted to propose the "var_die($var)" functionallity. > My mates and i use a lot var_dump($var);die; > > Since die() wont print

Re: [PHP-DEV] New function proposal

2015-10-09 Thread Ben Scholzen 'DASPRiD'
If you and your friends use that a lot, how about you just define a function for it in userland? There's absolutely no logical reason to have this in core. function var_die($value) { var_dump($value); exit; } On 08.10.2015 17:05, Mattias Gonzalez wrote: I wanted to propose the

Re: [PHP-DEV] New function proposal

2015-10-09 Thread Kris Childress
Mattias, As an avid user of var_dump($something); die(); I think this is a *fabulous* idea! Laravel has a good idea with dd(), I would like to see something that is quick and easy to type, that we can throw anything at.. Maybe something similar (basic example) to the following : function

Re: [PHP-DEV] New function proposal

2015-10-09 Thread Korvin Szanto
I agree with Ben on this, I personally use var_dump();exit; in my code a lot, but there's no reason this needs to be in the core and not in userland: function dd(...$args) { var_dump(...$args); exit; } On Fri, Oct 9, 2015 at 5:24 PM Kris Childress wrote: > Mattias, >

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-12-09 Thread Nicolas Grekas
Hi this is a proposal to add new function to PHP core: spl_object_id() IMHO this is a good idea: currently, var_dump has this super-power (and super-useful) capability of outputting a number that ease recognizing identical objects in dumps. This power should be transferred to userland devs so

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-12-09 Thread Rowan Collins
Nicolas Grekas wrote on 09/12/2014 09:31: Hi this is a proposal to add new function to PHP core: spl_object_id() IMHO this is a good idea: currently, var_dump has this super-power (and super-useful) capability of outputting a number that ease recognizing identical objects in dumps. This power

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-12-09 Thread Nicolas Grekas
Hi Rowan, In order to get an object's id, I use a trick that works for now: https://github.com/symfony/symfony/blob/2.6/src/Symfony/ Component/VarDumper/Cloner/VarCloner.php#L258-L282 This seems like a very elaborate piece of reverse engineering Right, and I made the claim for this being a

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-12-09 Thread Rowan Collins
Nicolas Grekas wrote on 09/12/2014 14:39: Hi Rowan, In order to get an object's id, I use a trick that works for now: https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/VarDumper/Cloner/VarCloner.php#L258-L282 This seems like a very elaborate piece of

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-12-09 Thread Nicolas Grekas
t would not be a BC break to completely change the output I agree! This could be as simple as removing the XOR for the first part of the hash string (the first 16 chars) and expose the internal object's handle there. This is already leaked by the output of var_dump so not a pb imho. And BC is

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-12-09 Thread Rowan Collins
On 9 December 2014 16:43:52 GMT, Nicolas Grekas nicolas.grekas+...@gmail.com wrote: Indeed. A non-function version of debug_zval_dump which could do this on any variable would be even better (if I read it right, your function only works on array members?) Not sure this is required: any

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-29 Thread Bostjan Skufca
On 29 November 2014 at 00:21, Rowan Collins rowan.coll...@gmail.com wrote: On 28/11/2014 01:13, Bostjan Skufca wrote: A function called spl_object_hash() exists, but it returns identical hashes for equal objects. In case it's been lost in the noise, no it doesn't. Ouch. I am terribly sorry

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-29 Thread Bostjan Skufca
On 28 November 2014 at 21:06, Patrick Schaaf p...@bof.de wrote: I really don't get it. What are you trying to do there that you cannot do with storing the object (reference) itself? I probably provided a poor explanation. All this was meant as a convenience method for quick debugging. I just

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-29 Thread Rowan Collins
On 29/11/2014 18:04, Bostjan Skufca wrote: On 29 November 2014 at 00:21, Rowan Collins rowan.coll...@gmail.com wrote: On 28/11/2014 01:13, Bostjan Skufca wrote: A function called spl_object_hash() exists, but it returns identical hashes for equal objects. In case it's been lost in the noise,

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Sebastian Krebs
2014-11-28 2:13 GMT+01:00 Bostjan Skufca bost...@a2o.si: Hello everyone, this is a proposal to add new function to PHP core: spl_object_id() The story: Recently I was debugging some larger libraries and sorely missed a function that would return an object ID. A function called

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Ferenc Kovacs
On Fri, Nov 28, 2014 at 2:14 PM, Sebastian Krebs krebs@gmail.com wrote: 2014-11-28 2:13 GMT+01:00 Bostjan Skufca bost...@a2o.si: Hello everyone, this is a proposal to add new function to PHP core: spl_object_id() The story: Recently I was debugging some larger

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Patrick Schaaf
On Friday 28 November 2014 14:51:55 Ferenc Kovacs wrote: I also used spl_object_hash() in the past when traversing/custom serializing object structures which can have infinite recursions between objects, but even that could be simply solved by storing the already traversed objects in an

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Rowan Collins
Ferenc Kovacs wrote on 28/11/2014 13:51: On Fri, Nov 28, 2014 at 2:14 PM, Sebastian Krebs krebs@gmail.com wrote: 2014-11-28 2:13 GMT+01:00 Bostjan Skufca bost...@a2o.si: Hello everyone, this is a proposal to add new function to PHP core: spl_object_id() The story: Recently I

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Ferenc Kovacs
On Fri, Nov 28, 2014 at 3:02 PM, Patrick Schaaf p...@bof.de wrote: On Friday 28 November 2014 14:51:55 Ferenc Kovacs wrote: I also used spl_object_hash() in the past when traversing/custom serializing object structures which can have infinite recursions between objects, but even

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Ferenc Kovacs
On Fri, Nov 28, 2014 at 5:39 PM, Patrick Schaaf p...@bof.de wrote: Am 28.11.2014 15:46 schrieb Ferenc Kovacs tyr...@gmail.com: from a quick test using spl_object_hash seems to be the slower with big number of elements in haystack. Your test only does the is-it-known test once. For an

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Bostjan Skufca
On 28 November 2014 at 04:10, reeze re...@php.net wrote: Won't `$obj1 === $obj2` work for you ? This works if you have two objects which are easily accessible in the same scope. Not that it can not be done this way, but it may require jumping through hoops to get two object references into

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Bostjan Skufca
On 28 November 2014 at 07:04, Joe Watkins pthre...@pthreads.org wrote: I don't think so, there is talk of removing object handles in 7. Could you point me to a discussion about this? Tnx. Even if we intended to keep object handles, this leaks implementation details that we

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Patrick Schaaf
Am 28.11.2014 20:23 schrieb Bostjan Skufca bost...@a2o.si: On 28 November 2014 at 04:10, reeze re...@php.net wrote: Won't `$obj1 === $obj2` work for you ? Think of it like this: - in file bootstrap.php I see this object initialized and passed somewhere - in file view.phtml I receive the

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Levi Morrison
Won't `$obj1 === $obj2` work for you ? This works if you have two objects which are easily accessible in the same scope. Not that it can not be done this way, but it may require jumping through hoops to get two object references into the common scope where you can compare them. If you

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Marc Bennewitz
Am 28.11.2014 um 21:21 schrieb Levi Morrison: Won't `$obj1 === $obj2` work for you ? This works if you have two objects which are easily accessible in the same scope. Not that it can not be done this way, but it may require jumping through hoops to get two object references into the common

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Rowan Collins
On 28/11/2014 21:06, Marc Bennewitz wrote: But to have a unique ID for objects sound like a very good idea and would solve the object as array key issue. I'm sure it's not as simple as the function prototype explained in this thread previously. Indeed. Fortunately, we already have one: it's

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-28 Thread Rowan Collins
On 28/11/2014 01:13, Bostjan Skufca wrote: A function called spl_object_hash() exists, but it returns identical hashes for equal objects. In case it's been lost in the noise, no it doesn't. From http://php.net/spl_object_hash Return Values A string that is unique for each currently

[PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-27 Thread Bostjan Skufca
Hello everyone, this is a proposal to add new function to PHP core: spl_object_id() The story: Recently I was debugging some larger libraries and sorely missed a function that would return an object ID. A function called spl_object_hash() exists, but it returns identical hashes for

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-27 Thread reeze
Won't `$obj1 === $obj2` work for you ? On 28 November 2014 at 09:13, Bostjan Skufca bost...@a2o.si wrote: Hello everyone, this is a proposal to add new function to PHP core: spl_object_id() The story: Recently I was debugging some larger libraries and sorely missed a function

Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle()

2014-11-27 Thread Joe Watkins
On Fri, 2014-11-28 at 02:13 +0100, Bostjan Skufca wrote: Hello everyone, this is a proposal to add new function to PHP core: spl_object_id() The story: Recently I was debugging some larger libraries and sorely missed a function that would return an object ID. A function called

[PHP-DEV] New function: stream_socket_listen()

2013-09-05 Thread Daniel Lowrey
The stream socket functions are incredibly useful and obviate the need for the sockets extension for the vast majority of potential use-cases. However, it's currently it's not possible bind a socket and listen for connections in separate steps using stream_socket_server(). This _can_ be done with

Re: [PHP-DEV] New function: stream_socket_listen()

2013-09-05 Thread Sara Golemon
Seems reasonable to me, but Wez should probably weigh in on it. I vaguely recall a conversation with him when he first implemented stream_socket_*() and a reason why listen wasn't in the API. -Sara On Thu, Sep 5, 2013 at 10:30 AM, Daniel Lowrey rdlow...@gmail.com wrote: The stream socket

Re: [PHP-DEV] New function: stream_socket_listen()

2013-09-05 Thread Wez Furlong
I'm not opposed to the idea; the reason that I didn't implement it initially is that I wanted something functional in the core (ext/sockets was often not available) and we didn't have PHP Spirit equivalents of the various and murky socket option setting APIs that are present in ext/sockets (it's

[PHP-DEV] New function http_response_code() to PHP5.4 Branch

2011-06-17 Thread Paul Dragoonis
Hi there, I'm requesting my function be put into the 5.4 branch. I added a function back in the 5.3 phase to obtain missing functionality of HEAD.c (and /ext/standard/ in general), but since it wasn't a bug fix then it wasn't suitable to add to a 5.3.x series. The function is

Re: [PHP-DEV] New function http_response_code() to PHP5.4 Branch

2011-06-17 Thread Kalle Sommer Nielsen
Hi Paul 2011/6/18 Paul Dragoonis dragoo...@php.net: Hi there, I'm requesting my function be put into the 5.4 branch. I added a function back in the 5.3 phase to obtain missing functionality of HEAD.c (and /ext/standard/ in general), but since it wasn't a bug fix then it wasn't suitable to

Re: [PHP-DEV] New function http_response_code() to PHP5.4 Branch

2011-06-17 Thread Paul Dragoonis
On Fri, Jun 17, 2011 at 11:18 PM, Kalle Sommer Nielsen ka...@php.net wrote: Hi Paul 2011/6/18 Paul Dragoonis dragoo...@php.net: Hi there, I'm requesting my function be put into the 5.4 branch. I added a function back in the 5.3 phase to obtain missing functionality of HEAD.c (and

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-25 Thread Lukas Kahwe Smith
On 24.01.2009, at 19:19, Guilherme Blanco wrote: Hi Oskar, Yes, you can use a plain array too. I was just giving you a normal approach (ArrayAccess inherited class) because you may want a special behavior under it too. Forget SplObjectStorage docs they're outdated read the source!

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-25 Thread Etienne Kneuss
Hello, On Sun, Jan 25, 2009 at 4:24 PM, Lukas Kahwe Smith m...@pooteeweet.org wrote: On 24.01.2009, at 19:19, Guilherme Blanco wrote: Hi Oskar, Yes, you can use a plain array too. I was just giving you a normal approach (ArrayAccess inherited class) because you may want a special behavior

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-24 Thread Oskar Eisemuth
Hello Guilherme The new implementation of spl_object_hash will solve it, since it's a faster implementation than the old one. Just one hint, you should not try to echo the generated hash, since it may have non-printable chars. I don't think that will be a problem... Also, your code may

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-24 Thread Guilherme Blanco
Hi Oskar, Yes, you can use a plain array too. I was just giving you a normal approach (ArrayAccess inherited class) because you may want a special behavior under it too. Forget SplObjectStorage docs they're outdated read the source! =) Undoubtely devs will not mark spl_object_hash a

[PHP-DEV] New function: pg_get_socket

2009-01-24 Thread Charles
This is a patch for 5.2.x to return a select()-able variable for a given PostgreSQL connection. PG allows ASync queries, pg_send_query, and notifications, pg_get_notify. Currently (afaik), there is no way to add a PostgreSQL socket to the event notification array in used with stream_select();

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-23 Thread Oskar Eisemuth
Hello My usage for spl_object_id wouldn't be solved with SplObjectStorage, here is my current event handler (it uses spl_object_hash) I still have the plan to replace it with something better but it simply works, currently it's not possible to free an object. EVENT::register accepts a static

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-22 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 2:38 PM, Etienne Kneuss webmas...@colder.ch wrote: Hello, On Tue, Jan 20, 2009 at 2:23 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Etienne, We all already considered to not implement spl_object_id as long as spl_object_hash is optimized. Ok then,

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Kenan R Sulayman
Thanks, I did propose the function because the construction in user-land is quite expensive; Actually tests showed: the user-land algorithm of mapping these objects (regarding a count of thousand; up to a half million objects / iterations) took 0,2 - 70 seconds to execute! Therefore: I would be

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Karsten Dambekalns
Hi. On 21.01.2009 11:44 Uhr, Kenan R Sulayman wrote: I did propose the function because the construction in user-land is quite expensive; Reflection is expensive, indeed. The way we solved it for FLOW3 is to create a ReflectionService that caches such information as long as the source

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Lukas Kahwe Smith
On 21.01.2009, at 12:00, Karsten Dambekalns wrote: Hi. On 21.01.2009 11:44 Uhr, Kenan R Sulayman wrote: I did propose the function because the construction in user-land is quite expensive; Reflection is expensive, indeed. The way we solved it for FLOW3 is to create a ReflectionService

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Christian Schneider
Lukas Kahwe Smith wrote: On 21.01.2009, at 12:00, Karsten Dambekalns wrote: On 21.01.2009 11:44 Uhr, Kenan R Sulayman wrote: I did propose the function because the construction in user-land is quite expensive; Reflection is expensive, indeed. The way we solved it for FLOW3 is to create a

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Sebastian Bergmann
Christian Schneider schrieb: Yes, please. Keep clutter out of the engine especially for stuff which should not be used often. If you are relying on Reflection to be fast for you everyday code then you're IMHO doing something weird and it is ok that you have to write your own caching for it

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Nathan Rixham
Christian Schneider wrote: Lukas Kahwe Smith wrote: On 21.01.2009, at 12:00, Karsten Dambekalns wrote: On 21.01.2009 11:44 Uhr, Kenan R Sulayman wrote: I did propose the function because the construction in user-land is quite expensive; Reflection is expensive, indeed. The way we solved it

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Kenan R Sulayman
First: I'd understand, I've to build the caching system on my own; Second: I'd vote for speeding up Reflection. Thanks, -- (c) Kenan Sulayman Freelance Designer and Programmer Life's Live Poetry 2009/1/21 Nathan Rixham nrix...@gmail.com Christian Schneider wrote: Lukas Kahwe Smith wrote:

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Christian Schneider
Nathan Rixham wrote: seems to me that many of the new requests coming in, including my own stupid ones are because people want to build fast decent orm's in php - Having built an ORM system myself I can say that you don't need Reflection (or even other fancy features not yet in PHP) for this.

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Nathan Rixham
Christian Schneider wrote: Nathan Rixham wrote: seems to me that many of the new requests coming in, including my own stupid ones are because people want to build fast decent orm's in php - Having built an ORM system myself I can say that you don't need Reflection (or even other fancy

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Roman Borschel
On Jan 21, 2009, at 4:20 PM, Christian Schneider wrote: Nathan Rixham wrote: seems to me that many of the new requests coming in, including my own stupid ones are because people want to build fast decent orm's in php - Having built an ORM system myself I can say that you don't need

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Nate Gordon
My personal favorite use of Reflection is Class Factories. While this could be done with: ?php $className = 'Util'; $obj = new $className(); ? It seems a little blunt to me, it also doesn't support having a variable number of arguments to the constructor. I've seen some pretty egregious

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-21 Thread Sebastian Bergmann
Roman Borschel schrieb: Would you mind sharing (off-list) how you get data in and out of the objects **transparently** Have a look at lp:php-object-freezer. -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, We already had that discussion in private, but here is a on-list summary: On Mon, Jan 19, 2009 at 5:39 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Ok, We'll use this method inside Doctrine ORM version 2.0, scheduled to be released on September 1st, 2009. One main location

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Stan Vassilev | FM
Hi, I had a talk with Marcus, and he has agreed on this proposed solution: 1) SPL generates a pseudo-random session id/mask (for the current request, do not confuse with $_SESSION), which consists of 32 random bytes/characters. 2) The object is and the handler pointer are used to create a

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 11:47 AM, Stan Vassilev | FM sv_for...@fmethod.com wrote: Hi, I had a talk with Marcus, and he has agreed on this proposed solution: 1) SPL generates a pseudo-random session id/mask (for the current request, do not confuse with $_SESSION), which consists of

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Hannes Magnusson
On Tue, Jan 20, 2009 at 13:26, Etienne Kneuss webmas...@colder.ch wrote: Could you please provide an example, with code, in which this function would be necessary ? (i.e. where you can't use SplObjeccctStorage) Why? As far as i understand, the issue is that spl_object_hash() is slow and

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 1:45 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Hi, It seems SplObjectStorage will solve my issue. We already spoke on pvt about how to handle things correctly too. Although this solve my issue, the point that Stan highlighted is valid. You may not

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Guilherme Blanco
Etienne, We all already considered to not implement spl_object_id as long as spl_object_hash is optimized. Regards, On Tue, Jan 20, 2009 at 11:20 AM, Etienne Kneuss webmas...@colder.ch wrote: Hello, On Tue, Jan 20, 2009 at 1:41 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: On Tue,

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 2:23 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Etienne, We all already considered to not implement spl_object_id as long as spl_object_hash is optimized. Ok then, I'll provide a patch to improve spl_object_hash's performance, which will also change

[PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-20 Thread Kenan R Sulayman
Hi, I'd like to propose a new function: spl_class_vars / params / contents. Notice: I haven't figured out a name yet Please help me find one.. :-) The function returns an array of the contents of the given class-object. The class-object parameter may be text or rather directly the object ( new

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 8:30 PM, Kenan R Sulayman kur...@kkooporation.de wrote: Hi, I'd like to propose a new function: spl_class_vars / params / contents. Notice: I haven't figured out a name yet Please help me find one.. :-) The function returns an array of the contents of the

Re: [PHP-DEV] New function proposal: spl_class_vars / params / contents

2009-01-20 Thread Sebastian Bergmann
Etienne Kneuss schrieb: Why can't you use Reflection in this case? It looks like you can quite easily implement that in userland from Reflection. Especially using setAcessible() which was added in PHP 5.3. -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG

[PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Guilherme Blanco
Hi, I spoke with some devs yesterday about spl_object_hash performance and alternatives to solve it. Seems that md5 applied inside it is the responsable for that. After some tips from Lars, we came with a patch (at the bottom of this email). The new proposed function is already being used in

RE: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Andi Gutmans
Shouldn't you be using RETURN_STRINGL with length and dup=0? Andi -Original Message- From: Guilherme Blanco [mailto:guilhermebla...@gmail.com] Sent: Wednesday, December 17, 2008 9:31 AM To: internals Mailing List Subject: [PHP-DEV] New function proposal: spl_object_id Hi, I

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Etienne Kneuss
Hello, On Wed, Dec 17, 2008 at 7:29 PM, Lars Strojny l...@strojny.net wrote: Hi Guilherme, thanks for moving the discussion to the list. Am Mittwoch, den 17.12.2008, 15:31 -0200 schrieb Guilherme Blanco: [...] It seems that Marcus controls the commit access to SPL. So I'm turning the

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Lars Strojny
Hi Andi, Am Mittwoch, den 17.12.2008, 10:33 -0800 schrieb Andi Gutmans: Shouldn't you be using RETURN_STRINGL with length and dup=0? Yes, the more recent implementation does exactly that :) cu, Lars signature.asc Description: Dies ist ein digital signierter Nachrichtenteil

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Lars Strojny
Hi Guilherme, thanks for moving the discussion to the list. Am Mittwoch, den 17.12.2008, 15:31 -0200 schrieb Guilherme Blanco: [...] It seems that Marcus controls the commit access to SPL. So I'm turning the conversation async, since I cannot find him online at IRC. So, can anyone review the

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Marcus Boerger
Hello Etienne, Wednesday, December 17, 2008, 7:59:01 PM, you wrote: Hello, On Wed, Dec 17, 2008 at 7:29 PM, Lars Strojny l...@strojny.net wrote: Hi Guilherme, thanks for moving the discussion to the list. Am Mittwoch, den 17.12.2008, 15:31 -0200 schrieb Guilherme Blanco: [...] It seems

[PHP-DEV] new function: php_get_tmpdir() - bug #35380

2006-05-03 Thread Hartmut Holzgraefe
I have added a small function requested by bug #35380 that exposes the C API function php_get_temorary_directory() to userland as php_get_tmpdir(). The patch is available from the bug page http://bugs.php.net/bug.php?id=35380 I can't oversee whether this has any security implications

Re: [PHP-DEV] New function request - Variable parsing a string

2004-09-02 Thread Herbert Groot Jebbink
Sara Golemon wrote: $string = * {$abc} * {$klm['klm']} * {$xyz-xyz} *; echo $string; He wants to store an UNinterpolated string somewhere (like a DB or text file), then interpolate it at run-time. indeed, and it's usage is in a driver that calls include files for the business logic and

Re: [PHP-DEV] New function request - Variable parsing a string

2004-09-01 Thread Philip Olson
I don't want to parse variables FROM a string but I want to parse them INTO a string as described on the page: http://ie.php.net/manual/en/language.types.string.php#language.types.string.parsing Below a PHP example that shows the function I want. ?php $abc= '123';

Re: [PHP-DEV] New function request - Variable parsing a string

2004-09-01 Thread Sara Golemon
Just use double quotes, no need for a function: $string = * {$abc} * {$klm['klm']} * {$xyz-xyz} *; echo $string; He wants to store an UNinterpolated string somewhere (like a DB or text file), then interpolate it at run-time. $sitename = 'php.net'; $username = 'pollita'; $string =

[PHP-DEV] New function request - Variable parsing a string

2004-08-31 Thread Herbert Groot Jebbink
Hi, To speed up a homebuild PHP framework I would like to have a new function that expands a string with the PHP variables in it, just like how variable parsing is done for a double-quotes string. string VariableParsingString ( string string ) Currently I do it with the next eval statement.

Re: [PHP-DEV] New function request - Variable parsing a string

2004-08-31 Thread Rasmus Lerdorf
http://nl.php.net/parse_str On Tue, 31 Aug 2004, Herbert Groot Jebbink wrote: Hi, To speed up a homebuild PHP framework I would like to have a new function that expands a string with the PHP variables in it, just like how variable parsing is done for a double-quotes string. string

[PHP-DEV] New function proposal urlappendvar()

2004-01-21 Thread Juan Alonso
Hello list, I find often myself wanting to append a variable to an unknown url. The problem is that you don't know if you should append the var with ? or with . Do you think it would be useful to have a builtin function that would do this automatically? example code as I do it actually: ?php

Re: [PHP-DEV] New function proposal urlappendvar()

2004-01-21 Thread Rasmus Lerdorf
Generally we don't add functions to replace simple one-line PHP expressions. $url .= strstr($url,'?')??foo=$foo:foo=$foo; -Rasmus On Wed, 21 Jan 2004, Juan Alonso wrote: Hello list, I find often myself wanting to append a variable to an unknown url. The problem is that you don't know

Re: [PHP-DEV] New function proposal urlappendvar()

2004-01-21 Thread Andi Gutmans
At 07:53 PM 1/21/2004 +0800, James Devenish wrote: In message [EMAIL PROTECTED] on Wed, Jan 21, 2004 at 03:31:08AM -0800, Rasmus Lerdorf wrote: $url = urlappendvar($_SERVER['HTTP_REFERER'], 'foo', $foo); Generally we don't add functions to replace simple one-line PHP expressions. $url .=

Re: [PHP-DEV] New function proposal urlappendvar()

2004-01-21 Thread Petras Kudaras
James Devenish wrote: $url .= strstr($url,'?')??foo=$foo:foo=$foo; Without wanting to make any comment about the merits of the proposed function, I would have thought there would be merit in having a set of generalised URL-manipulation functions (if someone wanted to write them, that is).

Re: [PHP-DEV] New function proposal urlappendvar()

2004-01-21 Thread James Devenish
In message [EMAIL PROTECTED] on Wed, Jan 21, 2004 at 02:43:57PM +0100, Petras Kudaras wrote: Shouldn't that go into separate module (available from PEAR) or something? Sticking as many things into the core as possible seems to be the reason a lot of people don't like PHP ;) I don't know what

Re: [PHP-DEV] New function proposal urlappendvar()

2004-01-21 Thread Ivan Rodriguez
_ ALAPLAYA.COM http://www.alaplaya.com [EMAIL PROTECTED] - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Juan Alonso [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 12:31 PM Subject: Re: [PHP-DEV] New function proposal

[PHP-DEV] new function?

2004-01-13 Thread Andrey Hristov
Hi internals, I know HEAD is freezed, but anyway to ask whether a new function in_array_all() can be added. It works like in_array() but checks whether all needles are in the stack array. Diff : http://www.hristov.com/andrey/projects/php_stuff/in_array_all.diff.txt Best wishes, Andrey -- PHP

Re: [PHP-DEV] new function?

2004-01-13 Thread Adam Maccabee Trachtenberg
On Tue, 13 Jan 2004, Andrey Hristov wrote: I know HEAD is freezed, but anyway to ask whether a new function in_array_all() can be added. It works like in_array() but checks whether all needles are in the stack array. Do we really need this either way? function in_array_all($needles,

Re: [PHP-DEV] new function?

2004-01-13 Thread BDKR
Andrey Hristov wrote: Hi internals, I know HEAD is freezed, but anyway to ask whether a new function in_array_all() can be added. It works like in_array() but checks whether all needles are in the stack array. Diff : http://www.hristov.com/andrey/projects/php_stuff/in_array_all.diff.txt Best

Re: [PHP-DEV] new function?

2004-01-13 Thread Andrei Zmievski
On Tue, 13 Jan 2004, Andrey Hristov wrote: Hi internals, I know HEAD is freezed, but anyway to ask whether a new function in_array_all() can be added. It works like in_array() but checks whether all needles are in the stack array. Diff :