Dear PHP Community,
I'd like to propose several changes to PHP core:
- Allow re-throwing exceptions without losing original stack trace,
like in other technologies:
try {/.../} catch(Exception $e) { throw; } - Introduce base class for all PHP classes. E.g. Object. It would help
in type hinting and allow to add new common methods without any magic. - Parse body of PUT request in the same manner as it's done for POST
request. I guess it should be stored in $_POST array to maintain backward
compatibility. Otherwise $_REQUEST handling should be aware of new array
with PUT data. - Add handling of DateTime objects to SoapServer and SoapClient. It
will help in using this build-in datatype without typemap.
I tried to google for these proposals, but didn't find any previous
discussions.
--
Max Romanovsky
Dear PHP Community,
I'd like to propose several changes to PHP core:
- Allow re-throwing exceptions without losing original stack trace,
like in other technologies:
try {/.../} catch(Exception $e) { throw; }
catch (Exception $e) { throw $e; }
This does what you want? (A quick test my end appears to keep the stack
trace in-tact at least)
- Introduce base class for all PHP classes. E.g. Object. It would help
in type hinting and allow to add new common methods without any magic.
I like this idea.
- Parse body of PUT request in the same manner as it's done for POST
request. I guess it should be stored in $_POST array to maintain
backward
compatibility. Otherwise $_REQUEST handling should be aware of new array
with PUT data.
I don't really like the idea of putting non-POST data in $_POST
It would still be nice to have a better way of handing PUT though.
Dear PHP Community,
Hi,
I'd like to propose several changes to PHP core:
1. Allow re-throwing exceptions without losing original stack trace, like in other technologies: try {/*...*/} catch(Exception $e) { throw; }
throw $e will do the job.
2. Introduce base class for all PHP classes. E.g. Object. It would help in type hinting and allow to add new common methods without any magic.
Introduce a type-hint “object” would be better I think. It would replace
is_object call.
3. Parse body of PUT request in the same manner as it's done for POST request. I guess it should be stored in $_POST array to maintain backward compatibility. Otherwise $_REQUEST handling should be aware of new array with PUT data.
var_dump(file_get_contents('php://input'));
Why is it complicated? And place PUT request body in $_POST sounds a bad
idea :-).
4. Add handling of DateTime objects to SoapServer and SoapClient. It will help in using this build-in datatype without typemap.
I tried to google for these proposals, but didn't find any previous
discussions.
Cheers :-).
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
2. Introduce base class for all PHP classes. E.g. Object. It would
help
in type hinting and allow to add new common methods without any magic.Introduce a type-hint “object” would be better I think. It would replace
is_object call.
I wonder how much BC breakage there would be introducing an Object class /
type-hint though. Right now it's perfectly acceptable to define a class
called Object (or object).
An ugly solution could be to re-use stdClass as the base of all classes.
2. Introduce base class for all PHP classes. E.g. Object. It would help in type hinting and allow to add new common methods without any magic.
Type-hinting for non-stdClass objects would be handy.
Base class is like mutable Object.prototype in JS. I'm against it.
3. Parse body of PUT request in the same manner as it's done for POST
There are arguments for/against here: https://bugs.php.net/bug.php?id=55815
compatibility. Otherwise $_REQUEST handling should be aware of new array with PUT data.
For BC, PUT data should not be injected into existing vars.
Steve Clay
This item
- Introduce base class for all PHP classes. E.g. Object. It would help
in type hinting and allow to add new common methods without any magic.
StdClass Already do that!!!!
2013/3/6 Steve Clay steve@mrclay.org
2. Introduce base class for all PHP classes. E.g. Object. It would
help
in type hinting and allow to add new common methods without any magic.Type-hinting for non-stdClass objects would be handy.
Base class is like mutable Object.prototype in JS. I'm against it.
3. Parse body of PUT request in the same manner as it's done for POST
There are arguments for/against here: https://bugs.php.net/bug.php?**
id=55815 https://bugs.php.net/bug.php?id=55815compatibility. Otherwise $_REQUEST handling should be aware of new
array
with PUT data.For BC, PUT data should not be injected into existing vars.
Steve Clay
--
--
<a href="
http://cwconnect.computerworld.com.br/profile_view.aspx?customerid=alexandreandrade"><img
src="
http://cwconnect.computerworld.com.br/businesscard.aspx?customerid=alexandreandrade"
border="0" alt="Join Me at CW Connect!"></a
On 6 March 2013 15:50, Alexandre "TAZ" dos Santos Andrade <
alexandretaz@gmail.com> wrote:
This item
- Introduce base class for all PHP classes. E.g. Object. It would help
in type hinting and allow to add new common methods without any magic.StdClass Already do that!!!!
<?php
class A
{}
$obj = new A();
var_dump($obj instanceof StdClass);
Result:
bool(false)
3. Parse body of PUT request in the same manner as it's done for POST
+1
--
<hype>
WWW: plphp.dk / plind.dk
CV: careers.stackoverflow.com/peterlind
LinkedIn: plind
Twitter: kafe15
</hype
- Add handling of DateTime objects to SoapServer and SoapClient. It
will help in using this build-in datatype without typemap.
This is (at least partially) covered by the patch in
https://bugs.php.net/44383. Have you tried that one to see if its good?
- Martin