[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-24 Thread Remi Collet
Le 23/04/2013 23:01, Pierrick Charron a écrit : > Commit:b79e65f268d8f368a1088313735eda3ca485fa53 > Author:Pierrick Charron Tue, 23 Apr 2013 > 17:01:17 -0400 > Parents: 758b666c0ad6edb48274858d2e11c53460787b88 > Branches: PHP-5.5 > > Link: > http://git.php.net/?p=php-sr

Re: [PHP-DEV] Object Type Casting

2013-04-24 Thread Jannik Zschiesche
Hi, I guess it would work like an inline type-hint. Something along the lines of: $circle = ShapeFactory::createShape('circle'); if (!$circle instanceof Circle) { throw …; } I would like something like this, since it saves quite some code. Cheers Jannik Am Mittwoch, 24. April 2013 um 1

Re: [PHP-DEV] vsprintf()

2013-04-24 Thread Rasmus Schultz
Frankly, a magic method sounds like a much better solution than auto-magically converting objects to arrays. The problem with automatic conversion, is that the order of properties is an implementation detail - the vsprintf() example perfectly illustrates the problem: class User { public $firs

Re: [PHP-DEV] vsprintf()

2013-04-24 Thread Ralph Schindler
Well, since I was the one who posted it (https://twitter.com/ralphschindler/status/327084619507855361), I'll further explain it. I realized it was doing this when actually running this kind of snippet: http://3v4l.org/ZkE6B I must have left the public in there when I posted it to twitter. I

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] Object Type Casting

2013-04-24 Thread Etienne Kneuss
There are no concrete plans no. Object casting is typically available to please the static type checker. This concern does not exist in PHP since types are checked at runtime. So my first question would be: Why do you need it ? Other questions include: what would it do for up-casting, down-casti

AW: [PHP-DEV] Object Type Casting

2013-04-24 Thread Robert Stoll
I suppose your cast is a conversion. Otherwise it is not needed at all because PHP has no types. -Ursprüngliche Nachricht- Von: Raymond Irving [mailto:xwis...@gmail.com] Gesendet: Mittwoch, 24. April 2013 17:40 An: PHP Internals Betreff: [PHP-DEV] Object Type Casting Hello, Are there a

[PHP-DEV] Object Type Casting

2013-04-24 Thread Raymond Irving
Hello, 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(); It would be great if this feature could be added to 5.5 :) __ Raymond Irving

Re: [PHP-DEV] vsprintf()

2013-04-24 Thread Anthony Ferrara
Richard, Oh! Another magic method opportunity ... > > /** > * Operates just like __toString(), but returns an array. > */ > public function __toArray(); > > > (ducking) I know you're joking, but this has been brought up before (and I intend to bring it up again): https://wiki.php.net/rfc/obje

Re: [PHP-DEV] vsprintf()

2013-04-24 Thread Richard Quadling
On 24 April 2013 17:31, Richard Bradley wrote: > > -Original Message- > > From: Rasmus Schultz [mailto:ras...@mindplay.dk] > > Sent: 24 April 2013 16:45 > > To: PHP internals > > Subject: [PHP-DEV] vsprintf() > > > > This is all kinds of wrong: > > > > http://3v4l.org/UZFME > > > > So the

RE: [PHP-DEV] vsprintf()

2013-04-24 Thread Richard Bradley
> -Original Message- > From: Rasmus Schultz [mailto:ras...@mindplay.dk] > Sent: 24 April 2013 16:45 > To: PHP internals > Subject: [PHP-DEV] vsprintf() > > This is all kinds of wrong: > > http://3v4l.org/UZFME > > So the order in which the properties were defined is the magic that makes >

Re: [PHP-DEV] vsprintf()

2013-04-24 Thread Johannes Schlüter
On Wed, 2013-04-24 at 11:45 -0400, Rasmus Schultz wrote: > This is all kinds of wrong: > > http://3v4l.org/UZFME > > So the order in which the properties were defined is the magic that makes > this work. > > Wow. WTF? > > Do I need to explain in detail why this is all kinds of effed up? vsprin

Re: [PHP-DEV] vsprintf()

2013-04-24 Thread Levi Morrison
On Wed, Apr 24, 2013 at 9:45 AM, Rasmus Schultz wrote: > > Do I need to explain in detail why this is all kinds of effed up? > > Yes, I'd like that explanation.

[PHP-DEV] vsprintf()

2013-04-24 Thread Rasmus Schultz
This is all kinds of wrong: http://3v4l.org/UZFME So the order in which the properties were defined is the magic that makes this work. Wow. WTF? Do I need to explain in detail why this is all kinds of effed up? - Rasmus Schultz

[PHP-DEV] minor annoyance in php configure

2013-04-24 Thread Dennis Clarke
Still seeing this : . . . checking for bison version... (cached) invalid configure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 (found: none). . . . However : node002 $ which

[PHP-DEV] ext/standard/tests/array/array_column_object_cast.phpt failing

2013-04-24 Thread David Soria Parra
Hi Sarah, Hi Ben, ext/standard/tests/array/array_column_object_cast.phpt is failing on PHP-5.5. I bisected to: 1a03bd5dee97a0f8b9e74b7f8db5231abd8cc7e4 is the first bad commit commit 1a03bd5dee97a0f8b9e74b7f8db5231abd8cc7e4 Author: Sara Golemon Date: Mon Apr 22 14:57:05 2013 -0700 Allow a

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

2013-04-24 Thread Pascal Chevrel
Le 24/04/2013 08:15, Martin Keckeis a écrit : Hello together, if you got a namespace with more than one functions, why not just create a container class and make the methods static? I know it's not exactly the same, but how many times you need this So you can write: namespace Abc\Def; clas

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

2013-04-24 Thread Alexander Deruwe
On Wed, Apr 24, 2013 at 10:54 AM, Florian Anderiasch wrote: > Additionally, it's either semantically wrong to group unrelated > functions in "static tool classes", it's even a well-known antipattern. It also doesn't address a point made by Igor before: "It's distracting to have my vendor name

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

2013-04-24 Thread Florian Anderiasch
On 04/24/2013 08:15 AM, Martin Keckeis wrote: > class Something{ > public static function blubb(); > > public static function blubb2(); > } > > > use Abc\Def\Something; > > Something::blubb(); > Something::blubb2(); Yes of course you can do that as an ugly workaround - but I wouldn't c