Re: [PHP-DEV] How to abort MINIT?

2008-05-21 Thread Stanislav Malyshev

Hi!


I provide an INI property to stop my extension from loading fully like:

if (strcmp(sapi_module.name, "cli") == 0 &&
INI_STR("plexcel.sapi.cli") &&
INI_BOOL("plexcel.sapi.cli") == 0) {
return;
}

But the extension is still loaded. It's just not initialized.


if you return FAILURE, it will not be loaded, but it will produce 
E_CORE_ERROR. If you don't like that I'd recommend to keep extension 
loaded but not register any functions, etc and write some descriptive 
stuff in phpinfo().

--
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



Re: [PHP-DEV] Short syntax for array literals [...]

2008-05-21 Thread Stanislav Malyshev

Hi!


$a = [[1, 2], [3, 4], 5, 6];


Proposed twice at least, but PHP developer community doesn't seem to 
like it.


--
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



Re: [PHP-DEV] Short syntax for array literals [...]

2008-05-21 Thread Felipe Pena
Hello

Em Qui, 2008-05-22 às 05:12 +0300, Stan Vassilev | FM escreveu:
> Was this discussed before on the list?

Yes. 

http://marc.info/?l=php-internals&m=119995972028293&w=2

> 
> Regards, 
> Stan Vassilev 
-- 
Regards,
Felipe Pena.


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



[PHP-DEV] Short syntax for array literals [...]

2008-05-21 Thread Stan Vassilev | FM

Hi,

I hear this often by other developers and I tend to agree with them, that 
arrays are used often, and often nested, so that having a long syntax for array 
literals tend to produce less legible code than in other scriping languages.

$a = array(array(1,2), array(3,4), 5, 6);

$b = array('a' => 1, 'b' =>2);

We use arrays in our configurations, in passing complex parameters to 
functions, fetching information from databases, basically everything. So it 
adds up.

Some frameworks have somewhat funny attempts to remedy this by introducing 
"shortcuts" like this:   function a() { return func_get-args(); }. Of course 
this doesn't work when you need to specify the key name, and the overhead isn't 
worth it.

It looks as there may not be a specific reason not to allow the JS syntax as an 
alternative syntax (while keeping the current one in parallel):

$a = [[1, 2], [3, 4], 5, 6];

$b = ['a' => 1, 'b' =>2];

There shouldn't be confusion to the parser as the brackets aren't preceded by 
an identifier.

Was this discussed before on the list?

Regards, 
Stan Vassilev 

[PHP-DEV] How to abort MINIT?

2008-05-21 Thread Michael B Allen
I provide an INI property to stop my extension from loading fully like:

if (strcmp(sapi_module.name, "cli") == 0 &&
INI_STR("plexcel.sapi.cli") &&
INI_BOOL("plexcel.sapi.cli") == 0) {
return;
}

But the extension is still loaded. It's just not initialized.

Is there any way to abort within PHP_MINIT_FUNCTION or call a function
to remove the extension from the runtime such that calling
extension_loaded('plexcel') returns FALSE?

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/

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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Andrei Zmievski

Nothing premature about it. It was time.

UG(unicode) checks are still secondary I think - they don't prevent us 
from doing tests and moving forward, although cleaning them up would be 
nice.


pack() should take binary strings only, methinks.

-Andrei

Steph Fox wrote:
I would've hoped that PHP 6 would be Unicode throughout. Maybe jumping 
around when Andrei removed the physical switch was premature... 
obviously the UG(unicode) checks are still in place, whereas their 
binary alternatives shouldn't still exist. Then again some things are 
unclear. What should happen with pack(), for example?


- Steph



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



Re: [PHP-DEV] RFC: allow_call_pass_by_reference

2008-05-21 Thread LEW21
Sometimes call time pass by reference is useful, for example when you
want to make it possible to omit an param (normally passed by
reference) by setting null. With no call time pass by reference,
programmers are required to write:

$null = null;
foo($null);

Deleting it isn't a good idea, it should become a normal (not
deprecated) language feature.

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



Re: [PHP-DEV] Class Properties in Interfaces?

2008-05-21 Thread Stanislav Malyshev

Hi!


Maybe the solution is simply to throw an E_STRICT when unset()-ting an
interface property? My understanding is E_STRICT is to push the


