Re: question regarding type hinting parameters of php functions (array_slice)

From: Date: Mon, 10 Dec 2007 19:23:07 +0000
Subject: Re: question regarding type hinting parameters of php functions (array_slice)
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-33907@lists.php.net to get a copy of this message
    if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) {
+        convert_to_long(length_param);
Isn't convert_to_long non-separating one? I think the variable supposed to be separated before conversion, so convert_to_long_ex (and zval **) would be in place.
Hm you're probably right... if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) { + convert_to_long_ex(&length_param); length = Z_LVAL_P(length_param); } else { length = num_in; - because it's a zval * these days. convert_to_long() didn't break it when I checked, though I probably have the length assignment wrong in the one I posted, on reflection. (Too many patches floating around here at present, sorry.)
+    if (length == IS_NULL) {
Did you really mean IS_NULL here?
It builds without complaint and works as expected - what am I missing? - Steph
-- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com


« previous php.internals (#33907) next »