Get all arguments available in a snippet?

It feels really simple but still I can’t figure out how I can get all the arguments sent to a snippet.

snippet('my-snippet', ['argument' => 'Hello!']);

Inside the snippet I would like to get all the args something like this:

print_r($args);

It would result in something like this:

array(
  'argument' => 'Hello!'
);

How can I do that?

<?php
$args = array('argument' => 'Hello');
snippet('test', ['args' => $args]);
 ?>

Snippet:

<?php

dump($args);
?>

Yes, that would be possible but here is another example:

snippet('my-snippet', ['car' => true, 'boat' => false]);

The only way I can get all these arguments is by wrapping them into an array like you suggested?

snippet('my-snippet', ['args' => ['car' => true, 'boat' => false]]);

At least I’m not aware of any other method.

If solved it! :smiley:

print_r(get_defined_vars()['_data']);