Always re-post the updated requirement instead changing the original.
Sorry, I hoped/wished that nobody seen this already. But you guys are fast here.
I'm fighting with your example to get the 2 values in. But for one of the other reason, i can't figure out how to use the second variable in the same script.
Should/can I do that in the same 'set' command? With a kind of 'and' command?
Hi there,
i would like to repeat a command in a shell sript (bash)
the script starts with a menu to choose a menu point to do something ....
on the end of the script i would like to restart the programm to choose the menu points on the beginning.
I would also make a sript that send... (2 Replies)
Any idea to repeat an action to all the lines in vi...
suppose i want to delete the first word from all the lines in VI .. how would i do it ?
in general i am also looking for a way to apply a action to all the lines in VI . (6 Replies)
On my system I use Escape "k" to go back in commands. I read on tutorials that it is ctrl p, but that does not work on my system.
Anyone know what the command to go foward is? (6 Replies)
Hi All,
I have done some looking at other threads but haven't found quite what I am looking for. I am a newbie to scripting and haven't got to where I want to you but here is my basic question. I have a script to copy a file and send it to another file with a date and time stamp. What I want to... (4 Replies)
I have a file like this
2011-10-10 10:46:00,1-1-13-1-1,151510,ALCLA0A84D2C
2011-10-10 10:46:00,1-1-13-1-1,151520,65537
2011-10-10 10:46:00,1-1-13-1-1,151515,46932
2011-10-10 10:46:00,1-1-13-1-1,151521,32769
2011-10-10 10:46:00,1-1-13-1-1,151522,32769
2011-10-10... (4 Replies)
How do i write a loop ping to see if it get timeout or hang ? it should loop every 30 second to ping a server ?
ping -c 5 -t 15 www.google.com
if ]; then
date '+%Y-%m-%d %H:%M:%S Connection Unavailable' >> /home/sabercats/checkconnection.log
else
date '+%Y-%m-%d %H:%M:%S Connection... (3 Replies)
Well here is my question.
Let's say I have this Script:
find /var/mobile/ maxdepth -2 name "$x" >> /"$x".txt
The thing is I want to repeat this script and pull out a variable from a text file like this (each line = new variable $x and another run of the whole command)
Thanks for... (27 Replies)
How to repeat the execution of a simple command like the following for 1 sec ?
echo Hi
The completion time for the command is not known, but we need to calculate the number of times this commans executes successfully within 1 sec.
Thanks
Kumarjit (5 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. How can i use loop to repeat task.
2.shirt=15
black=13.50
echo "how many shirt you want"
read num
echo
echo "Please enter a choice"
echo "1 ---> normal... (5 Replies)
Discussion started by: Tauatioti
5 Replies
LEARN ABOUT PHP
debug_zval_dump
DEBUG_ZVAL_DUMP(3) 1 DEBUG_ZVAL_DUMP(3)debug_zval_dump - Dumps a string representation of an internal zend value to outputSYNOPSIS
void debug_zval_dump (mixed $variable, [mixed $...])
DESCRIPTION
Dumps a string representation of an internal zend value to output.
PARAMETERS
o $variable
- The variable being evaluated.
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
debug_zval_dump(3) example
<?php
$var1 = 'Hello World';
$var2 = '';
$var2 =& $var1;
debug_zval_dump(&$var1);
?>
The above example will output:
&string(11) "Hello World" refcount(3)
Note
Beware the refcount
The refcount value returned by this function is non-obvious in certain circumstances. For example, a developer might expect the
above example to indicate a refcount of 2. The third reference is created when actually calling debug_zval_dump(3).
This behavior is further compounded when a variable is not passed to debug_zval_dump(3) by reference. To illustrate, consider a
slightly modified version of the above example:
Example #2
<?php
$var1 = 'Hello World';
$var2 = '';
$var2 =& $var1;
debug_zval_dump($var1); // not passed by reference, this time
?>
The above example will output:
string(11) "Hello World" refcount(1)
Why refcount(1)? Because a copy of $var1 is being made, when the function is called.
This function becomes even more confusing when a variable with a refcount of 1 is passed (by copy/value):
Example #3
<?php
$var1 = 'Hello World';
debug_zval_dump($var1);
?>
The above example will output:
string(11) "Hello World" refcount(2)
A refcount of 2, here, is extremely non-obvious. Especially considering the above examples. So what's happening?
When a variable has a single reference (as did $var1 before it was used as an argument to debug_zval_dump(3)), PHP's engine opti-
mizes the manner in which it is passed to a function. Internally, PHP treats $var1 like a reference (in that the refcount is
increased for the scope of this function), with the caveat that if the passed reference happens to be written to, a copy is made,
but only at the moment of writing. This is known as "copy on write."
So, if debug_zval_dump(3) happened to write to its sole parameter (and it doesn't), then a copy would be made. Until then, the
parameter remains a reference, causing the refcount to be incremented to 2 for the scope of the function call.
SEE ALSO var_dump(3), debug_backtrace(3), References Explained, References Explained (by Derick Rethans).
PHP Documentation Group DEBUG_ZVAL_DUMP(3)