Re: [PHP-DEV] PHP_5_3 Branched

2007-09-28 Thread Lukas Kahwe Smith

Steph Fox wrote:

So I'm with Ilia over all that. The question is who? Used to be that 
whoever felt they had the time to do it could, so long as nobody fought 
the proposal. I don't see anyone fighting against your proposal for 
Johannes (I wouldn't either) but I also agree with Pierre's diagnosis, 
that you'd be good at the job.


Since I already stated that I am only interested in the part of the job 
that does not require php-src karma, I am probably not a good fit. I 
would definitely change the job scope. As such I think Johannes is then 
still the best option for this delayed take over because he can take the 
full job and because he is fresh young blood to train for the next 
decades of PHP :)


regards,
Lukas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP_5_3 Branched

2007-09-28 Thread Steph Fox
Since I already stated that I am only interested in the part of the job 
that does not require php-src karma, I am probably not a good fit. I 
would definitely change the job scope. As such I think Johannes is then 
still the best option for this delayed take over because he can take the 
full job and because he is fresh young blood to train for the next 
decades of PHP :)


This is too easy - are we posting to the right list? :)

Good luck Johannes!

- Steph

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: using zend_parse_parameters to get an object of an externally defined class

2007-09-28 Thread Johannes Schlüter
Hi,

On Fri, 2007-09-28 at 13:21 +0200, Michael Wallner wrote:
 alon wrote:
  A newbie question:
  
  How can I use zend_parse_parameters to accept object of an external class 
  as 
  parametr.
  
  I want for example to build a method that accepts 'DateTime' objects.
 
  But how do I initiate the zend_class_entry to specify an object of the 
  DateTime class?
 
 The class entry pointer or a function which returns it needs to be
 exported by the datetime API.  IIRC that's not the case ATM.
 

you can also get the ce using zend_fetch_class() API function. So the
code would look something like

zend_class_entry *ce = zend_fetch_class(DateTime,
   sizeof(DateTime)-1, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
  O, obj, ce) == FAILURE) {
return;
}

When referencing an internal class it should be enough to do the fetch
just once and cache the value inside your extension.

 -- 
 Michael
 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP_5_3 Branched

2007-09-28 Thread Michael Wallner
Ilia Alshanetsky wrote:
 I am a biased party here, so take this with a grain of salt ;-)
 
 First of all, I definitely think we need 2 release masters, for 5.X tree
 given that there will be two active branches, at least for the next few
 months, there is simply too much work for one person to do. My
 suggestion was going to be (Lukas beat me to the punch with his
 proposal) that I RM 5.3 release and ask someone new to take over the 5.2
 branch and within 1-2 releases of 5.3.0 have that person take over 5.3
 branch, once they are a bit more familiar with the process. I do agree
 that having more people try their hand at being RM is a very good idea
 and historically every minor/major release had a new RM.

I like that idea, too... but I don't think that Johannes would have big
problems starting with 5.3.0.  Anyway, I'd like to see Johannes as RM
for 5.3--now or a bit later.

-- 
Michael

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] using zend_parse_parameters to get an object of an externally defined class

2007-09-28 Thread alon
A newbie question:

How can I use zend_parse_parameters to accept object of an external class as 
parametr.

I want for example to build a method that accepts 'DateTime' objects. I know 
that the syntax of zend_parse_parameters is something like:

zval *obj;
zend_class_entry ce;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
  O, obj, ce, d) == FAILURE) {
return;
}

But how do I initiate the zend_class_entry to specify an object of the 
DateTime class?

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: cvs: php-src(PHP_5_2) / run-tests.php /ext/bz2/tests 005.phpt /ext/standard/tests/general_functions phpcredits.phpt phpinfo.phpt /ext/standard/tests/strings sha1.phpt /ext/zlib/t

2007-09-28 Thread Zoe Slattery

Michael Wallner wrote:

Nuno Lopes wrote:
  

