On 1/04/11 3:29 AM, David Coallier wrote:
Hey there,
I've been working on a little patch that will allow variables ($1) in
a short-ternary operation to go through an implicit isset
(zend_do_isset_or_isempty) check so that the average use-case for the
short-ternary operator doesn't yield in a not
On a somewhat related note (and going back a little to my original patch),
languages like python and ruby allow slicing on array/string objects with
$string_or_array[start:end] syntax. I think this would be really useful
syntax in PHP as well (and would of course make the initial patch I
submitted
On 03/31/2011 10:58 AM, Martin Scotta wrote:
> I think it's time to stop thinking in terms of "functions" and move
> forward to "abstractions"
>
> $s1 = 'string';
> $s1->contains($s2);
>
> $s1->indexOf($s2) === strpos($s1, $s2);
>
> Why can't the strings be exposed as pseudo-objects ? users can
I think it's time to stop thinking in terms of "functions" and move forward
to "abstractions"
$s1 = 'string';
$s1->contains($s2);
$s1->indexOf($s2) === strpos($s1, $s2);
Why can't the strings be exposed as pseudo-objects ? users can choose to use
them as a regular strings or by calling methods o
On Mar 31, 2011, at 9:55 AM, Sebastian Bergmann wrote:
> Am 31.03.2011 17:52, schrieb Rasmus Lerdorf:
>> Argh! Everyone should be forced to learn a bit of C. Like many PHP
>> functions, the name and argument order is right out of libc. If you type
>> "man strstr" at your (non-Windows) prompt you
Hey there,
I've been working on a little patch that will allow variables ($1) in
a short-ternary operation to go through an implicit isset
(zend_do_isset_or_isempty) check so that the average use-case for the
short-ternary operator doesn't yield in a notice whenever the first
variable of the expre
On 31 March 2011 16:43, Brian Moon wrote:
>>> How would str_contains() be different from strstr()?
>>>
>>>
>> They differ in the return type
>
> $instr = (bool)strstr($string1, $string2);
>
> done. No need for a new function.
God forbid anyone use (bool)strstr("something0", "0") !
>
> Brian.
>
>
Am 31.03.2011 17:52, schrieb Rasmus Lerdorf:
> Argh! Everyone should be forced to learn a bit of C. Like many PHP
> functions, the name and argument order is right out of libc. If you type
> "man strstr" at your (non-Windows) prompt you get a nice little
> description of what it does.
And if you
On 03/31/2011 08:45 AM, Philip Olson wrote:
> - Intuitive name
Argh! Everyone should be forced to learn a bit of C. Like many PHP
functions, the name and argument order is right out of libc. If you type
"man strstr" at your (non-Windows) prompt you get a nice little
description of what it does.
On Mar 31, 2011, at 9:43 AM, Brian Moon wrote:
>>> How would str_contains() be different from strstr()?
>>>
>>>
>> They differ in the return type
>
> $instr = (bool)strstr($string1, $string2);
>
> done. No need for a new function.
Well, to be clearer:
bool str_contains( haystack, needle [,
On 31.03.11 17:05, Rasmus Lerdorf wrote:
> On 03/31/2011 07:41 AM, Philip Olson wrote:
>> On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote:
>>> I recently got around to merge them into a largely unfinished extension
>>> so they are archived somewhere safe: https://github.com/mj/php-ext-str
>>
>> I
How would str_contains() be different from strstr()?
They differ in the return type
$instr = (bool)strstr($string1, $string2);
done. No need for a new function.
Brian.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Martin Scotta
On Thu, Mar 31, 2011 at 12:05 PM, Rasmus Lerdorf wrote:
> On 03/31/2011 07:41 AM, Philip Olson wrote:
> >
> > On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote:
> >
> >> On 30.03.11 21:36, Dan Birken wrote:
> >>> As for adding other string functions, I agree, I think there are a l
On 03/31/2011 07:41 AM, Philip Olson wrote:
>
> On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote:
>
>> On 30.03.11 21:36, Dan Birken wrote:
>>> As for adding other string functions, I agree, I think there are a lot of
>>> them that would be great to add. starts_with & ends_with for sure.
>>
>> B
On Thu, Mar 31, 2011 at 4:49 PM, Martin Jansen wrote:
> On 31.03.11 16:41, Philip Olson wrote:
> > On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote:
> >> Both str_startswith and str_endswith have been suggested in the past:
> >>
> >> http://marc.info/?t=12164723011&r=1&w=2
> >>
> >> I recentl
On 31.03.11 16:41, Philip Olson wrote:
> On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote:
>> Both str_startswith and str_endswith have been suggested in the past:
>>
>> http://marc.info/?t=12164723011&r=1&w=2
>>
>> I recently got around to merge them into a largely unfinished extension
>> so t
On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote:
> On 30.03.11 21:36, Dan Birken wrote:
>> As for adding other string functions, I agree, I think there are a lot of
>> them that would be great to add. starts_with & ends_with for sure.
>
> Both str_startswith and str_endswith have been suggeste
We need access to this repository to commit changes to the infrastructure:
https://svn.php.net/repository/systems/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi.
I can use return FAILURE during PHP_MINIT_FUNCTION to stop a module
from loading and the appropriate message is displayed ...
PHP Warning: PHP Startup: Unable to load dynamic library 'xx' -
The specified module could not be found.
in Unknown on line 0
I want to restrict the module to o
On 31 March 2011 10:31, Rasmus Lerdorf wrote:
> #include "SAPI.h"
>
> and then you will have the name in the global sapi_module struct:
>
> sapi_module.name
>
> -Rasmus
>
> On 03/31/2011 02:24 AM, Richard Quadling wrote:
>> Hi.
>>
>> From a CLI/CGI perspective, the following code returns the full
#include "SAPI.h"
and then you will have the name in the global sapi_module struct:
sapi_module.name
-Rasmus
On 03/31/2011 02:24 AM, Richard Quadling wrote:
> Hi.
>
> From a CLI/CGI perspective, the following code returns the full path
> of the php.exe file.
>
> DWORD len;
>
Hi.
>From a CLI/CGI perspective, the following code returns the full path
of the php.exe file.
DWORD len;
char buf[MAX_PATH];
len = GetModuleFileName(NULL, buf, sizeof(buf));
buf[len] = '\0';
If PHP is loaded as a module, how do y
22 matches
Mail list logo