Thanks Nathaniel for the clarification about 5.4. We are still on 5.3 (and
that only recently), so 5.4 is a ways off in our production systems.
However, I'll read up on this since it may be useful in offline tools.
On Fri, May 31, 2013 at 11:52 AM, Nick Whiting wrote:
> TestClass::testMethod(func
This will not work.
As stated in the PHP documentation "Static closures cannot have any bound
object "
A static Closure has no context of "this" just as with any other static
object.
A workaround is to pass in the Closure as a parameter to achieve a similar
result.
class TestClass {
public
I'm talking about PHP 5.4. `bindTo` is a Closure method in PHP 5.4, and
allows you to set the `$this` variable inside of a Closure. However,
apparently you can't use it on Closures created inside static methods.
I knew that you could create another function which would return the
Closure, however,
On Fri, May 31, 2013 at 10:54 AM, Nathaniel Higgins wrote:
> Is it possible to bind an instance to a static closure, or to create a
> non-static closure inside of a static class method?
>
PHP doesn't have a method to do this. In JavaScript you can use jQuery's
var func = $.proxy(function ()
From: Nathan Nobbe
> Interesting, using MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM
> seems practically instantaneous. Still [raises] the question though,
> any idea what's holding up the show w/ MCRYPT_DEV_RANDOM?
/dev/random is a high quality entropy source and requires more time to
generate
Is it possible to bind an instance to a static closure, or to create a
non-static closure inside of a static class method?
This is what I mean...
bindTo($testInstance);
call_user_func($bindedTestClosure);
// should be true
}
}
TestClass::testMethod()
On May 30, 2013, at 7:30 PM, tamouse mailing lists
wrote:
> Sounds like the OP is asking for a pre-built CRUD interface that
> adapts to his tables and their relationships. It's a fair question,
> just one I don't have an answer to. There must be some kind of ORM for
> PHP?
Thanks tamouse -
Hi.
I'm encoding some data with json_encode to use with jquery. All working
fine, postgres query, my jquery, etc. But when I cast json_encode in my
array, the result is an json object ordered by the array index, in my case
the id of my clients.
This is right? Is the intended behavior?
Anyway, I f
Richard Quadling wrote:
> Hi.
>
> Both
>
> class Oddity{
> public $var = 'a' . 'b';
> }
> ?>
>
>From http://www.php.net/manual/en/language.oop5.properties.php:
"This declaration may include an initialization, but this initialization
must be a constant value--that is, it must be able to be
Camilo Sperberg wrote:
> On 30 mei 2013, at 05:05, Paul M Foster wrote:
>
> > On Wed, May 29, 2013 at 08:51:47PM -0400, Tedd Sperling wrote:
> >
> >> On May 29, 2013, at 7:11 PM, Tim Dunphy wrote:
> >>
> >>> Hello list,
> >>>
> >>> I've created an authentication page (index.php) that logs in
Tedd Sperling wrote:
> On May 29, 2013, at 5:53 PM, Ashley Sheridan
> wrote:
> > Sometimes when all you know is regex, everything looks like a nail...
> >
> > Thanks,
> > Ash
> >
>
> There are people who *know* regrex?
Well, not *biblically*, but yeah, I do.
--
PHP General Mailing List
On 31 May 2013, at 12:22, Richard Quadling wrote:
> On 31 May 2013 12:17, shiplu wrote:
>
>> On Fri, May 31, 2013 at 5:12 PM, Stuart Dallas wrote:
>>> That is not entirely correct. It must be a literal value. The expression
>>> 'a'.'b' is a constant value.
>>> I may be being overly picky here
On 31 May 2013, at 12:17, shiplu wrote:
> On Fri, May 31, 2013 at 5:12 PM, Stuart Dallas wrote:
>> That is not entirely correct. It must be a literal value. The expression
>> 'a'.'b' is a constant value.
>> I may be being overly picky here, but I think it's an important distinction.
>>
>
> I
On Fri, May 31, 2013 at 5:12 PM, Stuart Dallas wrote:
> That is not entirely correct. It must be a literal value. The expression
> 'a'.'b' is a constant value.
>
I may be being overly picky here, but I think it's an important distinction.
>
I thought 'a'. 'b' is a constant expression and 'ab' is
On 31 May 2013, at 12:08, shiplu wrote:
> The property initializer in PHP can not have any expression. It should be
> constant value.
That is not entirely correct. It must be a literal value. The expression
'a'.'b' is a constant value.
I may be being overly picky here, but I think it's an imp
Yes, this has been always the case. The property initializer in PHP can not
have any expression. It should be constant value.
If you want to use expression here use the constructor.
class MyClass{
protected $nonStaticField;
static protected $staticField;
public function __construct(){
On 31 May 2013, at 11:57, Richard Quadling wrote:
> Hi.
>
> Both
>
> class Oddity{
> public $var = 'a' . 'b';
> }
> ?>
>
> and
>
> class Oddity{
> const A_VAR = 'a' . 'b';
> }
> ?>
>
> produce ...
>
> PHP Parse error: syntax error, unexpected '.', expecting ',' or ';' in -
> on line 3
>
17 matches
Mail list logo