[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.145.112.163: ~ $
--TEST--
Twig supports array notation
--TEMPLATE--
{# empty array #}
{{ []|join(',') }}

{{ [1, 2]|join(',') }}
{{ ['foo', "bar"]|join(',') }}
{{ {0: 1, 'foo': 'bar'}|join(',') }}
{{ {0: 1, 'foo': 'bar'}|keys|join(',') }}

{{ {0: 1, foo: 'bar'}|join(',') }}
{{ {0: 1, foo: 'bar'}|keys|join(',') }}

{# nested arrays #}
{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %}
{{ a[2]|join(',') }}
{{ a[3]["foo"]|join(',') }}

{# works even if [] is used inside the array #}
{{ [foo[bar]]|join(',') }}

{# elements can be any expression #}
{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }}

{# arrays can have a trailing , like in PHP #}
{{
  [
    1,
    2,
  ]|join(',')
}}

{# keys can be any expression #}
{% set a = 1 %}
{% set b = "foo" %}
{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %}
{{ ary|keys|join(',') }}
{{ ary|join(',') }}

{# ArrayAccess #}
{{ array_access['a'] }}

{# array that does not exist #}
{{ does_not_exist[0]|default('ok') }}
{{ does_not_exist[0].does_not_exist_either|default('ok') }}
{{ does_not_exist[0]['does_not_exist_either']|default('ok') }}
--DATA--
return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'array_access' => new \ArrayObject(['a' => 'b'])]
--EXPECT--
1,2
foo,bar
1,bar
0,foo

1,bar
0,foo

1,2
bar

bar

FOO,BAR,

1,2

1,foo,c,1foo
a,b,c,d

b

ok
ok
ok
--DATA--
return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'array_access' => new \ArrayObject(['a' =>  'b'])]
--CONFIG--
return ['strict_variables' => false]
--EXPECT--
1,2
foo,bar
1,bar
0,foo

1,bar
0,foo

1,2
bar

bar

FOO,BAR,

1,2

1,foo,c,1foo
a,b,c,d

b

ok
ok
ok

Filemanager

Name Type Size Permission Actions
_self.test File 107 B 0644
array.test File 1.55 KB 0644
array_call.test File 230 B 0644
binary.test File 489 B 0644
bitwise.test File 207 B 0644
call_argument_defined_twice.test File 229 B 0644
call_positional_arg_after_named_arg.test File 272 B 0644
comparison.test File 280 B 0644
divisibleby.test File 268 B 0644
dotdot.test File 534 B 0644
ends_with.test File 538 B 0644
floats.test File 256 B 0644
grouping.test File 110 B 0644
literals.test File 207 B 0644
magic_call.test File 475 B 0644
matches.test File 221 B 0644
method_call.test File 480 B 0644
negative_numbers.test File 174 B 0644
not_arrow_fn.test File 159 B 0644
operators_as_variables.test File 242 B 0644
postfix.test File 266 B 0644
power.test File 226 B 0644
sameas.test File 323 B 0644
starts_with.test File 569 B 0644
string_operator_as_var_assignment.test File 221 B 0644
strings.test File 201 B 0644
ternary_operator.test File 342 B 0644
ternary_operator_noelse.test File 124 B 0644
ternary_operator_nothen.test File 130 B 0644
two_word_operators_as_variables.test File 245 B 0644
unary.test File 179 B 0644
unary_macro_arguments.test File 606 B 0644
unary_precedence.test File 153 B 0644