Re: [PHP-DEV] reference caller object

2009-09-19 Thread Paweł Stradomski
breaks encapsulation. Also, PHP model is not message passing (as in eg. Erlang), we have just plain function/method calls. Also, what would be the sender/caller when executed from non-method (eg top- level script or plain function)? -- Paweł Stradomski -- PHP Internals - PHP Runtime Developm

Re: [PHP-DEV] towards the next 5.3 release

2009-02-04 Thread Paweł Stradomski
Liskov's principle... -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Upgrading to internal DateTime

2008-12-10 Thread Paweł Stradomski
;s why it's usually better to store datetimes as either UTC datetime or plain unix timestamp. I usually go with the former - using database datetime type. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Fatal error: Call to a member function on a non-object

2008-11-17 Thread Paweł Stradomski
they're request for code execution, not for value (remember, not all functions return values as they most important effect - it's not Haskell). Calling non-existing function returns in fatal error in PHP; it's the same for: $object->iHaveNoSuchMethod(); $null->method(); n

Re: [PHP-DEV] Constants in double-quoted strings

2008-10-29 Thread Paweł Stradomski
on, others might find it less readable (or indifferent). And for b - speed difference between ' and " should be negligable (esp. with opcode caches). I only worry it could break BC - people might have used "{SOMETEXT}" in strings and not expect it to be interpolated (I've done so myself). -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: my last attempt at sanity with namespaces

2008-10-17 Thread Paweł Stradomski
operator for static class access (static methods and properties), while :> or ::: is just namespace access operator, so we can always assume that anything on the left side of ::: or :> is a namespace. In Ryan's version :: is sometimes static class access operator, sometimes namespace segmen

Re: [PHP-DEV] Annotations Request

2008-08-21 Thread Paweł Stradomski
But we'd love annotations for situations such as the one I presented before, as well as WSDL generation etc. Instead of using annotations we use something like that: class X { public static myMethod_methods = array('POST', 'GET'); public static myMethod_access =

Re: [PHP-DEV] Annotations Request

2008-08-20 Thread Paweł Stradomski
as functions can have arbitrary attribute set: def a(): pass a.x = 5 It also has very powerful mechanism of decorators, which are basically higher-order functions applied to functions on their definition, but I don't think Volodymyr asks for so much. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New string functions: str_startswith() and str_endswith()

2008-07-21 Thread Paweł Stradomski
bstr($path, -strlen($extension)) == $extension) Readability would also increase. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Using Network functions.

2008-06-26 Thread Paweł Stradomski
uests, then curl or HTTP extension should be sufficient. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New flame

2008-06-24 Thread Paweł Stradomski
can express all characters in the Unicode. Do you mean that unicode still lacks some characters for asian languages used today? -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Paweł Stradomski
you are sure you know what you're doing. This is the same workaround that is needed if someone used if (! is_integer($bar)) {die()} inside of the foo method. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE: Optional scalar type hinting

2008-01-03 Thread Paweł Stradomski
d. And if you know that you have either an int or string representing an integer in $bar, then foo((integer)$bar) would work just well. The only problem with the cast is that (integer)'abc' is 0, but it has been so for a long time and there is no need to change it. is_numeric check s

Re: [PHP-DEV] Just checking something before posting a bug report

2007-09-26 Thread Paweł Stradomski
here: string(3) "foo" ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file 'unknown') So I confirm your problem (var_dump should report object, not string). -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE : Namespaces and __autoload()

2007-09-12 Thread Paweł Stradomski
would be "no". All right, seems it was fixed in the meantime - http://bugs.php.net/bug.php?id=39003 -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE : Namespaces and __autoload()

2007-09-12 Thread Paweł Stradomski
HING - a constant Something - a class ISomething - an interface (although distinguishing between classes and interfaces is not strictly necessary as those are quite similar). So if such distinction is necessary, it can be coded for specific project, using such rules as a hint or as strict rule, depending on needs. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RE : Namespaces and __autoload()

2007-09-12 Thread Paweł Stradomski
ing (Service s) {...} PHP tries to autoload type Service, but it can't know if it's looking for interface or class. Both are possible. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Patch for macros for tracking refcount and is_ref

2007-09-04 Thread Paweł Stradomski
W liście David Wang z dnia wtorek, 4 września 2007 16:24: > http://zoo.cs.yale.edu/~yw226/macros.diff.txt > > Comments? +#define always_inline inlinue Shouldn't that be +#define always_inline inline ? (in zend.h) -- Paweł Stradomski -- PHP Internals - PHP Runtime Development M

Re: [PHP-DEV] Question about Namespace patch

2007-07-23 Thread Paweł Stradomski
paces even in small scripts - just because I'll be using those libs. If using a bunch of imports is the only way that is accepted - then at least a shortcut like python's "from x import a,b,c,d,e,f,g,h" would be a nice. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Question about Namespace patch

2007-07-23 Thread Paweł Stradomski
. All other languages I know that have namespaces (Java, python, C++) allow programmers to import other namespaces locally - usually for a single file. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Question about Namespace patch

2007-07-23 Thread Paweł Stradomski
pace without using import SQLAlchemy::Column import SQLAlchemy::Table import SQLAlchemy::Join import SQLAlchemy::ForeignKey import SQLAlchemy::Session import SQLAlchemy::Transaction and tens of other classes? I know your patch makes it possible to use fully qualified names everywhere. -- Paweł S

Re: [PHP-DEV] Recursive classes ... possible bug?

2007-06-05 Thread Paweł Stradomski
returns true iff the variables refer to the same instance) instead of == (deep comparision - member-by-member). AFAIK this behaviour was introduced in 5.2 or 5.1 - well, just another BC break. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] function overriding and class inheritance

2007-05-29 Thread Paweł Stradomski
, which is a result of substituion rule already mentioned by Stanislav. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Segfault in PHP 5.2.1

2007-04-24 Thread Paweł Stradomski
y and I think it should not happen in any case - no matter if the PHP script running is buggy or not. I makes debugging difficult and brings unpredicatble results. Besides - it is not documented at all. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-21 Thread Paweł Stradomski
quot; class if you use one, but that should be a one place - if you kept your code clean. I think this solution is better, as you don't have to rely on internal refcounts, which can be implemented in another way (or dropped altogether) in future releases. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP Object-Caching and Reference Counting

2007-01-19 Thread Paweł Stradomski
ease your internal refcount by one, destructor would decrease it. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Comments on PHP security

2007-01-11 Thread Paweł Stradomski
W liście Andi Gutmans z dnia czwartek, 11 stycznia 2007 21:48: > How familiar are you with Java in shared hosting environments? Been hacking one mayor Java app to make it work with JSM. Not much, but I believe Sun took much care to make sure JSM works as advertised. -- Paweł Stradomski --

Re: [PHP-DEV] Comments on PHP security

2007-01-11 Thread Paweł Stradomski
or Java, the answer is yes. You can declare privileges for the code based on where it is located (in the filesystem tree). That should be sufficient, if used properly. -- Paweł Stradomski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php