I'd have no problem with that provided it doesn't cost performance (i.e. 
no additional hash lookups, etc.) and doesn't break any of __unset, etc. 
semantics.

--
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



Re: [PHP-DEV] RFC: allow_call_pass_by_reference

2008-05-21 Thread Hector Santos

Steph Fox wrote:
I looked into it again (and found things I didn't know before). This 
one's bugging me enough that I braved the Wiki:


http://wiki.php.net/rfc/calltimebyref



It has:

| Proposal
|
| Switch allow_call_time_pass_reference off by default in PHP_5_3
| branch. At present there is no warning when running PHP under default
| settings, whereas in PHP 6 there will be a 'deprecated' warning given
| and no means of turning it off.

We will be switching it on for our extension requirements. It would be 
nice if it can be turned on in the [extension] section and the PHP 
parser would enabled it per the extension's API call only and not others.


--
Hector Santos


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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Antony Dovgal

On 21.05.2008 17:58, Steph Fox wrote:

Yes, I mean that problem with storing string/Unicode function names.
That patch seems to be no good, run-tests.php doesn't work after I apply 
it (some functions are not found).


 it'll be a lot easier to see what's going on if/when the 
UG(unicode) if'n'butting goes. There's obviously a conversion too many 
somewhere down the line @ present.


Right.
That's exactly what I meant.

--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Steph Fox

Yes, I mean that problem with storing string/Unicode function names.
That patch seems to be no good, run-tests.php doesn't work after I apply 
it (some functions are not found).


 it'll be a lot easier to see what's going on if/when the 
UG(unicode) if'n'butting goes. There's obviously a conversion too many 
somewhere down the line @ present.


- Steph 



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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Antony Dovgal

On 21.05.2008 17:50, Steph Fox wrote:

Not fix the streams issue?


Felipe has taken care of that issue, so now we have only one uber-major 
issue left.


Your patch? Or the changed error message?


Yes, I mean that problem with storing string/Unicode function names.
That patch seems to be no good, run-tests.php doesn't work after I apply it 
(some functions are not found).


--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Steph Fox

Not fix the streams issue?


Felipe has taken care of that issue, so now we have only one uber-major 
issue left.


Your patch? Or the changed error message?

FWIW the --EXPECT-- sections on those tests are different in 5_3 and would 
pass, so maybe they should just match those?


- Steph


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



Re: [PHP-DEV] RFC: allow_call_pass_by_reference

2008-05-21 Thread Steph Fox

For anyone else who doesn't read to the end...


Anyway, my opinion is clear on that one: shoot that dead cow. It's
been deprecated for years, and you should declare your function
prototypes with the param by ref anyway if you need it.


All I'm asking is that we throw a warning by default in 5_3, because in PHP 
6 there isn't even an option to switch that warning off. To be frank this 
shouldn't ever have needed to go to an RFC; the lack of warning is an 
obvious bug in PHP which should simply be fixed.


- Steph 



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



Re: [PHP-DEV] RFC: allow_call_pass_by_reference

2008-05-21 Thread Steph Fox

Is it me, or the wiki post talks about param and return by ref?

Return by ref is not related to call-time pass by ref, is it?


See zend_compile.c.


Anyway, my opinion is clear on that one: shoot that dead cow. It's
been deprecated for years, and you should declare your function
prototypes with the param by ref anyway if you need it.


Did you bother to read the proposal or did you just hit send? What exactly 
do you think the RFC is about?


- Steph


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



Re: [PHP-DEV] RFC: allow_call_pass_by_reference

2008-05-21 Thread Olivier Hill
Hello Steph,

Is it me, or the wiki post talks about param and return by ref?

Return by ref is not related to call-time pass by ref, is it?

Anyway, my opinion is clear on that one: shoot that dead cow. It's
been deprecated for years, and you should declare your function
prototypes with the param by ref anyway if you need it.

Regards,
Olivier

On Wed, May 21, 2008 at 9:13 AM, Steph Fox <[EMAIL PROTECTED]> wrote:
> I looked into it again (and found things I didn't know before). This one's
> bugging me enough that I braved the Wiki:

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



[PHP-DEV] RFC: allow_call_pass_by_reference

2008-05-21 Thread Steph Fox
I looked into it again (and found things I didn't know before). This one's 
bugging me enough that I braved the Wiki:


http://wiki.php.net/rfc/calltimebyref

- Steph 



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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Antony Dovgal

On 21.05.2008 15:12, Steph Fox wrote:

Hey Tony,

First off, thanks for caring :)


And to do that we need to drop the Unicode Switch =)


Not fix the streams issue?


Felipe has taken care of that issue, so now we have only one uber-major issue 
left.

--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Antony Dovgal

On 21.05.2008 15:12, Steph Fox wrote:

Hey Tony,

First off, thanks for caring :)


