On 21/04/11 08:56, Arpad Ray wrote:
> On Thu, Apr 14, 2011 at 3:05 PM, Hannes Landeholm wrote:
>> Some suggested that the ternary if comparison should suppress the notice
>> automatically. This would break existing code and also be confusing since
>> people expect a ternary if and normal if to wor
On Thu, Apr 21, 2011 at 12:56 AM, Arpad Ray wrote:
> I've pined for something like coalesce($_GET['foo'], $defaults['foo'],
> 42) for years, and I think that style is far more in keeping with the
> PHP ethos, and far more readily understandable than this suggested new
> syntax.
>
To elaborate, I'
On Thu, Apr 14, 2011 at 3:05 PM, Hannes Landeholm wrote:
> Some suggested that the ternary if comparison should suppress the notice
> automatically. This would break existing code and also be confusing since
> people expect a ternary if and normal if to work the same way.
>
> Some suggested ?? as
On Wed, Apr 20, 2011 at 11:50 PM, Mark wrote:
> On Wednesday, April 20, 2011, D. Dante Lorenso wrote:
>> On 4/20/11 9:55 AM, Mark wrote:
>>
>> Hi,
>> This proposal is for the often called line like this:
>> $var = isset($_GET['var']) ? $_GET['var'] : '';
>> Only a shorter and imho a cleaner solut
On Wednesday, April 20, 2011, D. Dante Lorenso wrote:
> On 4/20/11 9:55 AM, Mark wrote:
>
> Hi,
> This proposal is for the often called line like this:
> $var = isset($_GET['var']) ? $_GET['var'] : '';
> Only a shorter and imho a cleaner solution to get the same:
> $var = varset($_GET['var']);
>
>
On 4/20/11 9:55 AM, Mark wrote:
Hi,
This proposal is for the often called line like this:
$var = isset($_GET['var']) ? $_GET['var'] : '';
Only a shorter and imho a cleaner solution to get the same:
$var = varset($_GET['var']);
The implementation for this in PHP code is this:
# Arg 1 = the varia
On Wed, Apr 20, 2011 at 6:00 PM, Jonathan Bond-Caron wrote:
> On Wed Apr 20 10:55 AM, Mark wrote:
> >
> > function varset($arr, $key, $default = '') { return (isset($arr[$key])
> > ? $arr[$key] : $default); }
> >
> > where the call would be:
> > $var = varset($_GET, 'var');
> >
> > I personally li
On Wed, Apr 20, 2011 at 7:14 PM, Hannes Landeholm wrote:
> This discussion is equivalent to the one that we just had. Read the thread
> "[PHP-DEV] Implicit isset/isempty check on short-ternary operator".
>
>
except that it wouldn't bring new syntax.
ps: please don't top post if everybody else doe
This discussion is equivalent to the one that we just had. Read the thread
"[PHP-DEV] Implicit isset/isempty check on short-ternary operator".
Also the "$var = var_set($_GET['var'], $_POST['var'], 'default');" syntax
you propose would be equivalent to (as per previous discussion):
$var = $_GET[?'
http://pecl.php.net/package/mysqlnd_ms/download/1.0.0/
This is a really great idea to use replication-salves for
read-access without touch the php-application and if this
will work with "php_flag" site-specific using the available
slaves automatically / leave them out if they are stopped
this can
On Wed, Apr 20, 2011 at 11:06:47AM -0500, Brian Moon wrote:
> >It might be nice to extend it such that if the 1st argument is a list then
> >the
> >first in the list which is set is returned, eg:
> >
> > $var = var_set(($_GET['var'], $_POST['var']), 'default');
>
> If that is the usage, I wou
It might be nice to extend it such that if the 1st argument is a list then the
first in the list which is set is returned, eg:
$var = var_set(($_GET['var'], $_POST['var']), 'default');
If that is the usage, I would suggest coalesce() to be consistent with
the same concept in SQL. And y
On Wed Apr 20 10:55 AM, Mark wrote:
>
> function varset($arr, $key, $default = '') { return (isset($arr[$key])
> ? $arr[$key] : $default); }
>
> where the call would be:
> $var = varset($_GET, 'var');
>
> I personally like both ways...
> My proposal is to make this function a core php function
On Wed, Apr 20, 2011 at 05:19:36PM +0200, Mark wrote:
> > If is is a language element (like isset()) then you can avoid this problem.
> >
>
> Could you explain that a bit more?
It looks like a function but is not:
http://uk3.php.net/manual/en/function.isset.php
> > It might be nice to
On Wed, Apr 20, 2011 at 5:12 PM, Alain Williams wrote:
> On Wed, Apr 20, 2011 at 04:55:00PM +0200, Mark wrote:
> > Hi,
> >
> > This proposal is for the often called line like this:
> > $var = isset($_GET['var']) ? $_GET['var'] : '';
> >
> > Only a shorter and imho a cleaner solution to get the sa
On Wed, Apr 20, 2011 at 04:55:00PM +0200, Mark wrote:
> Hi,
>
> This proposal is for the often called line like this:
> $var = isset($_GET['var']) ? $_GET['var'] : '';
>
> Only a shorter and imho a cleaner solution to get the same:
> $var = varset($_GET['var']);
It should be called var_set() - b
Hi,
This proposal is for the often called line like this:
$var = isset($_GET['var']) ? $_GET['var'] : '';
Only a shorter and imho a cleaner solution to get the same:
$var = varset($_GET['var']);
The implementation for this in PHP code is this:
# Arg 1 = the variable to check for existence
# Arg
2011/4/20 Johannes Schlüter :
>
>
> On 04/20/11 04:18 PM, Dave Ingram wrote:
>>
>> On 04/19/11 15:44, Michael Morris wrote:
>>>
>>> watch ($var) -> $var is sent to the console on the line this statement
>>> is
>>> made with the statment "now watching 'var'.. init value "x", and then
>>> each
>>> t
On 20 April 2011 15:18, Dave Ingram wrote:
> On 04/19/11 15:44, Michael Morris wrote:
>> watch ($var) -> $var is sent to the console on the line this statement is
>> made with the statment "now watching 'var'.. init value "x", and then each
>> time it changes it is updated in the console.
> Just m
On 04/20/11 04:18 PM, Dave Ingram wrote:
On 04/19/11 15:44, Michael Morris wrote:
watch ($var) -> $var is sent to the console on the line this statement is
made with the statment "now watching 'var'.. init value "x", and then each
time it changes it is updated in the console.
Just my 0.02 as
On 04/19/11 15:44, Michael Morris wrote:
> watch ($var) -> $var is sent to the console on the line this statement is
> made with the statment "now watching 'var'.. init value "x", and then each
> time it changes it is updated in the console.
Just my 0.02 as a user, but it strikes me that watch() co
On 17/04/11 9:14 AM, Ángel González wrote:
Ben Schmidt wrote:
$var = $arr['key'] ?? : 'empty';
Also note this is possible with the recent proposal Hannes and I were
discussing. It simply looks like
$var = $arr?['key'] ?: 'empty';
The ?[ avoids notices and the ?: works as it always has.
Ben.
On Wed, Apr 20, 2011 at 5:35 PM, Ferenc Kovacs wrote:
> please report it as a bug on http://bugs.php.net, its easier to keep track
> of the problem if its in there.
>
http://bugs.php.net/bug.php?id=54575
--
Regards,
Konstantin
On Wed, Apr 20, 2011 at 3:29 PM, Konstantin Leboev <
konstantin.leb...@gmail.com> wrote:
> Hi all,
>
> In some cases SoapServer::handle does not call php_end_ob_buffer and I can
> not call it from php. For example:
>
> class A {
> }
>
> $s = new SoapServer("wsdl.wsdl");
> $s->setClass("A");
>
> ob
Hi all,
In some cases SoapServer::handle does not call php_end_ob_buffer and I can
not call it from php. For example:
class A {
}
$s = new SoapServer("wsdl.wsdl");
$s->setClass("A");
ob_start();
var_dump(ob_get_level()); // int(1)
$s->handle();
var_dump(ob_get_level()); // int(2)
echo ob_get_cl
On 2011-04-20, Michael Morris wrote:
> --e0cb4e43cce199248e04a15872c6
> Content-Type: text/plain; charset=ISO-8859-1
>
> Those userland solutions (I've written a few myself) send the output
> as part of the html file that is being composed, or they write it to a
> file which you then later open up
On 20.04.2011 14:24, Johannes Schlüter wrote:
>
>
> On 04/20/11 02:05 PM, Michael Morris wrote:
>> This takes advantage of the fact that this CLI client, which
>> will*not* be
>> running as a daemon, will have an open terminal window for it for as
>> long as
>> it persists until the process is s
On 04/20/11 02:05 PM, Michael Morris wrote:
This takes advantage of the fact that this CLI client, which will*not* be
running as a daemon, will have an open terminal window for it for as long as
it persists until the process is stopped with CTRL-C. Sending output to
that terminal window would
Those userland solutions (I've written a few myself) send the output as part
of the html file that is being composed, or they write it to a file which
you then later open up. Which is fine.
This takes advantage of the fact that this CLI client, which will *not* be
running as a daemon, will have a
29 matches
Mail list logo