[PHP] can you do exec under Windows OS?

2002-07-11 Thread Wo Chang

Dear All,

Sorry to ask this simple question!

I know I can do exec under unix OS but
when I try it on Windows platform (running
Apache), PHP gives me Warning: Unable to fork.

Off hand I don't remember do I need to
modify the php.ini or semething else,
can someone give me a hand?

Thanks!

--Wo


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Can you do this

2001-01-31 Thread Boget, Chris

Academic curiosity -

You can do the following:

echo "3 - 2 = " . ( bcsub( 3, 2 ));

and PHP evaluates the expression in parenthesis (in this 
case a function) before it evaluates the echo statement 
and what gets printed out is:

3 - 2 = 1

Now, say I have a function where one of the arguments
is passed by reference and is modified within the function.
I can call this function on one line

myFunc( $modifiedVariable );

and print out the value (if any) of $modifiedVariable on
the next

echo $modifiedVariable.

So what I am wondering is if you can turn those two
statements into one?  The function is going to get evaluated
first we already know,  but I am not certain how I could
get the (new) value of $modifiedVariable.  Yes, it's just one
extra line but that is not why I ask.  I was thinking about it
yesterday and I became very curious if it could even be done.
Nothing I tried yielded results so I'm turning to the experts.
:p

Is this possible?
Thanks for entertaining my curiosity!

Chris



Re: [PHP] Can you do this

2001-01-31 Thread Christian Reiniger

On Wednesday 31 January 2001 16:03, Boget, Chris wrote:

 Now, say I have a function where one of the arguments
 is passed by reference and is modified within the function.
 I can call this function on one line

 myFunc( $modifiedVariable );

 and print out the value (if any) of $modifiedVariable on
 the next

 echo $modifiedVariable.

 So what I am wondering is if you can turn those two
 statements into one?  The function is going to get evaluated
 first we already know,  but I am not certain how I could
 get the (new) value of $modifiedVariable.  

What about using normal pass-by-value and returning the result?

function MyFunc ($SomeVal)
{
  $SomeVal += 42;
  return $SomeVal;
}

echo MyFunc ($StrangeVal);

Anyway - functions that get their parameters by reference and modify them 
can cause much trouble, so better be careful with that.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I saw God - and she was black.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Can you do this

2001-01-31 Thread Boget, Chris

 What about using normal pass-by-value and returning the result?
 function MyFunc ($SomeVal) {
   $SomeVal += 42;
   return $SomeVal;
 }
 echo MyFunc ($StrangeVal);

I'm already using the return value for something else.
 
 Anyway - functions that get their parameters by reference and 
 modify them can cause much trouble, so better be careful with 
 that.

Well, the only thing that I'm using that argument for is to return
an error message, if any.

Chris