And to do that we need to drop the Unicode Switch =)


Not fix the streams issue?


That, too =)

--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Steph Fox

Hey Tony,

First off, thanks for caring :)


And to do that we need to drop the Unicode Switch =)


Not fix the streams issue?


I committed a fix for this one a minute ago.


Thanks!

The patch is as easy as this: 
http://dev.daylessday.org/diff/fix_unicode_function_names.diff


This is the biggest problem, isn't it - that things like this obviously 
hadn't been tested until now. I fixed the same issue in Phar last week - it 
probably will need un-fixing there once your patch goes in :\


I didn't commit this one yet as I didn't investigate how it would affect 
non-Unicode mode (and whether I should worry about non-Unicode mode at 
all).


I would've hoped that PHP 6 would be Unicode throughout. Maybe jumping 
around when Andrei removed the physical switch was premature... obviously 
the UG(unicode) checks are still in place, whereas their binary alternatives 
shouldn't still exist. Then again some things are unclear. What should 
happen with pack(), for example?


- Steph 



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



Re: [PHP-DEV] Unicode progress [Was: unicode.semantics ad infinitum]

2008-05-21 Thread Antony Dovgal

On 21.05.2008 00:21, Steph Fox wrote:
I think the test script and ZE problems should be resolved first... 


And to do that we need to drop the Unicode Switch =)

plus I just discovered that my php.ini isn't being found when I run commandline 
tests (e.g. php -r "var_dump(strcasecmp());" doesn't throw an error unless I 
explicitly set error_reporting from the commandline, despite having 
E_ALL|E_STRICT in the INI). These are basic things, nobody can really go 
much further until they're fixed.


Your php.ini is being found & read allright, the problem is that the INI scanner looks 
for _string_ constants, while all constants are registered as _unicode_ constants in Unicode mode.

So it fails to find E_ALL constant and ends up with atoi("E_ALL"), which is 0.

I committed a fix for this one a minute ago.

The broken function names in error messages are easy to fix too, as soon as we 
drop the Switch - functions in Unicode mode are registered using their Unicode names, 
but then a weird thing happens:
zend_register_standard_ini_entries() makes Unicode copies of function/class/constant tables 
(ignoring the fact that they are already Unicode ones), this is why you see only the first 
character in function names.


The patch is as easy as this: 
http://dev.daylessday.org/diff/fix_unicode_function_names.diff
I didn't commit this one yet as I didn't investigate how it would affect non-Unicode mode 
(and whether I should worry about non-Unicode mode at all).


--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] magic quotes finale

2008-05-21 Thread Richard Quadling
2008/5/20 Jonathan Bond-Caron <[EMAIL PROTECTED]>:
> +1 here
>
> A summary:
>
> PHP6 MUST not allow setting magic quotes
> PHP6 MUST trigger a fatal error when attempting to set magic quotes (php.ini
> or set_magic_quotes_runtime())
> PHP6 MUST allow getting magic quotes info (always false)
>
> PHP5.3 MUST allow setting magic quotes
> PHP5.3 MUST trigger an E_DEPRECATED warning when setting magic quotes
> (php.ini or set_magic_quotes_runtime())
> PHP5.3 MUST allow getting magic quotes info


A small heads-up, with the latest snapshot for windows, 5.3.0-dev
gives a E_DEPRECATED error for get_magic_quotes_runtime().

Richard.



-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

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



Re: [PHP-DEV] Add deg2grad() and grad2deg() in PHP5.3

2008-05-21 Thread Antony Dovgal

On 20.05.2008 22:22, Kalle Sommer Nielsen wrote:

Greetings internals

I've made two functions that allows convertion between degress and gradians, 
below is a pastebin

of the functions as that would look in math.c:
http://www.phpfi.com/318450


Functions that can be implemented in one line of PHP code are usually not 
welcome.

--
Wbr, 
Antony Dovgal


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