In your example :
?php
namespace Foo;
import Blah::Exception;
$a = new Exception;
?
new Exception refer to Blah::Exception and will fail if such class
doesn't exists.
import Blah::Exception creates an alias with short name Exception only
for current file (it doesn't creates Foo::Exception)
May
Hi,
public function foo()
{
$bar= new Bar;
[...]
}
When I want to test the foo() method, I want to stub out the usage of
the Bar class, for example, and have Bar::doSomething() return a
pre-configured value instead of performing its normal operation.
This is where you'd
From: Stanislav Malyshev [mailto:[EMAIL PROTECTED]
But how would you know the class is missing? Maybe next
loader in chain
would find it.
IMO, the point, here, is that, if the requested class starts with 'PEAR2', by
convention, this name space is reserved and cannot be resolved by
Dmitry Stogov wrote:
In your example :
?php
namespace Foo;
import Blah::Exception;
$a = new Exception;
?
new Exception refer to Blah::Exception and will fail if such class
doesn't exists.
import Blah::Exception creates an alias with short name Exception only
for current file (it
Hi,
What about __class_exists() and SPL_register_class_exists_handler()?
One could suppose the classloader (the one that implements
__autoload) knows if a class exists (as in: is registered within the
classloader or the class-file exists) without loading it and maybe
the class that calls
So it's okay to discuss implementation of esoteric features like class
posing, but something as basic as a string/array slice operation still
gets a knee-jerk reaction? Double standards my friends, double standards..
-Andrei
Stanislav Malyshev wrote:
Here's much better reason: PHP is not the
How can i do subj ?
I try make this with follwoing code:
declare prop:
zend_declare_property_null(ns_ce_ ## my_class, prop, strlen(prop),
, ZEND_ACC_PROTECTED TSRMLS_CC);
at constructor:
zval *prop;
/* init */
prop = zend_read_property(Z_OBJCE_P(getThis()), getThis(), prop,
strlen(prop,),
Denis Gabaidulin wrote:
How can i do subj ?
at constructor:
zval *prop;
/* init */
prop = zend_read_property(Z_OBJCE_P(getThis()), getThis(), prop,
strlen(prop,), 1 TSRMLS_CC);
array_init(prop);
zval *prop;
MAKE_STD_ZVAL(prop);
array_init(prop);
On 10/5/07, Michael Wallner [EMAIL PROTECTED] wrote:
zval *prop;
MAKE_STD_ZVAL(prop);
array_init(prop);
zend_update_property(Z_OBJCE_P(getThis()), getThis(),
ZEND_STRS(prop)-1, prop TSRMLS_CC);
zval_ptr_dtor(prop);
IIRC complex types for internal zvals was on some engine todo
On Tuesday 02 October 2007, Alexey Zakhlestin wrote:
On 10/1/07, Martin Alterisio [EMAIL PROTECTED] wrote:
Sorry to bother, I have a few questions on this matter.
How will this impact on the SPL ArrayAccess and related interfaces and
objects?
Will there be an interface to this
Dmitry Stogov wrote:
In your example :
?php
namespace Foo;
import Blah::Exception;
$a = new Exception;
?
new Exception refer to Blah::Exception and will fail if such class
doesn't exists.
import Blah::Exception creates an alias with short name Exception only
for current file (it
Patches added to http://bugs.php.net/28261, and I re-opened the bug.
Greg
Gregory Beaver wrote:
Hi,
I spent a while tonight tinkering with the parser to try to figure out
how to allow it to use T_IMPORT as well as T_STRING for method names,
and quickly came to the conclusion that this
With PHP 5.3 will there be a get_namespace($object) function equivalent
to get_class($object)?
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On 10/5/07, Larry Garfield [EMAIL PROTECTED] wrote:
Here's the question I see. Right now, does an ArrayAccess object work with
array_slice()? If so, then [2, 5] syntax would be just some nice syntactic
sugar. If not, then it becomes a powerful new feature, and implementing it
on normal
14 matches
Mail list logo