Questions tagged [unset]
Removing the value associated with a variable or property from the current environment.
unset
597
questions
0
votes
0
answers
29
views
Unset env var not working as expected on bash script [duplicate]
Basically I have the next code:
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
export AWS_ACCESS_KEY_ID=$(echo $OUTPUT_ROLE | jq -r '.Credentials''.AccessKeyId');\
export ...
0
votes
2
answers
109
views
Table row is not removed using Livewire
I have a dynamic row created, and I want to remove the row but only the data from that row is removed and the input fields are not updated. I am using Livewire in this for creating the row and ...
1
vote
1
answer
44
views
BASH unset -v problem - referenced vars are unset too
Blindly relying on some statement claiming 'use unset-v or strange things will happen', I've been using unset -v since.
Now I've encountered following problem in conjunction with name references, ...
-1
votes
2
answers
102
views
Problem using PHP null coalescing together with ternary operator to reset a Session [duplicate]
I am trying to reset the Session with the below code:
<?=
$_SESSION['pettySuccess']??'';
(($_SESSION['pettySuccess']??'')=='') ?'': unset($_SESSION['pettySuccess']);
?>
the idea behind my ...
0
votes
2
answers
191
views
Why both the set and unset commands don't work as expected in my macOS terminal
I'm very confused by this result.
I have two questions.
What's wrong with that?
What are *, @, and argv?
$ set GITHUB_ENV_var=1
$ echo $GITHUB_ENV_var
# ❌ after set, echo nothing
$ set | grep ...
-1
votes
1
answer
84
views
PHP - unset a value from Iterator
I have a filter iterator. How can a unset a give value in it. I have tried unset($list[$key]), but that gives me an error : Cannot use object of type Filter as array
0
votes
1
answer
84
views
Does PHP garbage collection destroy objects with no reference?
I'm having a hard time finding clear information on PHP's garbage collection as it relates to objects referencing other objects. Specifically, I'm trying to understand what happens when I have a ...
1
vote
0
answers
60
views
How to set unset sequence in php
there are two inputs that should show interactions. Everything works, but when I want to refresh the page I add unset($_SESSION['one'], $_SESSION['second']) an error appears
Without unset($_SESSION['...
0
votes
2
answers
340
views
How do you unset all variables based on a prefix in zsh?
In bash you can do something like this:
unset "${!AWS_@}"
But this will give a substitution error in zsh.
I haven't found a really great way to do this in zsh. Presumably because zsh has a ...
0
votes
0
answers
56
views
im trying to loop through array of coordinates and remove elements from array if they within x miles of any other element in in array
example:
$arr =Array(
Array("name1","lat1","lng1"),
Array("name2","lat2","lng2"),
Array("name3",&...
3
votes
1
answer
106
views
Strange behavior of `unset` for local variables
I can't explain the following behavior of unset:
#!/bin/bash
my_unset() { unset "$@"; }
fn1() { local var; unset var; var=1; }
fn2() { local var; my_unset var; var=2; }
var=0
fn1; ...
0
votes
5
answers
225
views
PHP unset not removing value from array loop
I have an array("https", "www", "stackoverflow", "com")
$search_array = array("https", "www", "stackoverflow", "com");
...
0
votes
2
answers
80
views
Unset variable at the end of if else statement
I am using 2 if else statements where the first set just displays 4 results, and the second should display all results (including the initial 4)
I have got the counter working but it also effects the ...
0
votes
1
answer
54
views
PHP: Unset All Empty Key Value Pairs of an Array
I have an associative array in my PHP code. I want to unset all the keys that have empty value.
I know individual keys can be unset using the following code
unset($array_name['key_name']);
What I don'...
1
vote
2
answers
100
views
The PHP unset doesn't clear the reference completely
I have a simple class and assign its instance to its static variable. When I unset the instance, not sure why it doesn't actual release the memory.
class Foo {
public static $app;
public ...