On Thu, 2004-04-15 at 20:07, Sterling Hughes wrote:
> Also wrong. You never through an E_ERROR for this sort of thing.
Ilia pointed that out, its been corrected -- all zend_error() references
were also changed to php_error_docref() (except in RINIT)
John
--
-=~=--=~=--=~=--=~=--=~=--=~=--=~=-
Hello Jason,
here is your operator patch:
http://marcus-boerger.de/php/ext/ze2/ze2-ifsetor-20040416.diff.txt
currently it uses the following syntax:
$var $: $defaul
which would equal
isset($var) ? $var : $default
Notice that at the moment the operator is '$:' and not '?:'. This is
because i h
On Apr 15, 2004, at 4:12 PM, John Coggeshall wrote:
Attached is a patch which I hope will keep people happy when it comes
to
specifically the Tidy extension. I'd like some feedback on this before
I
commit it / throw it away:
Changes:
- All errors were re-evaluated, and those (such as a bogus
Hello Jevon,
Friday, April 16, 2004, 1:05:11 AM, you wrote:
>> Guys, I'm am not for forcing people to use exceptions. I agree that we
>> should make PHP another Java exceptions from hell (especially with their
>> exception declarations in function prototypes which is horrible). I'm just
>> saying
Hello Eric,
thanks for noticing.
marcus
Thursday, April 15, 2004, 11:30:07 PM, you wrote:
> Hello folks,
> In all functions using spprintf(), the output corresponding to the
> format conversion specifier "%p" depends on the value of the
> *previously* converted argument (if any), not just the p
Attached is a patch which I hope will keep people happy when it comes to
specifically the Tidy extension. I'd like some feedback on this before I
commit it / throw it away:
Changes:
- All errors were re-evaluated, and those (such as a bogus config
option) were demoted to E_NOTICE or promote
Hello,
Let me make an attempt to clarify what I originally requested.
--
A function/construct named setor() modeled after isset(), which takes 2
parameters:
parameter 1, the variable in question
parameter 2, the default value
if(isset($parameter1))
return $parameter1;
else
return $p
> Guys, I'm am not for forcing people to use exceptions. I agree that we
> should make PHP another Java exceptions from hell (especially with their
> exception declarations in function prototypes which is horrible). I'm just
> saying, that some extensions might benefit from exceptions and the
> ext
At 02:21 PM 4/15/2004 -0400, Sean Coates wrote:
Andi Gutmans wrote:
It could be implemented but I don't see the big advantage over $bar ? 0 :
$base
It's one character...
oes to GCC and its C extension).
$bar ? : $baz;
If $bar evaluates to true, the expression evaluates to $bar
or to 0,
Sean Coates wrote:
Jason Garber wrote:
function setor(&$param, $default)
{
return (isset($param) ? $param : $default);
}
I tested it on 4.3.4 and 5.0 RC1, and it worked. Is passing an
undefined variable as a reference parameter a legal thing to do in PHP?
That bring up an interesting point
Jason Garber wrote:
function setor(&$param, $default)
{
return (isset($param) ? $param : $default);
}
I tested it on 4.3.4 and 5.0 RC1, and it worked. Is passing an
undefined variable as a reference parameter a legal thing to do in PHP?
That bring up an interesting point:
error_reporting(E_A
Hello folks,
In all functions using spprintf(), the output corresponding to the
format conversion specifier "%p" depends on the value of the
*previously* converted argument (if any), not just the pointer
corresponding to the specifier.
1) If the previously-converted argument was a non-zero integer
On Apr 15, 2004, at 5:21 PM, Marcus Boerger wrote:
Hello Christian,
Thursday, April 15, 2004, 1:06:20 PM, you wrote:
[EMAIL PROTECTED] wrote:
"modern dynamic" languages in that context, as for instance in Python
there is no error handling but by using exceptions).
Sorry but that's simply wrong.
Hello Justin,
Thursday, April 15, 2004, 5:28:29 PM, you wrote:
>> echo setor($required_variable, die('error...');
>> or
>> echo setor($error, '');
>> or
>> echo setor($sMessage, $sDefaultMessage).
>> or
>> $z = setor($_GET['z'], 'Default');
>> $z = setor($_GET['z'], 'Default');
> Whats wrong wit
Hello Derick,
Thursday, April 15, 2004, 10:07:01 PM, you wrote:
> On Thu, 15 Apr 2004, Jason Garber wrote:
>> I see. I was basing the spec on the functionality of isset() which does
>> not (obviously) throw an E_NOTICE when you pass an undefined variable to
>> it. However, do you see any reaso
Hello Christian,
Thursday, April 15, 2004, 1:06:20 PM, you wrote:
> [EMAIL PROTECTED] wrote:
>> "modern dynamic" languages in that context, as for instance in Python
>> there is no error handling but by using exceptions).
> Sorry but that's simply wrong. Python methods can return false or null
Hello Derick,
Thursday, April 15, 2004, 11:02:14 PM, you wrote:
> On Thu, 15 Apr 2004, Marcus Boerger wrote:
>> I don't. If you don't like the oo interface of SQLite then go with the
>> procedural API. For the way i implemented SQLite's oo API exceptions are the
>> way to go - a gingle exception
On Thu, 15 Apr 2004, Marcus Boerger wrote:
> I don't. If you don't like the oo interface of SQLite then go with the
> procedural API. For the way i implemented SQLite's oo API exceptions are the
> way to go - a gingle exception in the ctor.
There is nothing wrong with that at all, it's just the o
Hello Christian,
Thursday, April 15, 2004, 1:15:03 PM, you wrote:
> Andi Gutmans wrote:
>> I don't think allowing the return of anything except for the object
>> itself is *fixing* PHP.
> No, being able to fail and return would not be fixing it. It would be
> extending it to allow people to av
Hello Derick,
Thursday, April 15, 2004, 9:59:23 AM, you wrote:
> On Thu, 15 Apr 2004, Andi Gutmans wrote:
>> I don't like these ideas. I think it should stay the way it is and not only
>> because we're at RC2.
>> If Thies doesn't want to deal with this, then he can write constructors
>> without
Hello Jani,
Thursday, April 15, 2004, 10:49:17 PM, you wrote:
> On Thu, 15 Apr 2004, Andi Gutmans wrote:
>>Guys, I'm am not for forcing people to use exceptions.
> Marcus is.. :)
I don't. If you don't like the oo interface of SQLite then go with the
procedural API. For the way i implemente
On Thu, 15 Apr 2004, Andi Gutmans wrote:
>Guys, I'm am not for forcing people to use exceptions.
Marcus is.. :)
> I agree that we should make PHP another Java exceptions from hell
> (especially with their exception declarations in function prototypes which
> is horrible). I'm just
I
On Thu, 15 Apr 2004, George Schlossnagle wrote:
>
>On Apr 15, 2004, at 9:49 AM, Jani Taskinen wrote:
>
>> On Thu, 15 Apr 2004, George Schlossnagle wrote:
>>
>>> On Apr 15, 2004, at 8:28 AM, Christian Schneider wrote:
No, I dislike them because they create more problems than they solve.
>>>
>>
+1 for the GCC style syntax.
--Wez.
- Original Message -
From: "Hartmut Holzgraefe" <[EMAIL PROTECTED]>
To: "Sascha Schumann" <[EMAIL PROTECTED]>
Cc: "Ilia Alshanetsky" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 15, 2004 8:47 PM
Subject: Re: [PHP-DEV] Construct Reques
You can avoid the E_NOTICE using a reference, but it can have undesired
side effects. For example, if you pass $x[5] by reference (whether to
an internal function or a user defined function), $x[5] will be
"created" and set to NULL. To avoid this side-effect, don't use the
reference and instead
I wrote this (I underlined the relevant parts for you):
> >You'll need something more clever, because
> >an undefined key 'CUST_ID' in $_POST['CUST_ID'] will strill throw a
Consider this:
---
error_reporting(E_ALL);
function setor(&$param, $default)
{
On Thu, 15 Apr 2004, Jason Garber wrote:
> I see. I was basing the spec on the functionality of isset() which does
> not (obviously) throw an E_NOTICE when you pass an undefined variable to
> it. However, do you see any reason that this would not reliably work?
I wrote this (I underlined the re
Hi Derick,
I see. I was basing the spec on the functionality of isset() which does
not (obviously) throw an E_NOTICE when you pass an undefined variable to
it. However, do you see any reason that this would not reliably work?
function setor(&$param, $default)
{
return (isset($param) ? $pa
On Thu, 15 Apr 2004, Jason Garber wrote:
> $_POST['CUST_ID'] = (int) isset_or_default($_POST['CUST_ID'], 0);
>
> I agree that it would be helpful not to evaluate the second parameter
> unless needed, which is why I originally proposed a language construct.
You'll need something more clever, becau
On Apr 15, 2004, at 3:35 PM, Timm Friebe wrote:
On Thu, 2004-04-15 at 21:36, Chuck Hagenbuch wrote:
Quoting Hartmut Holzgraefe <[EMAIL PROTECTED]>:
[...]
If this were added, wouldn't it make sense to use the convention
already adopted
by perl?
$foo |= 'default';
Already used:
$ php -r '$a= 1; $a
Sascha Schumann wrote:
That is basically the same idea once proposed as extending
the ternary operator (credit goes to GCC and its C extension).
$bar ? : $baz;
yes, that looks like the way it should look like,
and the danger of newbees abusing it would be way lower
than with a function
The best functionality would be for it to return the value, not re-assign
it. Many of the things being talked about would modify the sent parameter,
rather than return selected value.
For instance (using the isset_or_default()) call:
$nCustID = (int) isset_or_default($_POST['CUST_ID'], 0);
Th
On Thu, 2004-04-15 at 21:36, Chuck Hagenbuch wrote:
> Quoting Hartmut Holzgraefe <[EMAIL PROTECTED]>:
[...]
> If this were added, wouldn't it make sense to use the convention
> already adopted
> by perl?
>
> $foo |= 'default';
Already used:
$ php -r '$a= 1; $a |= 2; var_dump($a);'
int(3)
- Tim
Quoting Hartmut Holzgraefe <[EMAIL PROTECTED]>:
actualy in this special case i have been whishing for an operator for ages,
maybe a modification of the good old ternary:
$foo = ?$bar : "default";
or
$foo ?= "default";
If this were added, wouldn't it make sense to use the convention
alread
Hartmut Holzgraefe wrote:
or
$foo ?= "default";
Looks Too Much Like Perl. IMO, if this is to be implemented, a function
should be created, and not a set of operators.
Olivier
--
GB/E/IT d+ s+:+ a-- C++$ UL$ P L+++$ E- W++$ N- ?o ?K w--(---)
!O M+$ V- PS+ PE- Y PGP t++ 5-- X+@ R- tv+
Justin Hannus wrote:
Whats wrong with defining a user-level function?
actualy in this special case i have been whishing for an operator for ages,
maybe a modification of the good old ternary:
$foo = ?$bar : "default";
or
$foo ?= "default";
;)
--
Hartmut Holzgraefe <[EMAIL PROTECTED]>
--
PH
PHP Development Team is proud to announce the release of PHP 4.3.6. This is
is a bug fix release whose primary goal is to address two bugs which may
result in crashes in PHP builds with thread-safety enabled. All users of PHP
in a threaded environment (Windows) are strongly encouraged to upgrade
On April 15, 2004 02:15 pm, Andi Gutmans wrote:
> It could be implemented but I don't see the big advantage over $bar ? 0 :
> $base It's one character...
Well, currently to check the value and assign the default you need to do the
following:
$_GET['foo'] = isset($_GET['foo']) ? (int) $_GET['foo'
Adam Maccabee Trachtenberg wrote:
On Thu, 15 Apr 2004, Andi Gutmans wrote:
I held RC2 because I thought this was a critical engine bug. It happened
because instead of not implementing NULL you implemented it without a body.
Right now I changed it to NULL which means that any clone either via
"clo
Andi Gutmans wrote:
It could be implemented but I don't see the big advantage over $bar ? 0
: $base
It's one character...
oes to GCC and its C extension).
$bar ? : $baz;
If $bar evaluates to true, the expression evaluates to $bar
or to 0, respectively.
I think we're unclear on this.
On Thu, 15 Apr 2004, Andi Gutmans wrote:
> Personally, I think we can roll RC2 with the way the tree is now. The fact
> that MySQLi isn't cloneable isn't a big deal because:
> a) It's a new PHP 5 feature which is most likely not run in
> zend.zend1_compatibility_mode
> b) If explicit "clone" isn't
It could be implemented but I don't see the big advantage over $bar ? 0 : $base
It's one character...
At 02:09 PM 4/15/2004 -0400, Sean Coates wrote:
Is there a good reason to NOT implement this?
If not, I'm +1 on that (if I carry ANY weight at all (-: )
BC isn't an issue, and it would be a very us
At 02:09 PM 4/15/2004 -0400, Adam Maccabee Trachtenberg wrote:
On Thu, 15 Apr 2004, Andi Gutmans wrote:
> I held RC2 because I thought this was a critical engine bug. It happened
> because instead of not implementing NULL you implemented it without a body.
> Right now I changed it to NULL which me
+1
-Original Message-
From: Sean Coates [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 12:10 PM
To: Sascha Schumann
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] Construct Request
Is there a good reason to NOT implement this?
If not, I'm +1 on that (if I carry ANY weight at all
Is there a good reason to NOT implement this?
If not, I'm +1 on that (if I carry ANY weight at all (-: )
BC isn't an issue, and it would be a very useful feature, IMHO..
S
Sascha Schumann wrote:
That is basically the same idea once proposed as extending
the ternary operator (credit goes t
On Thu, 15 Apr 2004, Andi Gutmans wrote:
> I held RC2 because I thought this was a critical engine bug. It happened
> because instead of not implementing NULL you implemented it without a body.
> Right now I changed it to NULL which means that any clone either via
> "clone" or compatibility_mode w
Actually, although suppressing the E_NOTICE, this is not exactly the
behavior you want.
What if $_GET['Does']['Not']['Exist'] really doesn't exists? It is then
created and assigned to $param when passed as an argument to the param
function. Therefore polluting $_GET with another unused array and a
At 01:15 PM 4/15/2004 +0200, Christian Schneider wrote:
Andi Gutmans wrote:
I don't think allowing the return of anything except for the object
itself is *fixing* PHP.
No, being able to fail and return would not be fixing it. It would be
extending it to allow people to avoid exceptions for this s
The thing I like about the suggestion over implementing
the function in script is the ability to skip the call to
a function that provides the default. In the following
example, slowFunc() simulates a slow function using a sleep,
but you can imagine any function call with a performance
hit. The s
Georg,
I held RC2 because I thought this was a critical engine bug. It happened
because instead of not implementing NULL you implemented it without a body.
Right now I changed it to NULL which means that any clone either via
"clone" or compatibility_mode will result in an error message that MyS
On 15 Apr 2004 at 11:47, Jason Garber wrote:
> a. the actual variable in question could not be passed
This is wrong, too. Look at this example:
Output:
array(2) {
["Exists"]=>
string(1) "0"
["Does"]=>
array(1) {
["Not"]=>
array(1) {
Brad Fisher wrote:
Lukas Smith wrote:
Our original idea was to handle this with an if statement like so:
if (version_compare(phpversion(), "5.0.0") == -1) {
// assign factoried method to this for PHP 4
// $this =& ::factory();
// $this =& ::singleton();
eval('$this =& ::singleton();');
S
Lukas Smith wrote:
> > Our original idea was to handle this with an if statement like so:
> > if (version_compare(phpversion(), "5.0.0") == -1) {
> > // assign factoried method to this for PHP 4
> > // $this =& ::factory();
// $this =& ::singleton();
eval('$this =& ::singleton();');
> >
That is basically the same idea once proposed as extending
the ternary operator (credit goes to GCC and its C extension).
$bar ? : $baz;
If $bar evaluates to true, the expression evaluates to $bar
or to 0, respectively.
- Sascha
--
PHP Internals - PHP Runtime Developmen
I am not sure what would be the best name for such an engine construct or a
function, but the idea itself is good (IMHO). It would certainly make it
easier to write safer notice free code.
Ilia
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/un
On Thu, 15 Apr 2004, Jason Garber wrote:
> a. the actual variable in question could not be passed
> b. it incurs the overhead of calling a user-level function
Which takes about as much time as calling an internal function, so that
argument is bogus.
Derick
--
PHP Internals - PHP Runtime Develo
Hello,
Thank you for your efforts for making PHP code error free and clean.
Your idea to use common setor(arg1, arg2) function will completely
resolve the problem of variable existing evaluating and further
defaulting. By call of setor function developers will not take care
about warnin
At 4/15/2004 11:28 AM -0400, Justin Hannus wrote:
> echo setor($required_variable, die('error...');
> or
> echo setor($error, '');
> or
> echo setor($sMessage, $sDefaultMessage).
> or
> $z = setor($_GET['z'], 'Default');
> $z = setor($_GET['z'], 'Default');
Whats wrong with defining a user-level fu
> echo setor($required_variable, die('error...');
> or
> echo setor($error, '');
> or
> echo setor($sMessage, $sDefaultMessage).
> or
> $z = setor($_GET['z'], 'Default');
> $z = setor($_GET['z'], 'Default');
Whats wrong with defining a user-level function?
function setor_array(&$array, $key, $def
Hello Internals team,
Thank you for taking a moment to evaluate a serious request by a serious
php developer that is responsible for a development company of 15 employees.
In order to keep our code as clean and error free as possible, we opt to
develop in the E_ALL error mode, and register_globals
On Apr 15, 2004, at 9:49 AM, Jani Taskinen wrote:
On Thu, 15 Apr 2004, George Schlossnagle wrote:
On Apr 15, 2004, at 8:28 AM, Christian Schneider wrote:
No, I dislike them because they create more problems than they solve.
Then don't use them. You're a bit late to the party to debate their
On Thu, 15 Apr 2004, George Schlossnagle wrote:
>On Apr 15, 2004, at 8:28 AM, Christian Schneider wrote:
>> No, I dislike them because they create more problems than they solve.
>
>Then don't use them. You're a bit late to the party to debate their
But if some extension (e.g. sqlite) forces
I noticed this problem the other day; it's related to the VM
query implementation in libsqlite.
--Wez.
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 15, 2004 2:15 PM
Subject: [PHP-DEV] BugReport reproductible: sqlite and multiple queries
(PH
Hi,
sorry but bugs.php.net seems unreachable.
Here is the reproductible problem I got, related to multiple queries in a
single sqlite_query call :
I'm using PHP5.0.0RC1 but the bug is still present in PHP5.0.0RC2RC1 from
http://snaps.php.net/~andi/.
Note this functionnali
George Schlossnagle wrote:
Then don't use them. You're a bit late to the party to debate their
existence in the language.
I was late pointing out that copy-on-assignment is a mistake in PHP4, I
was late pointing out that there is no migration path for __clone(), I
was late with PPP and exceptio
On Apr 15, 2004, at 8:28 AM, Christian Schneider wrote:
No, I dislike them because they create more problems than they solve.
Then don't use them. You're a bit late to the party to debate their
existence in the language.
George
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscr
Lukas Smith wrote:
Our original idea was to handle this with an if statement like so:
if (version_compare(phpversion(), "5.0.0") == -1) {
// assign factoried method to this for PHP 4
// $this =& ::factory();
$this =& ::singleton();
} else {
// error handling for PHP5
// user ha
[EMAIL PROTECTED] wrote:
Actually those are a 'modern/dynamic' aspect of Java (being pseudo-closures).
And a very bad one indeed. Not everything modern is good.
dicuss on objective, rational arguments than on pure personal preference.
I gave more than enough rational arguments. If you don't accept
Just to add some more thoughts to the ongoing discussion from a slightly
different POV.
The PEAR devs are trying to slowly prepare their packages for PHP5 and
so we also needed to address assignedments to $this in constructors in
the few packages that do so.
http://pear.php.net/bugs/bug.php?id
Hello,
I've followed the war, sorry, discussion about exceptions.
Now, let me introduce some problems I've found in Tidy.
Look at the code:
'bogusvalue'));
//because of throwing the exception, this function is never executed
//thus making it complitely unusefull.
echo tidy_config_count($tidy);
> [EMAIL PROTECTED] wrote:
>> First of all, PHP's object model is most similar to the Java one, so
>> Markus' comparisons make most sense in my eyes.
>
> The object model might be similar to Java (it's a very simple one which
> I like) but the language is not and *should not be* IMHO. Java got much
Derick Rethans wrote:
> On Thu, 15 Apr 2004, Per Jessen wrote:
>
>> I'm *certain* it is caused by a mistake in *my* code, but I feel it isn't
>> exactly appropriate for php to segfault because of a user error?
>
> Right, it's not supposed to do so. Please make a backtrace of the
> segfault (with
Andi Gutmans wrote:
I don't think allowing the return of anything except for the object
itself is *fixing* PHP.
No, being able to fail and return would not be fixing it. It would be
extending it to allow people to avoid exceptions for this simple case.
For example, in the SOAP extension it is ve
On Thu, 15 Apr 2004, Per Jessen wrote:
> I'm *certain* it is caused by a mistake in *my* code, but I feel it isn't
> exactly appropriate for php to segfault because of a user error?
Right, it's not supposed to do so. Please make a backtrace of the
segfault (with gdb), or try with valgrind to see
[EMAIL PROTECTED] wrote:
First of all, PHP's object model is most similar to the Java one, so
Markus' comparisons make most sense in my eyes.
The object model might be similar to Java (it's a very simple one which
I like) but the language is not and *should not be* IMHO. Java got much
too bloated
On Thu, 15 Apr 2004 12:44:20 +0200
Per Jessen <[EMAIL PROTECTED]> wrote:
> Per Jessen wrote:
>
> >
> > $editmain=strcasecmp($_REQUEST['contact'],"main")==0;
> > //$editbilling=strcasecmp($_REQUEST['contact'],"billing")==0;
> > //$edittechnical=strcasecmp($_REQUEST['contac
Per Jessen wrote:
>
> $editmain=strcasecmp($_REQUEST['contact'],"main")==0;
> //$editbilling=strcasecmp($_REQUEST['contact'],"billing")==0;
> //$edittechnical=strcasecmp($_REQUEST['contact'],"technical")==0;
>
OK,
I've now guarded the above with :
if ( isset($_REQUEST[
Hi,
I've got a situation where a seemingly innocent statement produces a
segfault. I've tried reducing it to a single reproducable testcase, but
without success. The problem is however solidly reproducable in the
context in which it occurs.
I'm *certain* it is caused by a mistake in *my* code, b
On Thu, 15 Apr 2004, Andi Gutmans wrote:
> I don't like these ideas. I think it should stay the way it is and not only
> because we're at RC2.
> If Thies doesn't want to deal with this, then he can write constructors
> without logic. It's not that hard for the one in many classes where this
> migh
79 matches
Mail list logo