On 5 Aug 2004 at 13:59, George Schlossnagle wrote:
> > Can abstract methods be protected?
>
> No.
Why not? Look at my singleton example...
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
it.
Why can't I instruct Singleton-classes to use protected constructors?
Is this expected behavior or may I file a bug report?
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
>
>
If you want readability, try using comments!
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
valuate self at runtime instead of adding a
new keyword 'this'. The second one would only be confused with
$this. Many people (including me) are already familiar with 'self' and
expect it to refer to the class from within it is called.
--
Ferdinand Beyer
<[EMAIL PROTECTED]
ure not worth having if you
have an
> garbage collector but I can think about a few uses.
There has been a heated discussion on this topic and the conclusion
was to drop delete. Please search the archives for pros and cons.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PH
this is indeed a problem then.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On 1 Jun 2004 at 15:21, Stephan Schmidt wrote:
> Furthermore this renders the template-method pattern quite
useless, so
> IMHO it should be changed.
He should define an abstract method Foo::Baz() here.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Develop
h the second.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
is that since PHP doesn't support parameter based
method
> dispatching, you _can't_ implement both A and B, since you can
not
> comply with both signature contracts simultaneously.
IMO I should, using variable arguments. This is currently impossible.
--
Ferdinand Beyer
&l
ameters or give them
different
> names.
Provided that one has access to the interfaces...
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
t; use it as an A object.
Impl guarantees that by implementing interface A.
What if Impl::doSomething() would accept exactly two parameters,
but expects them to be arrays?
IMO you cannot enforce this strictness with loose types...
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
e two doSomething()'s
}
}
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ed methods. I repeat myself when I say that IMO such
strictness does not fit to PHP's loose character.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
array(1) {
["Not"]=>
array(1) {
["Exist"]=>
float(1)
}
}
}
Exactly the behavior you are looking for. Not even an E_NOTICE.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
lling 'Unimplemented block at xmlschemas.c:2245'.
Furthermore, every validation failure is reported using PHP warnings.
That's why it is impossible to use a "user-land exception thrower"
with schema validation at the moment. I don't know if it is the only
extension mis
rchives, please don't start another annoyingly
> long thread about it again"
":-P" is a shortcut for "It's okay for me, it was just a stupid naïve idea,
I did not know that it was already discussed in a annoyingly long
thread."
--
Ferdinand Beyer
<[EMAIL PRO
On 8 Apr 2004 at 13:07, Derick Rethans wrote:
> NO!
>
> Derick
That's all, just 'NO!'? :-P
Perhaps this could be done in userland by throwing an exception in a
user error_handler... did not test it though...
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Inter
ng(E_ERROR);
try {
mysql_connect()
}
catch (Notice $e) {
echo 'Notice: ' . $e->getMessage();
}
catch (Warning $e) {
echo 'Warning: ' . $e->getMessage();
}
catch (Error $e) {
echo 'Error: ' . $e->getMessage();
}
catch (Exception $e) {
echo '
...
Class CallMe
{
public function setup()
{
$this->fakeMethod();
}
protected function __call($method, $params)
{
echo 'you called CallMe::'.$method."\n";
}
}
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime
On 5 Apr 2004 at 10:12, Derick Rethans wrote:
> But it is not called from the outside world ...
>From the class' point of view: Yes, it is.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
r consistency and StudlyCaps. Personally I would
prefer underscores but the arguments for StudlyCaps really are
overwhelming.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
e that would happen.
>
> That doesn't mean it's not going to happen. Try to be a little
> forward-thinking.
Also think about interfaces like the new iterators and exceptions
which will surely replace the current PEAR error handling once PHP5
is out...
--
Ferdinand Beyer
<
What about using the old names as aliases for the new ones,
triggering deprecation warnings when called?
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
le to access overridden static functions or
to instantiate the concrete class.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
in an interface declaration even if it is ignored.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
nce
checks.
Because of PHP's loose character, we cannot force the user to use
the strict signature anyway. And since we have no overloading
support, but var_args, strict checks make not much sense to me.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Developmen
sing a variable parameter count:
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
re.
Don't you see a difference in the role and power of OOP in PHP and
other languages like C++ or Java?!
But let's get back to the thread's topic: I only said that re-assigning
$this is a bad. In fact it does not even matter what language I
consider to be OO...
--
Ferdinand
provided by functions. Moreover, OOP still is expensive / slower than
procedural coding. I think most people in this list (especially the core
people) will agree.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
quot;This is the Example class.\n";
}
function dump()
{
print "This is an Example object:\n";
var_dump($this);
}
}
But I could live without that since it would certainly be very much
work to implement such a change...
--
Ferdinand Beyer
<[EMAIL PR
gt; do this for PHP4.
This is not even a "feature". I think it was a bug which some guys
used for dirty hacks and work arounds (Often the difference between
a bug and a feature is very small). Fortunately this bug has been
fixed in PHP5.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
The feature you are asking for is not available in any OO language
and it even conflicts with the OOP ideology!
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
y one. I don't think there is a reasonable solution for
this problem.
In my opinion, the engine should allow adding parameters with
default values to the old API. In your example, we should just keep
the status quo. As I said before, I don't see a solution that "fits the
PHP goal"
mon prefix for the identifiers but that's a different
topic.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
keyword to declare
a method static, thus callable from outside the object context.
Example:
The pseudo variable $this is not available inside a method that
has been declared static.
-------
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PH
work for foreign classes,
though.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
use names in their native language.
I'm sure there will be many people complaining if this stays as it is.
I still don't see the need for a fixed name... it is like forcing every
exception class to have the word 'exception' in their name, just for
consistency
-
ame, "that")!=0)) {
zend_error(E_COMPILE_ERROR, "The clone method
must be declared as __clone($that)");
[...]
Why shouldn't I be able to name it as I want, e.g. $clone? Don't
understand the reason for that...
--
Ferdinand Beyer
<[EMAIL PROTECTE
t no one was interested (0 feedback).
But now that it will be included I'm very happy!
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
the notice: "This function is
currently not documented; only the argument list is available",
although a
documentation exists.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
g __get(),
__set() and __call()
Maybe there is a better prefix than "php" to strictly separate Zend
Engine from PHP. Examples are "zend_xxx", "zxxx" or "__xxx".
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ence between E_NOTICE and E_STRICT then?
It would be as easy to trigger errors like
"Notice: Use of deprecated function `is_a`; use `instanceof` instead"
Purists who want to be sure to be coding >The PHP Way< will use
error_level = E_ALL anyway...
--
Ferdinand Beyer
<[EMAIL P
r extension developers as well as OO
(like PEAR::DB) and procedural (like mysql ext) PHP APIs.
Just my two cents
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
43 matches
Mail list logo