>> >
>> > Obviously, the `\0` is horrible and can probably be improved: depends on
>> > whether the API is intended for human or machine consumption. If it is
>> > machine consumption, strings are the wrong approach anyway.
>>
>> Machine or human?
>> One goal is that these names can be used as
See http://php.net/manual/en/language.namespaces.rules.php
What you mean is a "qualified name" so it would be a QN.
On 11 December 2017 at 10:28, Marco Pivetta wrote:
> Weird, that looks wrong to me, so I may be wrong here.
>
> When receiving a string containing a symbol,
Weird, that looks wrong to me, so I may be wrong here.
When receiving a string containing a symbol, the only sensible approach is
to consider it a FQN, as no context is provided with the string.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On Mon, Dec 11, 2017 at
On 11 December 2017 at 10:16, Marco Pivetta wrote:
> On Mon, Dec 11, 2017 at 10:03 AM, Andreas Hennings
> wrote:
>>
>> On 11 December 2017 at 09:16, Marco Pivetta wrote:
>> > If you really want to expose a symbol's FQN,
>>
>> Just to
On 11 December 2017 at 08:58, Marco Pivetta wrote:
> What's the use-case for creating a userland `ReflectionType` instance,
> besides mocking the reflection API itself?
> Consider that the subclassing in userland already provides an easy way to
> perform these operations
On Mon, Dec 11, 2017 at 10:03 AM, Andreas Hennings
wrote:
> On 11 December 2017 at 09:16, Marco Pivetta wrote:
> > If you really want to expose a symbol's FQN,
>
> Just to clarify: For me, "FQN" means "fully-qualified name", which
> begins with "\\".
>
On 11 December 2017 at 09:16, Marco Pivetta wrote:
> If you really want to expose a symbol's FQN,
Just to clarify: For me, "FQN" means "fully-qualified name", which
begins with "\\".
This is specifically not what I propose here. I want the name without
the leading namespace
If you really want to expose a symbol's FQN, I suggest exposing the
internal name as per `(array)` cast semantics.
namespace A {
class B {
public $c;
private $d;
private $e;
}
}
That would be:
"A\B#\$c"
"A\B#\0*\0\$d"
"A\B#\0A\\B\0\$e"
Obviously, the `\0` is
What's the use-case for creating a userland `ReflectionType` instance,
besides mocking the reflection API itself?
Consider that the subclassing in userland already provides an easy way to
perform these operations (although ugly):
Currently there is no (documented) way to directly create a
\ReflectionType object.
The class has no documented constructor.
I propose that static factory methods shall be added for this purpose.
This will be useful for code that wants to dynamically create and pass
around reflection type
I propose a new method ::getFullName() for all methods that implement
\Reflector.
(I would add it to the \Reflector interface, but this would be a BC break.)
The full name would be, depending on the type:
function: "str_replace()", "Acme\foo()".
class: "Acme\Animal\Cat", "stdClass".
method:
## Background / motivation
Currently a number of reflection classes have a method ->getNamespaceName().
The namespace comes in a format that is not straightforward to work with.
It requires the root namespace to be treated in a special way.
$namespace = $relfClass->getNamespaceName();
On 10/11/2016 07:27 AM, Stanislav Malyshev wrote:
I hope it's string(3) otherwise we have a bug on our
hands
That was a copy/pasta/no-adapt mistake, my bad.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi!
> printed
>
> string(4) "?int"
> string(3) "int"
>
> and now it prints
>
> string(4) "int"
I hope it's string(3) otherwise we have a bug on our
hands
--
Stas Malyshev
smalys...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
Sebastian Bergmann schrieb am So., 9. Okt. 2016, 08:56:
> At some point in time during the development of PHP 7.1 this code
>
> function f(?int $x)
> {
> }
>
> $f = new ReflectionFunction('f');
>
> var_dump((string) $f->getParameters()[0]->getType());
>
At some point in time during the development of PHP 7.1 this code
function f(?int $x)
{
}
$f = new ReflectionFunction('f');
var_dump((string) $f->getParameters()[0]->getType());
var_dump($f->getParameters()[0]->getType()->getName());
printed
string(4) "?int"
string(3) "int"
I have updated the section on Reflection to explain some of the design
decisions: https://wiki.php.net/rfc/returntypehinting#reflection;
hopefully that will help you and others to understand the rationale.
Please let me know if you have follow-up questions.
--
PHP Internals - PHP Runtime
Markus
On 19 October 2014 20:31, Markus Fischer mar...@fischer.name wrote:
On 16.10.14 06:39, Levi Morrison wrote:
- The design and accompanying section of reflection[3] has been
rewritten entirely.
[3]: https://wiki.php.net/rfc/returntypehinting#reflection
I've some comments about the
Hi Chris,
On 20.10.14 12:10, Chris Wright wrote:
[...] in depth summary of future idea ReflectionType
Thanks a lot for the clarification and regarding the future expansion of
the use of ReflectionType I now better understand most points and why
they're currently are that way.
I don't think I've
On 16.10.14 06:39, Levi Morrison wrote:
- The design and accompanying section of reflection[3] has been
rewritten entirely.
[3]: https://wiki.php.net/rfc/returntypehinting#reflection
I've some comments about the Reflection API addition/changes:
1. Note that getReturnType will always
Dear PHP Internals subscribers,
I have two quick questions regarding PHP 5's Reflection API (I apologize if
this isn't the right list to ask):
1) Is there a way to inject a method into a Class such that future
instantiations of that Class will have the method? For example:
Before
Hi Jim,
you're searching for runkit ;-)
http://de.php.net/manual/en/ref.runkit.php
johannes
On Fri, 2007-02-09 at 10:18 -0600, Jim Wilson wrote:
Dear PHP Internals subscribers,
I have two quick questions regarding PHP 5's Reflection API (I apologize if
this isn't the right list to ask):
Hi Sebastian
On 6/8/06, Sebastian Bergmann [EMAIL PROTECTED] wrote:
http://phpfi.com/122573
Looks like the arginfo patch broke it.., well, actually it uncovered a
bug in ext/reflection.
The messages are correct, ReflectionMethod::invokeArgs takes two
arguments but
http://phpfi.com/122573
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hello Bob,
have you looked at head output of Reflection lately? I guess that contains
all you want, right?
marcus
Wednesday, November 23, 2005, 5:19:10 AM, you wrote:
Here's an idea for the maintainer of the Reflection API, to be able to view
the class a method is defined in (if not
Hi,
This has been do-able in PHP5 for somewhile, (wrote a reflection
browser while ago to show such things)
http://www.ren.dotgeek.org/classbrowser/?class=DOMCdataSection
Jared
Here's an idea for the maintainer of the Reflection API, to
be able to view the class a method is defined
Hello Jared,
hey cool stuff! Any chance you could publish this or make it a PEAR class
or put it into the newly created Reflection extension as example?
best regards
marcus
Wednesday, November 23, 2005, 12:50:25 PM, you wrote:
Hi,
This has been do-able in PHP5 for somewhile, (wrote
Hi,
hey cool stuff! Any chance you could publish this or make
it a PEAR class or put it into the newly created Reflection
extension as example?
http://sourceforge.net/projects/phpclassbrowser/
Its in CVS at sourceforge. (Still haven't gotten around to reading up on how to
create file
Here's an idea for the maintainer of the Reflection API, to be able to view
the class a method is defined in (if not overridden).
class Vehicle {
function go() {}
function crash() {}
}
class Car extends Vehicle {
function crash() {}
function collectInsurance() {}
}
class Ford
Whoops, that memcmp should be a strcmp.
-Original Message-
From: Bob Silva [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 22, 2005 8:19 PM
To: 'internals'
Subject: [PHP-DEV] Reflection API idea
Here's an idea for the maintainer of the Reflection API, to be able to
view
Am I just blind or do we not have a method in the Reflection API that
retuns the default value of a class' property?
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
--
PHP Internals - PHP
revision 1.136
date: 2004/10/31 15:30:53; author: helly; state: Exp; lines: +163 -1
- Add ReflectionFunction::invokeArgs(array)
- Add ReflectionMethod::invokeArgs(obj, array)
Why was this added?
These:
1) call_user_func_array(
array(new ReflectionMethod('class', 'method'), 'invoke',
Timm Friebe wrote:
Why was this added?
I asked Marcus to add these.
These:
1) call_user_func_array(
array(new ReflectionMethod('class', 'method'), 'invoke',
array(1, 2, 3)
)
2) call_user_func(
array(new ReflectionMethod('class', 'method'), 'invoke',
1, 2, 3
On Tue, 2004-11-02 at 13:52, Sebastian Bergmann wrote:
Timm Friebe wrote:
Why was this added?
I asked Marcus to add these.
He forgot to support invokeArgs(NULL, array(...)) for static invocation
(Warning: invokeArgs() expects parameter 1 to be object, null given).
[...call_user_func*
Timm Friebe wrote:
Care to elaborate? Except for the call_user_func-syntax being longer I
don't see any difference.
The difference is that with using a method of ReflectionFunction or
ReflectionMethod I do not have to switch paradigms (Reflection API and
OOP vs. call_user_func*() and
Hello Sebastian, hello Timm,
after all the differnece is whether we know of the typical PHP user can
find out.
marcus
p.s.: Timm you're going to FFM?
Tuesday, November 2, 2004, 11:45:18 PM, you wrote:
Timm Friebe wrote:
Care to elaborate? Except for the call_user_func-syntax being longer
Timm Friebe wrote:
Can somebody commit this?
Done.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe,
Firstly this is a question rather than an opinion (if anyone wants to
know I prefer studlyCaps for aethetic reasons so I'm happy with the
decision to use them!)
Having read all the posts on studlyCaps on this list, and understanding
that studlyCaps was the std. for all new OO APIs I found the
On Sat, 2004-04-03 at 20:00, Jochem Maas wrote:
[...]
Having read all the posts on studlyCaps on this list, and understanding
that studlyCaps was the std. for all new OO APIs I found the following a
little odd:
The documentation at
At 08:28 PM 4/3/2004 +0200, Timm Friebe wrote:
On Sat, 2004-04-03 at 20:00, Jochem Maas wrote:
[...]
Having read all the posts on studlyCaps on this list, and understanding
that studlyCaps was the std. for all new OO APIs I found the following a
little odd:
The documentation at
I am in contact with Timm re: integrating his doc into the official manual.
S
Andi Gutmans wrote:
At 08:28 PM 4/3/2004 +0200, Timm Friebe wrote:
Have you contacted the doc guys to make the add this to the PHP manual?
Andi
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe,
On Mon, 2003-12-22 at 16:05, Hans Lellelid wrote:
Hi -
We're using the Reflection API in a project for which I'm lead developer.
Seems to be something changed between beta-2 and beta-3. We're now
getting the following exception when calling getClass() on a class hint:
[...]
Works fine
On Mon, 2003-12-22 at 16:05, Hans Lellelid wrote:
Hi -
We're using the Reflection API in a project for which I'm lead
developer.
Seems to be something changed between beta-2 and beta-3. We're now
getting the following exception when calling getClass() on a class hint:
[...]
Works fine
Hi -
We're using the Reflection API in a project for which I'm lead developer.
Seems to be something changed between beta-2 and beta-3. We're now
getting the following exception when calling getClass() on a class hint:
exception 'reflection_exception' with message 'Class FileSet does not
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
Any objections?
George
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hello George,
Tuesday, December 2, 2003, 6:58:58 PM, you wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
Any objections?
No objections. Strong agreement.'
--
Best regards,
Marcus
On Tue, 2 Dec 2003, George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
Any objections?
yes
Derick
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
On Dec 2, 2003, at 1:18 PM, Derick Rethans wrote:
On Tue, 2 Dec 2003, George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
Any objections?
yes
Care to elaborate?
George
--
PHP
George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
Why deviate from PEAR CS in this?
--
Sebastian Bergmann
http://sebastian-bergmann.de/
On Tue, 2 Dec 2003, George Schlossnagle wrote:
On Dec 2, 2003, at 1:22 PM, Sebastian Bergmann wrote:
George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
Why deviate from
On Dec 2, 2003, at 1:51 PM, Adam Maccabee Trachtenberg wrote:
On Tue, 2 Dec 2003, George Schlossnagle wrote:
On Dec 2, 2003, at 1:22 PM, Sebastian Bergmann wrote:
George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard
of
CamelCaps (instead of underscores)
On Tue, 2 Dec 2003, George Schlossnagle wrote:
On Dec 2, 2003, at 1:18 PM, Derick Rethans wrote:
On Tue, 2 Dec 2003, George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for it's class and method names.
On 12/2/03 7:51 PM, Adam Maccabee Trachtenberg wrote:
On Tue, 2 Dec 2003, George Schlossnagle wrote:
On Dec 2, 2003, at 1:22 PM, Sebastian Bergmann wrote:
George Schlossnagle wrote:
I'd like to convert the reflection API to the current php standard of
CamelCaps (instead of underscores) for
On Tue, 2 Dec 2003, Christian Stocker wrote:
This raises my question of my the new Exception class uses CamelCaps instead
of underscores?
For instance, its methods are: getMessage(), getCode(), etc.
I don't think any other built-in method or packaged extension does this.
ext/dom and
From: Derick Rethans [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 8:02 PM
On Tue, 2 Dec 2003, George Schlossnagle wrote:
On Dec 2, 2003, at 1:18 PM, Derick Rethans wrote:
On Tue, 2 Dec 2003, George Schlossnagle wrote:
I'd like to convert the reflection API to
It's not an annoyance - it's not my spec, I'm just implementing it.
I'm happy to change the code to work via properties instead, it's not a
major change. I would like to settle on a concensus first.
+1 (maybe both)?
George
--
PHP Internals - PHP Runtime Development Mailing List
To
On Wed, 02 Jul 2003, Andi Gutmans wrote:
I've already said so, but I definitely prefer methods.
So do I. Overloading properties is a bit of magical powder that's
appropriate only in some cases.
-Andrei
* There is no knowledge that is not power. -- Ralph Waldo Emerson *
--
PHP Internals - PHP
On Thu, Jul 03, 2003 at 03:36:58PM +0200, moshe doron wrote:
It's not an annoyance - it's not my spec, I'm just implementing it.
I'm happy to change the code to work via properties instead, it's not a
major change. I would like to settle on a concensus first.
+1 (maybe both)?
At 06:40 PM 3/7/2003 -0400, Jon Parise wrote:
On Thu, Jul 03, 2003 at 03:36:58PM +0200, moshe doron wrote:
It's not an annoyance - it's not my spec, I'm just implementing it.
I'm happy to change the code to work via properties instead, it's not a
major change. I would like to settle on a
having had a quick think about this, here some thoughts that may affect it.
What is the API going to be used for.
a) replacement for method_exists(), call_user_func() in code
.. which makes sense for the object methods...
b) quick testing of what an interface is - as in print_r() is quicker
than
At 01:55 PM 1/7/2003 -0400, George Schlossnagle wrote:
On Tuesday, July 1, 2003, at 12:56 PM, Sterling Hughes wrote:
Not to throw a wrench in the wheel, but properties seem to be the more
appropriate pattern. Especially when taking PHP's object overloading
abilities into play. Accessors are a
On Tue, 01 Jul 2003, Alan Knowles wrote:
It would be alot nicer if you could provide the majority of these as
object variables (and/or) functions, it would enable
print_r(new PHP_Function('counter'));
which would save a lot of messing around, and writing code for general
queries..
I posed
Not to throw a wrench in the wheel, but properties seem to be the more
appropriate pattern. Especially when taking PHP's object overloading
abilities into play. Accessors are a Java paradigm that's as half-baked
as it is repetitive, when you have overloading you no longer need
property
On Tuesday, July 1, 2003, at 12:56 PM, Sterling Hughes wrote:
Not to throw a wrench in the wheel, but properties seem to be the more
appropriate pattern. Especially when taking PHP's object overloading
abilities into play. Accessors are a Java paradigm that's as
half-baked
as it is
I must be thick. I don't quite understand how the source relates to what is
described in the .png. Take for example the following from the api.c file:
static zend_function_entry php_function_functions[] = {
ZEND_FE(php_function, NULL) ZEND_FE(php_function_isinternal, NULL)
On Monday, June 30, 2003, at 11:35 AM, George Schlossnagle wrote:
A look in sqlite answered my question - I should be using
ZEND_NAMED_FE. Will update patch momentarily.
Updated now.
-- George Schlossnagle
-- Principal Consultant
-- OmniTI Computer Consulting, Inc.
-- +1.410.872.4910 x202
--
On Mon, 30 Jun 2003, George Schlossnagle wrote:
On Monday, June 30, 2003, at 12:04 PM, Andi Gutmans wrote:
I must be thick. I don't quite understand how the source relates to
what is described in the .png. Take for example the following from the
api.c file:
I talked this over with
At 11:44 AM 30/6/2003 -0400, George Schlossnagle wrote:
On Monday, June 30, 2003, at 11:35 AM, George Schlossnagle wrote:
A look in sqlite answered my question - I should be using
ZEND_NAMED_FE. Will update patch momentarily.
Updated now.
I still get the old .diff via the URL you posted. Can
On Monday, June 30, 2003, at 02:48 PM, Andi Gutmans wrote:
At 11:44 AM 30/6/2003 -0400, George Schlossnagle wrote:
On Monday, June 30, 2003, at 11:35 AM, George Schlossnagle wrote:
A look in sqlite answered my question - I should be using
ZEND_NAMED_FE. Will update patch momentarily.
Updated
At 02:01 PM 30/6/2003 -0400, George Schlossnagle wrote:
On Monday, June 30, 2003, at 02:48 PM, Andi Gutmans wrote:
At 11:44 AM 30/6/2003 -0400, George Schlossnagle wrote:
On Monday, June 30, 2003, at 11:35 AM, George Schlossnagle wrote:
A look in sqlite answered my question - I should be
Andi Gutmans wrote:
Reflection_Function
+1
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe,
On Monday, June 30, 2003, at 03:10 PM, Andi Gutmans wrote:
At 02:01 PM 30/6/2003 -0400, George Schlossnagle wrote:
On Monday, June 30, 2003, at 02:48 PM, Andi Gutmans wrote:
At 11:44 AM 30/6/2003 -0400, George Schlossnagle wrote:
On Monday, June 30, 2003, at 11:35 AM, George Schlossnagle
On Mon, 30 Jun 2003, George Schlossnagle wrote:
Oh. Should be fine now. Plus the naming change for the class.
Why aren't you using PHP_METHOD() macro?
-Andrei
* Entropy isn't what it used to be. *
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
It would be alot nicer if you could provide the majority of these as
object variables (and/or) functions, it would enable
print_r(new PHP_Function('counter'));
which would save a lot of messing around, and writing code for general
queries..
Regards
Alan
$obj = new PHP_Function(counter);
print
Here is a first implementation of the reflection api, for functions
(class PHP_Function in you diagram)
http://www.schlossnagle.org/~george/php/reflection.diff
http://www.schlossnagle.org/~george/php/zend_reflection_api.c
http://www.schlossnagle.org/~george/php/zend_reflection_api.h
Comments?
On Sun, 30 Mar 2003, Alan Knowles wrote:
- If you stored token start/end then you would be able to do getSource
for function/method/class.. etc.. (which can do a load file/tokenizer
and return implode('',array_range(starttoken,endtoken)
Keeping track of the tokens this way would require
At 03:37 PM 3/29/2003 -0500, Andrei Zmievski wrote:
I have the first draft of PHP 5 reflection API ready. You can find it
at:
http://www.gravitonic.com/software/php/reflection.txt
Comments and suggestions are appreciated.
By the way, I might have missed it,but maybe we should have a way to
On Sat, Mar 29, 2003 at 03:37:30PM -0500, Andrei Zmievski wrote:
I have the first draft of PHP 5 reflection API ready. You can find it
at:
http://www.gravitonic.com/software/php/reflection.txt
Comments and suggestions are appreciated.
It would be cool if there was a way to get the
On Sun, 30 Mar 2003, Jon Parise wrote:
It would be cool if there was a way to get the (defined) set of
parameters for a function / method. I'm going to assume that, because
it's not included in your proposal, it's not currently possible given
the current model, though.
Right. The engine
On Sat, 29 Mar 2003, Marcus Börger wrote:
http://www.gravitonic.com/software/php/reflection.txt
Comments and suggestions are appreciated.
What about doing it with some interfaces?
Why?
-Andrei http://www.gravitonic.com/
* Software never has bugs.
At 22:09 29.03.2003, Andrei Zmievski wrote:
On Sat, 29 Mar 2003, Marcus Börger wrote:
http://www.gravitonic.com/software/php/reflection.txt
Comments and suggestions are appreciated.
What about doing it with some interfaces?
or an abstract base class because most methods are the same
On Sat, 2003-03-29 at 21:37, Andrei Zmievski wrote:
I have the first draft of PHP 5 reflection API ready. You can find it
at:
http://www.gravitonic.com/software/php/reflection.txt
Comments and suggestions are appreciated.
* ClassType::getMethods([int flags]);
I assume flags is a
On Sat, 29 Mar 2003, Timm Friebe wrote:
I have the first draft of PHP 5 reflection API ready. You can find it
at:
http://www.gravitonic.com/software/php/reflection.txt
Comments and suggestions are appreciated.
* ClassType::getMethods([int flags]);
I assume flags is a bitfield
83 matches
Mail list logo