nlopess Fri Sep 14 15:28:04 2007 UTC



  

  Log:
  changes to run-tests.php:
  - change %s to %a
  - make %s = [^\r\n]+
  - fix tests accordingly



I think this is a very bad change.  While tests of bundled extensions
can be updated accordingly, pecl extension tests have no way to be
version agnostic in this regard.


  
Mike - that's a fair point. When we looked through the PHP tests we 
found that the vast majority (all except 4) relied on the %s behaviour 
as is is currently implemented - that is *not* matching over a line end. 
Only 4 tests were actually intentionally using %s to match over line 
endings. From what you say it sounds as though many more of the PECL 
tests behave this way?


Zoe Slattery

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [patch] Late static bindings (LSB)

2007-09-28 Thread Robin Fernandes
Sorry to persist with this, but I think it could be really useful to
clarify the meaning of static:: outside of method bodies...
particularly since parent:: and self:: can already behave very
strangely in such scenarios (see
http://news.php.net/php.internals/32443 ).

For example, I find the following behaviour with the current patch
counter-intuitive:

?php
// NOTE: X is not related to A.
class X  {
  const MY_CONST = I am completely unrelated to class A.;
  static function createA() {
new A;  // triggers initialiser evaluation
  }
}

class A {
  const MY_CONST = const A;
  public $p = static::MY_CONST;
  static function getInstance() {
return new A;
  }
}

// First instantiate A inside X. This causes A's properties'
// default values to be evaluated within X's scope.
X::createA();

// Now that A's default values have been evaluated,
// behaviour is as if any new instance of A treats
// the occurrence of static:: on line 12 to mean X.

// Instantiate A inside A:
$a = A::getInstance();
var_dump($a-p);// has value of X::MY_CONST.

// Instantiate A at global scope:
$a = new A();
var_dump($a-p);// has value of X::MY_CONST.
?

Actual output:
string(37) I am completely unrelated to class A.
string(37) I am completely unrelated to class A.


Some thoughts:
 - static:: could simply be forbidden in all class property/constant
default values.
 - Any occurrences of static:: in instance property default values
could behave as if they were in the constructor, but be forbidden in
static property and constant initialisers.
 - Other ideas?


Also, there are some questions around reflection. All of the following
A::reflect*() calls cause a fatal error like:
  PHP Fatal error:  Undefined class constant 'MY_CONST' in %s on line %d

?php
class A {
  const MY_CONST = const A;
  const C1 = static::MY_CONST;

  static function f($a = static::MY_CONST) {
return $a;
  }

  static function f2() {
static $x = static::MY_CONST;
  }


  static function reflectConst() {
$rc = new ReflectionClass('A');
var_dump($rc-getConstant('C1'));
  }

  static function reflectArg() {
$rm = new ReflectionMethod('A::f');
$rps = $rm-getParameters();
var_dump($rps[0]-getDefaultValue());
  }

  static function reflectStat() {
$rm = new ReflectionMethod('A::f2');
var_dump($rm-getStaticVariables());
  }

}

A::reflectConst(); // fatal error
A::reflectArg();   // fatal error
A::reflectStat();  // fatal error
?

Is this desirable? One could argue that the reflection calls emanate
from A::, so static:: could be resolved accordingly. This test case
suggests that static:: is in fact being bound to the ReflectionClass
class itself (since ReflectionClass::IS_FINAL===64) :

?php
class A {
  const IS_FINAL = This string is not integer sixty-four;
  const C1 = static::IS_FINAL;
}

$rc = new ReflectionClass('A');
$rc-getConstant('C1');  // trigger evaluation of A::C1

var_dump(A::C1);
?

Actual output:
int(64)


Kind regards,
Robin

On 27/09/2007, Jingcheng Zhang [EMAIL PROTECTED] wrote:
 Hello,
 static methods seem exactly like dynamic binded methods now, is there
 any chance that abstract static function being restored from E_STRICT
 limitation? Currently it is allowed in interfaces, but forbidden in abstract
 class, I don't know why php implements static method in this way, this
 seems strange.. Thanks!

 On 9/27/07, Stanislav Malyshev [EMAIL PROTECTED] wrote:
 
   So, if I understand you well, Stanislas, you are personally not much
  into
   static:: but more into making that sort of code working :
  
   interface iC {
 public $structure;
   }
   abstract class A implements iC {
 public function display() {
 echo self::$structure;
 }
   }
   class B extends A {
 static public $structure = This is a string.;
   }
   $b = new B();
   $b-display();
 
  No, I don't think we should make interfaces with variables, I'm just
  telling that the code before had API that not allowed correctly enforce
  its requirements.
  --
  Stanislav Malyshev, Zend Software Architect
  [EMAIL PROTECTED]   http://www.zend.com/
  (408)253-8829   MSN: [EMAIL PROTECTED]
 
  --
  PHP Internals - PHP Runtime Development Mailing List
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 Best regards,
 Jingcheng Zhang
 Room 304, Dormitory 26 of Yuquan Campus, Zhejiang University
 P.R.China


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: cvs: php-src(PHP_5_2) / run-tests.php /ext/bz2/tests 005.phpt /ext/standard/tests/general_functions phpcredits.phpt phpinfo.phpt /ext/standard/tests/strings sha1.phpt /ext/zlib/tests

2007-09-28 Thread Michael Wallner
Nuno Lopes wrote:
 nlopess   Fri Sep 14 15:28:04 2007 UTC

   Log:
   changes to run-tests.php:
   - change %s to %a
   - make %s = [^\r\n]+
   - fix tests accordingly

I think this is a very bad change.  While tests of bundled extensions
can be updated accordingly, pecl extension tests have no way to be
version agnostic in this regard.



-- 
Michael

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Bug 42637: Soap Fault

2007-09-28 Thread Bill Moran

http://bugs.php.net/bug.php?id=42637

I've posted a fix to this bug that is working in our test environment.
It doesn't seem as if any committers have looked at this yet, can
someone please comment?

-- 
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

[EMAIL PROTECTED]
Phone: 412-422-3463x4023

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: cvs: php-src(PHP_5_2) / run-tests.php /ext/bz2/tests 005.phpt /ext/standard/tests/general_functions phpcredits.phpt phpinfo.phpt /ext/standard/tests/strings sha1.phpt /ext/zlib/t

2007-09-28 Thread Nuno Lopes

nlopess Fri Sep 14 15:28:04 2007 UTC
  Log:
  changes to run-tests.php:
  - change %s to %a
  - make %s = [^\r\n]+
  - fix tests accordingly



I think this is a very bad change.  While tests of bundled extensions
can be updated accordingly, pecl extension tests have no way to be
version agnostic in this regard.

Mike - that's a fair point. When we looked through the PHP tests we found 
that the vast majority (all except 4) relied on the %s behaviour as is is 
currently implemented - that is *not* matching over a line end. Only 4 
tests were actually intentionally using %s to match over line endings. 
From what you say it sounds as though many more of the PECL tests behave 
this way?


Exactly. Although this may (and does) break some tests, the vast majority of 
the tests should continue working correctly.
I think that the change is important enough to award this BC break. In PECL 
extensions, if you really need the old behavior, you can always use 
the --EXPECTREGEX-- section.


Nuno 


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: using zend_parse_parameters to get an object of an externally defined class

2007-09-28 Thread Michael Wallner
alon wrote:
 A newbie question:
 
 How can I use zend_parse_parameters to accept object of an external class as 
 parametr.
 
 I want for example to build a method that accepts 'DateTime' objects.

 But how do I initiate the zend_class_entry to specify an object of the 
 DateTime class?

The class entry pointer or a function which returns it needs to be
exported by the datetime API.  IIRC that's not the case ATM.

-- 
Michael

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php