l new branches.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
gards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
#x27;s only one way to both maintain BC during a "transition" period, and
fix flaws to prepare for the next 10 years. And that's having two
implementations.
The original one will gradually be deprecated and eventually removed.
Regards,
Stan Vassilev
--
PHP Internals - PHP
ay2);
$string->len();
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ale issue was brought
up.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
',
'property4' => '4',
'property5' => '5',
);
With proper update, code hinting for named parameters could be introduced in
IDEs in order not to end up slower than the current syntax.
It also solves other issues and doesn't s
',
'property4' => '4',
'property5' => '5',
);
With proper update, code hinting for named parameters could be introduced in
IDEs in order not to end up slower than the current syntax.
It also solves other issues and doesn
1 second seems sufficient on a pristine condition unused
server, but when your server is loaded, a spike in load may cause a number
of shutdown handlers to take more than 1 second, and stop middway running,
causing a lot of unpredictability and trouble for those who rely on this
feature.
string processing. I'd rather have it take more RAM for
Unicode strings while being fast, and use Latin-1 when what I need is
Latin-1.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On 03/01/2010 11:35 PM, Stan Vassilev wrote:
Hi,
The gettype() documentation warns people that the returned string is
"subject to change".
Why is there a function that's subject to change in the API?
Because life is complicated.
Because gettype("test") returns &qu
or gettype() is when we do not test
for a certain type (as in, we test for any type), which is less optimal when
executed as 5-6 is_*() calls.
Regards,
Stan Vassilev
viewed and possibly fixed at a
later point as the egine changes and a solution no longer is a BC or
performance issue. It's also insulting to the submitter, who took from his
time to file an actual problem and was basically dismissed as uninformed on
the issue.
Regards,
Stan Vassilev
--
The gc code when combined with apc is still a bit shaky in 5.3. I
haven't figured out why yet. And my motivation for figuring it out is
pretty low as code that relies on gc is slow.
-Rasmus
Motivation for relying on GC in 5.3 is pretty low because 5.3 is still a bit
shaky...
--
PHP Intern
the "keep arguments as is" behaviour is certainly better in the
long run - issues like OpenID should be taken into account.
Hi,
PHP6 *is* the long run.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
removed, people
who use the underscore filter with register_globals have already lost
backwards compatibility.
For those who want to *emulate* register_globals with extract(), they can
easily emulate the underscore filter as well (it's 3 lines of code).
Regards,
Stan Vassilev
--
Such symbols could be simply
referred to with the intended syntax: ${'a.b.c.d'}.
By the way, extract now seems to just ignore those vars when given an array:
extract(array('foo.bar' => 'baz'));
echo ${'foo.bar'}; // notice, no such variable
echo $foo
I hope PHP6 will remove this processing as register_globals will be
completely removed at that point.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ode readability.
They are just arbitrarily imposed because of an irrational fear that
suddenly everyone will be jumping on the new feature for his entire
codebase. Even most poor coders are smarter than this.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
them from autoload (except for the artificially
introduced one in 5.3).
Regards,
Stan Vassilev
- Original Message -
From: Rack-Soft security
To: internals@lists.php.net
Sent: Friday, October 16, 2009 5:32 PM
Subject: [PHP-DEV] Autofunc patch (automatically loading func
tor:
class foo {
...
private $flags;
function __construct()
{
$this->flags = self::FLAG_1 | self::FLAG_3;
}
}
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
tance (instance of Closure)... or alternatively: array(object
$instance of Closure, string "__invoke__")
// global scope
null
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
alling the code intended
for internal use and breaking something somewhere. The only solutions today
for properly capsulating such code are ugly & slow hacks (including
debug_backtrace).
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
makes no sense, so people mute them out of necessity
(or use handlers). I'd rather fix the API-s instead of pretend it doesn't
happen by masking the errors.
All of the above would be a job for 6.0 IMHO, 5.x has pulled enough changes
under our feet and it's really not fun a
me to pick which you want first:
A) Stable 5.3 with namespaces, closures, late static binding, phar, SPL
additions and more (essential brand new functionality, feature complete,
only needs bug fixes).
B) Strict type casts/hints (shortcut for existing is_*() / cast
functionality).
Regards,
Sta
d feature such as strict type hints, has
everyone turning 180 degrees and putting it in a minor release in the course
of a week.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
s defined by the same rules as is_scalar(), but also allows null as a
passed value to be consistent with the other check types.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
// conflict with full PHP tags
*/ ?>
I think these four examples should render any argument containing "XML" and
"PHP" in the same sentence invalid.
My suggestion is, follow your own notes: "Leave short tags alone - never
talk about it again" (http://wiki.php
oesn't change overnight. Any volunteers :)?
Regards,
Stan Vassilev
loy PHP on Windows today? Go with the RC of 5.3?
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
(NAN)
var_dump($realNaN == $realNaN); // true, should be false, NaN should never
match NaN
Regards,
Stan Vassilev
ives it access to the class state/properties.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
or.
2) Extending classes can override the property/method, unless it's a final
method, just like as if they override normal parent class property/method.
3) There's a single space for a class property and its trait properties, so
access works as if it was all class properties.
Feedback?
so we need to keep it optimized for that.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
time, leaving autoload to figure out only where a symbol is, not
whether it's present.
I've not noticed great interest in this approach last time I offered it.
Regards,
Stan Vassilev
Hi,
So definetly I need to prepend the \ or declare the "usage" of the
class at the beginnin
Hi,
Try this:
use PDO;
Regards,
Stan Vassilev
-
Hello,
I've been writing in the last days a web application on PHP 5.3 (beta1
although RC was released) cause of all the goodies it brings,
speciall
Class to the function.
In PHP you can have constant/function/class of the same name and the only
way to tell them apart is context.
It needs to be either a magic constant or a language construct.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe,
after we've littered our code with tons
of manually written out explicit references.
One problem with your proposal / my second proposal is, it works for
classes, but doesn't address namespaced 1) functions 2) constants.
A new keyword would address this, but then, who wants a new
bit string" format is to preserve compatibility with
spl_object_hash, so it can replace it, instead of introducing a new similar
function.
I've had no time to look further into this, but Marcus seems to like the
basic idea, so feel welcome...
Regards,
Stan Vassilev
--
PHP Int
efore
you throw. I leave up to you how appropriate that is.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Kuba,
For the moment some unexpected behaviour caused by use of undefined
constant may be hard to fix with low error reporting level.
So don't use a low error reporting level.
Moreover,
treating an undefined constant as a string does not make sense. I know
that PHP is intended to be a fle
1. Document the fact that if you want to strictly conform to the JSON
spec and be sure your json_encode output will work in various JSON
parsers, you have to pass it a PHP array or object.
+1
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe
echo 'var foo = '.json_encode("hello world");
...to this:
echo 'var foo = '.substr(json_encode(array("hi world")), 1, -1);
A flag that defaults to false would be just as explicit and educational, and
more efficient, than forcing hacks on us like the a
flows.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ty of this BC break, I guess we wouldn't be
having this discussion.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
is
very rarely used by anyone, if at all (Google Code Search shows 0 hits on PHP
code).
3) It's intuitive as it follows the conventions established by the other magic
constants, and serves a very similar purpose.
Regards,
Stan Vassilev
e, even though just
like you I see some WTF-s in the old behaviour.
Full rethinking of this and consistently respecting the Array/Iterator
interfaces would be great and needed for 6.0, though.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
> Zend_Acl ==> Zend_Acl_Resource_Interface, Zend_Acl_Role_Interface,
> Zend_Acl_Role_Registry, Zend_Acl_Assert_Registry...
>
> Regard, Stan Vassilev
Stan, ZF doesn't use namespaces yet. This is not namespaced code.
Namespaced code requires different convention
(http://fra
ally suggest we leave that argument out.
Regard, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ic need :P
Consider callbacks, factories, strategies, drivers, adapters, proxies and so
on which typically may and do pass class/function names around. I don't
know.
I'd rather endure the pain and write the string in full every single time
than cause extra confusion in my source co
ssign the class
name, but then we clash with constants which have the same name as the
class. So that's not doable either.
But it's definitely in-your-face issue while using namespaced code.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Wed, Nov 12, 2008 at 03:57, Stan Vassilev | FM <[EMAIL PROTECTED]>
wrote:
I don't see it would work with something like
import_request_variables() unless thats removed or extract(), which is
some of the reasons for this replacement feature afair.
There was never a need for the
eloper as say classes and interfaces.
Also we can't overload "use" for this as "use" specifically only imports
symbol names, not actual code, into the environment. It doesn't have the
knowledge of whether something is a namespace, or a class, or a category, so
to
ds it, it can do it there only for that
import. I.e.
$_GET['foo.bar'] is just fine, and importing 'foo.bar' with the above
function could still produce $foo_bar only for that specific edge case.
It's just a premature replacement too early the stack.
Regards, Stan Vassil
look at it, I
could start tinkering with it in my free time and post patches if I arrive
at anything. Then we can test how it impacts real world code.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
e existing algorithm will be used.
However "static" access is the predominant usage, especially for objects,
but also for arrays, so this should have significant impact.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
he world in the form of Adapters, Factories, Drivers,
etc.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
's no need to generate a hashmap in the first place
- String literal id-s are unique integers and have no conflicts, so no need
to do conflict resolution.
That would help with objects as well.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
es class absolute path "bar\baz"
In fact, use doesn't even know what the prefix would mean:
use \bar\baz; // parse error
So it has to be decided which way the system goes to avoid confusion and
bugs IMO.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ocal use declarations etc.
However Greg's proposal is in fact a strict subset of scopes, which could be
extended in the future in a backcompat nature.
It also covers all use cases by the community, so I'm "+1", if anyone is
counting that is. Sorry for the noise :)
Regards,
Sta
paces.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Technically, you could argue that blah::hi() should resolve to
blah\blah::hi(), but it is very difficult to track and figure out what
"blah" means by eye. Thus, in the patch I implemented, if bracketed
namespace declarations exist, global use statements are not allowed, but
must exist within na
ibraries, frameworks, which are more static in nature than
the application code utilising them.
As for the extension, I'll check it out, thanks.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
this list, including to this thread: they're not funny. The idea of OSS
forums like this list, isn't to generate easy entertainment for bored
programmers.
A valid point elsewhere is lost everytime a thread heads this way.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Develop
potential to simplify drastically some workflows,
especially in large complex frameworks, so if it picks up, maybe 5.4, or 6
or who knows.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
es and that class to work as a normal array with the
array functions.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
here and what might not work, and
tweak the language for it.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Drupal, Joomla etc. to reduce side effects.
Regards, Stan Vassilev
ly
avoid in .NET by "using Foo.Utils.*". In PHP, we can't do star-imports since
the parser doesn't know what's there to import at runtime. So we can't
easily avoid the redundancy, unless we manually import the classes we want
to use, one by one.
So that
r it'll remain an invalid syntax by the
time of release of 5.3.
Regards,
Stan Vassilev
erience and knowledge, with magical fallbacks and
autoload mysteries.
I suggest we all clear our minds a little and give a serious thought to all
this again. If you just say "no fallbacks", some people will bitch 2-3 days,
then try it, and see that it was not all that bad after a
ight now,
than do it right. So I do it wrong.
Namespaces won't change any of this, since I still can't autoload my
function library.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ct, and
each has a unique name. With the magical fallbacks, all this goes to hell.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
eak inside it. This will be confusing to people, who especially use
fallbacks to transparently implement missing PECL extensions or
functionality, or augment the internal functions of PHP with other, for ex.
user implemented ifsetor(), array_*() or str*() functions.
Regards,
Stan Vassilev
--
eof Symbol\Name;
With this identifier, the above example can be "normalized" to the following
code:
use Foo\Bar as B;
F::loadFunc(nameof B\Baz); <-- will send 'Foo\Bar\Baz' as the argument
echo B\Baz();
NOTE: As a side effect this means less direct writing of string function/class
names, and less complaints about \ being the escape characters.
Regards,
Stan Vassilev
The practice of passing traversable objects to our
views, mixed with real arrays, is already common (I do it too).
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
u please. The source code is the
ultimate PHP configuration ...
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
solutions are
what caused the necessity to use "\" instead of "::" in the first place.
When you're cornered by your ill past decisions, you either break BC (which
we don't want to do), or add more WTF-s to the language as it evolves.
Regards, Stan Vassil
I've not seen plenty of "Class::singleton()" myself, getInstance is an
accepted standard in all languages, including the PHP code I wrote, and I've
had experience with.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit
key change is: not to make difference between internal and user global
functions, just fall back to global ones, so that there's no additional
confusion among drop-in replacements, user resources, and internal
resources.
Send feedback. Thanks.
Stan Vassilev
--
PHP Internals - PHP
internal class.
Is this negligible performance hit? Actually (re)scanning my full library
takes few seconds of heavy disk grinding. Make your own conclusions.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
le paths. When you're inside a directory you need to prefix
your path with "/" (eg "\") to refer to the root, but you don't need to do that
when you're in the root directory.
Regards,
Stan Vassilev
orrectly: "foo\\tbar" and
"foo\tbar" when used as an identifier.
Think of it as a plan B in case people cause a big fuss about it (which I
think they won't: think about escaping of windows file paths and escaping in
regex pattern, we're doing just fine there).
Re
uggest header_remove('*') or simply header_remove() /no param/ removes
all headers (including the one PHP sets by default), so we can start with a
clear state.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
Naturally this line:
"$this->addObject($this, $priority);"
was meant to be:
$destructManager->addObject($this, $priority);" ...
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ager and when at shutdown, on
the manager's own destructor you just need to sort the collection by
priority and call the "real" destructor.
Now, this will work fine, but has this downside that all objects will be
held in the memory until script shutdown, so it's naturall
ou'd wish you go back and
change the damn namespace operator to just about *anything* but "::".
I wish the people who have a clear opinion of the above voice their opinion.
For those who aren't quite sure what the issues in point 4 are, please just
stay low and follow the l
al has on
code.
As for ::: vs ::, those are virtually not distinguishable in a lot of code,
so if that's to go, pick another syntax. ":>" is fine, "\" is fine, ".." is
fine.
Regards, Stan Vassilev.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
n a future release, or
present but in another form.
Regards, Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
->Query();
You're forgetting constants:
define('MyNameSpace', 'Hi ');
class SomeClass { function world() { return 'world'; }}
MyNameSpace.SomeClass::world(); // Hi world
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
I think we need string concatenation here and there ;)
Regards,
Stan Vassilev
- Original Message -
From: Arvids Godjuks
To: Stan Vassilev | FM
Cc: PHP Internals List
Sent: Monday, September 29, 2008 9:19 AM
Subject: Re: [PHP-DEV] solving the namespace conflict
Hi,
The second highest vote was :::, but there was strong objection to this
as well from some. The problem, I still believe, is that we are focused
on having the same:::stupid:::operator:::between:::everything.
The truth is that in source files, there is a clear boundary between
namespace defin
at both
functions and classes require the "use ::foo" or "::foo()" when in a
namespace, and leave namespaced functions in.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Sun, Sep 14, 2008 at 5:33 PM, Rustam Abdullaev <[EMAIL PROTECTED]>
wrote:
Hi,
Is anyone working on a suspendable request support in PHP when used as a
module in Apache?
Suspendable requests are great for supporting Server Push technology, but
are currently only supported in Jetty and Tomcat.
with namespaces in them.
Regards,
Stan Vassilev
Hi,
This is a simple patch that allows files like this:
main.php:
template example
to work without parse error.
Greg
P.S. this is the last outstanding namespace issue that I'm aware of
aside from the bracket wars, which i
ace (i.e. == no namespace) is perfectly natural in that setup.
In fact, I'd argue that we need a way to break out to global namespace
*after* a namespace too.
Something that would be naturally solved by {} but since this is
discarded... (but you see how it's not purely phylosophical issues
the scope
syntax {} will possibly be confusing. But, it'll work fine enough.
Regards,
Stan Vassilev
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Stan Vassilev | FM wrote:
Hi,
Multiple namespaces per file were introduced to allow certain
workflows in PEAR and frameworks like Symphony which can combine
multiple classes and namespaces in a single package.
They work like this:
namespace X;
...
namespace Y;
...
The problem is, no one
o that multiple files can be safely merged without changing intent
(all file-level namespace can be converted with curly brackets, and the
existing curly bracket ones don't need to be converted), example:
namespace X {
use Y as Z {
...
}
}
namespace Y {
use X as Z {
...
}
}
Waiting for your feedback...
Regards,
Stan Vassilev
Hi,
He means recursion depth, not input nesting depth. 5.3 had a proposed fast
function call algorithm which would avoid the stack limit and allow deeper
recursion, was this accepted and how does it affect the limit of 100 nested
calls?
Regards,
Stan Vassilev
Hi!
Currently I'm wo
Hi!
And I'd ask - who wants to do new DB::mysql when they can just do mysql?
I do. Because this way I don't have to worry my mysql would clash with
someone other's mysql, and I can have all DB related stuff under one roof.
It can't clash if you don't "use" someone other's mysql namespace, o
1 - 100 of 126 matches
Mail list logo