Which of the following values are available to define a null element in YAML ?
~
null
false
null
~
-
In Twig, which of the following operators has the highest precedence?
| (filters)
<=>
==
in
| (filters)
or
and
Which expression can be applied to ??? in order to display the name of each people along with his name and age?
None of those
Which syntax is valid to avoid escaping ?
{{ hello|raw }}
{{ hello }}
{{ hello|raw }}
{{ hello|escape('no') }}
{{ hello|no_escape }}
How to get the value of title set in a form?
How can you print the value of the name property in a Twig template ?
{{ foo.getName() }}
{{ foo.name }}
{{ foo.['name'] }}
{% foo.['name'] %}
{% foo.data.name %}
{% foo.name %}
{{ foo.data.name }}
{{ foo.getName() }}
{% foo.getName() %}
{{ foo.name }}
How to get the current route name from Twig?
{{ app.request.route }}
{{ app.request.attributes.get('route') }}
{{ app.routing.route }}
{{ app.request.attributes.get('_route') }}
{{ app.request.attributes._routeName }}
{{ app.request.attributes._route }}
{{ app.request.route }}
Which of the following statements will display bar ?
{{ [] is not empty ? 'foo' : 'bar' }}
{{ 0 ? 'foo' : 'bar' }}
{{ 0 is not empty ? 'foo' : 'bar' }}
{{ '' ? 'foo' : 'bar' }}
{{ [] ? 'foo' : 'bar' }}
{{ '' is not empty ? 'foo' : 'bar' }}
{{ '0' is not empty ? 'foo' : 'bar' }}
{{ [] ? 'foo' : 'bar' }}
{{ [] is not empty ? 'foo' : 'bar' }}
{{ 0 ? 'foo' : 'bar' }}
{{ '' ? 'foo' : 'bar' }}
{{ 0 is not empty ? 'foo' : 'bar' }}
{{ '' is not empty ? 'foo' : 'bar' }}
{{ '0' ? 'foo' : 'bar' }}
What is true about twig delimiters ?
{{ ... }} is used to output the result of an expression
{% ... %} is used to execute statements such as for-loops
{% ... %} is used to output the result of an expression
{% ... %} is used to execute statements such as for-loops
{{ ... }} used to execute statements such as for-loops
{{ ... }} is used to output the result of an expression
include() function that can be called using both {{ }} and {% %} syntax.Which is a valid statement to concatenate two strings in Twig ?
In a Twig template, how can you test that a given constant is defined by PHP? (Example, how can you check if VERSION constant is defined by Symfony\Component\HttpKernel\Kernel class?)
The is defined support for the constant() function was added in Twig 1.28 (November 2016). See http://twig.symfony.com/doc/functions/constant.html
Which is a valid statement to concatenate two strings in Twig ?
By filling the requirement to have libcurl>=7.36, in which cases HTTP/2 will be enabled ?
you passed the value 2.0 to the option http_version when you created the client (factory HttpClient::create)
You haven't passed a specific option to the factory but you're requesting an https url
You haven't passed a specific option to the factory but you're requesting an https url
you passed the value true to the option http2 when you created the client (factory HttpClient::create)
you passed the value 2.0 to the option http_version when you created the client (factory HttpClient::create)
Consider the following code snippet :
What should replace /* ??? */ to make $i available to the foreach loop?
What are the correct ways to parse the 1983-07-01 date into an DateTime object?
Lets assume that our application is reachable through https://myapp.comand using a homepage located via a route called homepage.
Which of these are correct ways to create a redirection response in a controller that extends Symfony\Bundle\FrameworkBundle\Controller\AbstractController?
Which of these is the correct way to use the Security annotation to secure a Controller with the ROLE_ADMIN?
@Security("is_granted('ROLE_ADMIN')")
@Security("ROLE_ADMIN")
@Security("require('ROLE_ADMIN')")
@Security("is_granted('ROLE_ADMIN')")
@Security("must('ROLE_ADMIN')")
What is the correct way to ignore attributes?
What is the correct way to display the value of a PHP constant?
With the following code:
what is the correct way to deserialize the $data into an $persons array of Acme\Person objects?
Which of the following is the correct way to deserialize $data formatted in xml into an existing Acme\Person object named $person?
What is the signature of the voteOnAttribute() method from Symfony\Component\Security\Core\Authorization\Voter\Voter abstract class?
What methods MUST be implemented in a custom voter extending Voter ?
voteOnAttribute()
supports()
supportsAccess()
voteOnAttribute()
vote()
supportsAttribute()
supports()
supportsSubject()
voteOnAccess()
What is the tag to register a service that initializes objects before validation?
validator.initializer
validator.initializer
validation_initializer
validation.initializer
validator_initializer
What is the tag to register a custom validation constraint validator?
validator.constraint_validator
validation.validator
validator.constraint
validation.constraint_validator
validation.constraint
validator.constraint_validator
constraint_validator
validator_constraint
Which sentences are true about user checkers ?
user checker methods throw an exception when requirements are not fulfilled
user checkers must implement a checkPreAuth method
user checkers must implement a checkPreAuth method
user checkers must implement a check method
user checker methods throw an exception when requirements are not fulfilled
user checker methods return false when requirements are not fulfilled
user checkers must implement a preCheck method
user checkers must implement a preAuth method
You can change where the login form redirects after a successful login using the various config options. In case no previous URL was stored in the session, you may wish to try using the HTTP_REFERER instead. Which security.yml parameter allows you to use the Referer HTTP header?
How to add an extension MyForm to the Form component ?
How to register a service in a specific env in php ?
it's not possible
Which of the following is the correct usage for serializing the $person object into json?
What is returned by $dispatcher->dispatch($event, OrderPlacedEvent::NAME) in the following code?
Nothing
What is returned by the isEmpty method of Symfony\Component\HttpFoundation\Response?
true if the response status code are 204 or 304
true if the response content is null
true if there is a server error
true if the response status code are 204 or 304
true if the response has no headers
What will be the result of invoking the isXmlHttpRequest() method on a Symfony\Component\HttpFoundation\Request object?
true if the request has the X-Requested-With header set to XMLHttpRequest.
true if the request has the X-Requested-With header set to XMLHttpRequest.
true if the request must generate an XML response.
true if the request contains XML content.
true if the request has the Content-Type header set to application/xml.
Which of the following values are available to define a boolean element in YAML ?
true
false
1
false
0
true
What will be the value of $bool ?
true
false
true
Error : you cannot cast a String as a Boolean
What is the default value when calling Command::setHidden()?
true
true
false
https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Console/Command/Command.php#L496
Which method should you call to customize the behavior of the global dump() function?
What is the tag to register a custom service that loads translations?
translation.loader
translation_loader
translation.loader
translator_loader
translator.loader
What is the tag to register a custom service that dumps messages to a file?
translation.dumper
translation_dumper
translator.dumper
translator_dumper
translation.dumper
What are the methods of the Symfony\Component\Form\DataTransformerInterface interface?
transform()
reverseTransform()
reverseTransform()
transformBack()
transformReverse()
getName()
transform()
Which of the following are Filesystem methods?
touch
isAbsolutePath
chown
rename
dumpFile
tempnam
dumpFile
touch
duplicate
isAbsolutePath
move
rename
chown
tempnam
With framework.router.strict_requirements parameter set to true what we should see when going on the /article URL?
toto
toto
Unable to find the controller for path "article". The route is wrongly configured.
Parameter "id" for route "article" must match "\d+" ("toto" given)
Which of this following code is correct to use the percent character % in a translated string ?
Considering the following code, which one is correct to specify the default authentication mechanism ?
When using AbstractController, what is the purpose of the second argument of the file method ?
to set the name of the file
to set the name of the file
to set the disposition of the file (inline or attachement)
to set the mime type of the file
to set the size of the file
Which of the following code is correct to read the contents of returned files ?
Is the following class correct to be used as an event subscriber?
No
Yes
No
Given the following code, what will be stored in $string?
template
template.
An error
template.html.twig
template
template.html
What is the correct syntax to create a new request?
Which of the following are Filesystem methods?
symlink
makePathRelative
exists
remove
isAbsolutePath
move
isAbsolutePath
exists
makePathRelative
symlink
remove
According to the official Symfony Best Practices Guide and using the Symfony installer, which command allow you to create a blog application?
symfony new --webapp blog
symfony create-project blog
symfony install blog
symfony create blog
symfony new --webapp blog
Which function would best parse the following string by the tab (\t) and newline (\n) characters ?
strtok($string, "\t\n");
strtok($string, "\t\n");
strstr($string, "\t\n");
explode($string, "\t\n");
str_split($string, "\t\n");
With this following simple code:
Which variables types this $validator object can validate ?
strings
numbers
arrays
arrays
objects
numbers
strings
What will be the output of the following code?
string: |
Multiple
Line
StringMultiple\nLine\nStringstring: "Multiple\nLine\nString"string: "Multiple
Line
String"string: Multiple\nLine\nStringstring: |
Multiple
Line
String"Multiple\nLine\nString"What will be the output of the following code?
string: |
Multiple
Line
Stringstring: |
Multiple
Line
Stringstring: Multiple\nLine\nStringMultiple\nLine\nStringstring: "Multiple
Line
String"string: "Multiple\nLine\nString""Multiple\nLine\nString"What will be the output of the following code?
string: "Multiple
Line
String"string: |
Multiple
Line
StringMultiple\nLine\nStringstring: "Multiple
Line
String"string: Multiple\nLine\nString"Multiple\nLine\nString"string: "Multiple\nLine\nString"What are the arguments of the register() method used to register a function?
string $name The function name
callable $compiler A callable able to compile the function
callable $evaluator A callable able to evaluate the functionCompilerInterface $compiler A compiler able to compile the function
EvaluatorInterface $evaluator An evaluator able to evaluate the functioncallable $compiler A callable able to compile the function
callable $evaluator A callable able to evaluate the functionstring $name The function name
callable $compiler A callable able to compile the function
callable $evaluator A callable able to evaluate the functionstring $name The function name
CompilerInterface $compiler A compiler able to compile the function
EvaluatorInterface $evaluator An evaluator able to evaluate the functionAccording to the official Symfony Best Practices Guide, in which directory do you need to define your Twig extensions?
src/Twig/
src/Twig/Extensions/
src/Twig/
src/Twig/Extension/
src/Extensions/Twig/
src/Extension/Twig/
Which of the following language structures and functions does not output anything?
sprintf()
print_r()
sprintf()
print
echo
var_dump()
Assuming this code is at the root of the project, which function will allow PHP to automatically find the definitions for your classes?
What is the correct signature of the Symfony\Component\Filesystem\Filesystem::copy method?
Consider the following code snippet:
Which of the following is valid way to catch and process errors that were triggered with the trigger_error() function?
Which methods can be used for expiration caching ?
setEtag
setLastModified
setMaxAge
setExpires
setExpires
setCache
setLastModified
setEtag
setSharedMaxAge
setMaxAge
With the following service definition how is it possible to create an alias of the foo service?
With the following service definition how is it possible to create an alias of the foo service?
With the following service definition how is it possible to create an alias of the foo service?
What is the tag to register a new normalizer in the serializer service?
serializer.normalizer
serializer_normalizer
serializer.object_normalizer
serializer.normalizer
serializer.normalize
What is the tag to register a new encoder in the serializer service?
serializer.encoder
serializer_encoder
serializer.encoder
serializer.encode
serializer.object_encoder
What will be the value of the following configuration sample?
sendmail
\n
sendmail\n\n
sendmail\nsendmail\n
sendmail
The values between parameter tags in XML configuration files are not trimmed. https://symfony.com/doc/4.4/configuration.html#configuration-parameters
Which command is used to hash a password?
security:hash-password
security:hash-password
security:generate-password
security:encode-password
security:new-password
Using the new Authenticator-Based Security, how to allow some routes to be accessed by anonymous users?
When creating custom voter, which dependency injection tag has to be used?
security.voter
secure.voter
secure.vote
security.vote
security.voter
What is the tag to add a custom voter to Symfony's authorization logic?
security.voter
security.authorization_voter
security.voter
security_voter
security.auth_voter
What is the tag to register a provider for expression language functions in security?
security.expression_language_provider
security_provider
security.provider
security.expression_language_provider
When you want to use a translation in another domain than the default domain, you must specify the domain as:
second argument of trans()
first argument of trans()
fourth argument of trans()
second argument of trans()
third argument of trans()
What is the option you can pass to a Symfony\Component\Form\Extension\Core\Type\NumberType form type to change the number of decimals allowed until the field rounds.
scale
decimals
precision
scale
When creating custom loader, which dependency injection tag has to be used?
routing.loader
router.load
router.loader
routing.load
routing.loader
What is the tag to register a custom service that loads routes?
routing.loader
router.route_loader
router_loader
routing_loader
routing.loader
routing.route_loader
router.loader
What is the tag to register a provider for expression language functions in routing?
routing.expression_language_provider
router.expression_language_provider
router.provider
router.route_provider
routing.expression_language_provider
routing.route_provider
routing.provider
Which native function should you use to generate a cryptographically secure random integer?
random_int()
rand()
mt_rand()
random_int()
lcg_value()
Which is the method that allows to execute some code only after the last test defined by a class?
public static function tearDownAfterClass()
public static function tearDown()
public static function tearDownAfterClass()
public function tearDownAfterClass()
public function tearDown()
Which is the method that allows to execute some code only before the first test defined by a class?
public static function setUpBeforeClass()
public function setUp()
public static function setUp()
public function setUpBeforeClass()
public static function setUpBeforeClass()
Which of the following methods are valid PHPUnit data providers?
Which method is to be implemented from a ServiceSubscriberInterface?
What is the signature of the vote() method from VoterInterface?
Which of the following is a valid code to make a data provider working ?
Which method must implement a TranslationLoader that implements Symfony\Component\Translation\Loader\LoaderInterface?
Which methods must be implemented by classes that implements Symfony\Component\Translation\Loader\LoaderInterface?
What is the signature of the Symfony\Contracts\HttpClient\ResponseInterface::getHeaders method?
public function getHeaders(bool $throw = true): array
public function getHeaders(): array
public function getHeaders(bool $throw = false): array
public function getHeaders(bool $throw = true): array
What are the methods of Symfony\Component\Serializer\NameConverter\NameConverterInterface?
What is the method signature to configure the options in a form?
Which is the method that allows to execute some code before each test defined by a class?
protected function setUp()
protected static function setUpBeforeClass()
protected function setUpBeforeClass()
protected static function setUp()
protected function setUp()
Which injection types are supported by Symfony's Dependency Injection Container?
property
setter
constructor
setter
getter
constructor
property
What is the tag to use to create a class that collects custom data for the profiler?
profiler.data_collector
debug.data_collector
data_collector
profiler.data_collector
kernel.data_collector
From the script below, how would you display the error messages thrown by the 'ls' command ?
proc_errors($process);
proc_errors($process);
fgets($pipes[2]);
fread($null, 128);
stream_errors($pipes);
Which of the following is NOT a default PHP input or output stream ?
php://error
php://stdout
php://error
php://output
php://stdin
php://input
Which methods belong to Symfony\Component\Finder\Finder class ?
path
name
size
notPath
notName
type
notSize
owner
size
name
notPath
path
notName
What is the correct option to add other directories in the translator configuration?
Which types are returned by FormTypeGuesserInterface::guessMaxLength()?
null
GuessedValue
null
GuessedValue
ResolvedValue
ValueGuessed
ValueGuess
https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Form/FormTypeGuesserInterface.php
What will be the response's content when calling FooController::action?
notice: First notice
notice: Second notice
notice: First notice
notice: Second notice
error: First error
error: Second errornotice: First notice
notice: Second notice
error: First error
error: Second errornotice: First notice
notice: Second notice
notice: First notice
notice: Second notice
error: First error
error: Second errornotice: Second notice
notice: First notice
error: Second error
error: First error
notice: Second notice
notice: First noticeerror: Second error
error: First error
notice: Second notice
notice: First noticeWhich Cache-Control directive disallows the browser and all intermediate caches from storing any version of the returned response ?
no-store
no-cache
public
no-store
private
Which of the following values doesn't trigger a violation when the Date constraint is applied to it?
new \DateTime('2020-01-15')
null
'2020-01-15'
null
new \DateTime('2020-01-15')
'2020-01-15'
'2020-13-15'
'15/01/2020'
'15/13/2020'
Which of the following values doesn't trigger a violation when the Date constraint is applied to it?
new \DateTime('2020-01-15')
'2020-01-15'
'15/01/2020'
new \DateTime('2020-01-15')
'15/13/2020'
'2020-01-15'
'2020-13-15'
null
Which of the following is not a built-in function anymore as of PHP 7.0?
mysql_connect()
mysql_connect()
date()
in_array()
metaphone()
What will be the output of the following code (in PHP 5 / 7 / 8.0) ?
my_overriden_value
An error
my_overriden_value
my_value
Which DIC tag is used by MimeType?
mime_types
mime_types
mime_type
mime.types
Which headers/directives will be ignored by a proxy if Expires, s-maxage and max-age are all present in a response ?
max-age
Expires
Expires
max-age
s-maxage
Given we add the following extension to the container:
What extra steps are needed in order to trigger the load method of FooExtension ?
load a config file via a container loader (YamlFileLoader, XmlFileLoader...) OR call $container->loadFromExtension($fooExtension->getAlias())
call $container->loadFromExtension($fooExtension)
call container->compile()
call $container->loadFromExtension($fooExtension)
load a config file via a container loader (YamlFileLoader, XmlFileLoader...) AND call $container->loadFromExtension($fooExtension->getAlias())
load a config file via a container loader (YamlFileLoader, XmlFileLoader...) OR call $container->loadFromExtension($fooExtension->getAlias())
The ___________ language construct is particularly useful to assign your own variable names to values within an array.
list()
array_get_variables()
each()
import_variables()
list()
current()
Which of the following describes the correct lifecycle of a Command?
initialize -> interact -> execute
interact -> initialize -> execute
initialize -> interact -> execute
initialize -> execute -> interact
What line of code should be substituted with /** line **/ to achieve an output of a?
ksort($fruitAndVeg);
usort($fruitAndVeg);
sort($fruitAndVeg);
krsort($fruitAndVeg);
ksort($fruitAndVeg);
Which of the following kernel events should you listen to in order to modify the HTTP response before it is sent back to the client?
kernel.view
kernel.response
kernel.controller
kernel.view
kernel.finish_request
kernel.terminate
kernel.request
kernel.response
In which order does Symfony trigger the following events?
kernel.requestkernel.controllerkernel.controller_argumentskernel.viewkernel.responsekernel.finish_requestkernel.terminatekernel.requestkernel.controllerkernel.controller_argumentskernel.responsekernel.viewkernel.terminatekernel.finish_requestkernel.requestkernel.controllerkernel.controller_argumentskernel.viewkernel.responsekernel.terminatekernel.finish_requestkernel.requestkernel.controllerkernel.controller_argumentskernel.viewkernel.responsekernel.finish_requestkernel.terminatekernel.requestkernel.controllerkernel.controller_argumentskernel.responsekernel.viewkernel.finish_requestkernel.terminateWhich tag will be applied to the following service once registered?
kernel.locale_aware
locale_aware
kernel.locale_entrypoint
None
locale_listener
kernel.locale_aware
kernel.locale_listener
What is the tag to add a new HTTP content rendering strategy?
kernel.fragment_renderer
kernel.renderer
kernel.content_renderer
kernel.fragment_renderer
fragment_renderer
content_renderer
renderer
Which event does the ParamConverterListener listen to ?
kernel.controller
kernel.request
kernel.controller
kernel.controller_arguments
When using RedirectController, which routing param allows to redirect with a 307/308 status code ?
keepRequestMethod
status_code
http_status
keepRequestMethod
statusCode
When using Twig in the full stack framework, which of these configuration keys are related to cache busting?
json_manifest_path
version
version_strategy
version_format
hash
version_map
json_manifest_path
version_hash
version_strategy
version
version_format
What is missing in the following code snippet in place of ??? ?
iterable
iterable
use (Iterable)
array
void
Which sentences about AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER are true ?
it's designed to be used as a response header
it's related to the no-cache property of cache-control
it's related to the no-store property of cache-control
it's related to the public/private property of cache-control
it's related to the no-cache property of cache-control
it's designed to be used as a SessionInterface option
it's related to the no-store property of cache-control
it's related to session storage strategy
it's designed to be used as a request header
it's designed to be used as a response header
What is true about ContainerConfigurator?
it allows to configure a service after its instanciation
it allows to work with service definitions
it allows to configure a service after its instanciation
it's an internal class that you should not use in your application
it doesn't exist
ContainerConfigurator (which is capable of configuring the container) should not be confused with a "service configurator" that allows to apply extra configuration logic to a specific service: https://symfony.com/doc/2.x/service_container/configurators.htmlWhich of the following are valid methods of the Symfony base controller class?
isCsrfTokenValid()
redirectToRoute()
denyAccessUnlessGranted()
denyAccessUnlessGranted()
isCsrfTokenValid()
createXmlResponse()
generatePath()
redirectToRoute()
Symfony 3 : https://github.com/symfony/symfony/blob/3.0/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Symfony 4 and later : https://github.com/symfony/symfony/blob/4.0/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php
Which of the following are valid values for the type option of the Symfony\Component\Validator\Constraints\Type validation constraint ?
integer
email
digit
integer
alpha
graph
email
xml
You can use ctype_ functions from corresponding built-in PHP extension (http://php.net/manual/en/ref.ctype.php)
What is the return type of the Symfony\Component\Console\Command\Command::execute method?
int
int
?int
?bool
void
bool
https://symfony.com/doc/6.0/console.html#creating-a-command https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Console/Command/Command.php#L293-L295
Which type does not correspond to a button?
input
submit
button
input
reset
Which SSI (Server Side Includes) directive is supported by Symfony?
include (<!--#include virtual="menu.cgi" -->)
config (<!--#config timefmt="%y %m %d" -->)
include (<!--#include virtual="menu.cgi" -->)
echo (<!--#echo var="REMOTE_ADDR" -->)
flastmod (<!--#flastmod virtual="index.html" -->)
exec (<!--#exec cgi="/cgi-bin/foo.cgi" -->)
Which of these are Symfony built-in security providers configuration name?
in_memory
ldap
chain
chain
ldap
doctrine
in_memory
memory
According to the official Symfony Best Practices Guide, where do you need to store the translation files?
in the translations/<language> directory
in the src/Resources/translations/ directory of each bundle
in the src/Resources/translations/<language> directory of each bundle
in the translations/<language> directory
in the translations/ directory
When checking to see if two variables contain the same instance of an object, which of the following comparisons should be used ?
In the following Twig template:
Which will be the last values iterated by i and j variables in the for loops?
i = 5 and j = 10
i = 5 and j = 5
i = 5 and j = 10
i = 10 and j = 5
i = 10 and j = 10
Twig 1.28 (November 2016) introduced a new with tag that allows to create different scopes in the same template. Variables defined inside a with tag are not available outside of it and don't modify the external variables. See https://twig.symfony.com/doc/tags/with.html
Consider the following route definition:
Which of the following URL patterns will match the forum_thread route?
http://www.domain.tld/category/73/thread-hello-world.html
http://forum.domain.tld/category/documentary/thread-aircrafts-mega-factory.html
http://forum.domain.tld/category/programming/thread-42.html?page=3
http://forum.domain.tld/category/documentary/thread-aircrafts-mega-factory.html
http://forum.domain.tld/category/18-roles-games/world-of-warcraft.html
http://www.domain.tld/category/73/thread-hello-world.html
http://forum.domain.tld/category/tv-shows/thread-dexter?page=3
http://forum.domain.tld/category/programming/thread-42.html?page=3
Consider the following code snippet:
What will be the output when running this script?
hellohello5hellohellotruehello1hello0What methods must a class implementing EventSubscriberInterface implement ?
getSubscribedEvents()
getSubscribedEvents()
onEvent()
handleEvent()
listenToEvents()
subscribeToEvents()
What are the methods available in Symfony\Component\HttpKernel\Event\KernelEvent?
getRequest
getRequestType
isMainRequest
getKernel
hasRequest
hasResponse
getException
getResponse
hasException
getRequest
getRequestType
isMainRequest
getKernel
https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/HttpKernel/Event/KernelEvent.php
What are the methods of Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface?
In Symfony\Component\HttpFoundation\File\File: what is the difference between the getExtension() method and the guessExtension() method?
getExtension returns the file extension extracted from the original file name and guessExtension returns the extension based on the MIME type.
getExtension returns the extension based on the MIME type and guessExtension returns the file extension extracted from the original file name.
Only the getExtension method exists in this class.
getExtension returns the file extension extracted from the original file name and guessExtension returns the extension based on the MIME type.
Which method call allows to retrieve detailed logs about the requests and the responses of an http transaction ?
getDebugInfo()
getInfoDebug()
getInfo('debug')
getDebugInfo()
getDebug('info')
Consider the following code snippet:
Which statement does the ??? placeholder replace in order to store the third passed arguments in the $third variable?
What are the ways to get the third argument passed to a function?
What are the valid values of the type option of the Symfony\Component\Form\Extension\Core\Type\PercentType form type.
fractional
integer
raw
rounded
integer
decimal
fractional
What is the tag to use to create a custom form field type?
form.type
form.type_extension
form.type
form_type
form
The default value of the realpath_cache_size PHP configuration option is 16K. Is this setting correct for a typical Symfony application?
Yes, because the performance of Symfony applications is independent from that option.
No, it's recommended to decrease it to 4K to limit the I/O load in the server.
No, it's recommended to increase it at least to 4096K.
Yes. There is no need to change the default value.
Yes, because the performance of Symfony applications is independent from that option.
Which of the following are valid block names ?
foo_bar
foo123
_foo
foo123
_foo
-foo
foo_bar
.foo
foo.bar
123foo
Given the following configuration:
What will be displayed in the myfield field ?
foo
none
Nothing, an exception will be thrown
foo
bar
What's the difference between findDefinition and getDefinition?
findDefinition Resolves aliases
findDefinition doesn't exist
getDefinition Resolves aliases
findDefinition Resolves aliases
There is no difference
Which keyword is used to block any overriding of a class/method by a subclass?
final
protected
void
static
final
private
What should you replace /* ??? */ by to get an output of
a = One; b = Two; c = Three
extract($array);
asort($array);
extract($array);
ksort($array);
implode($array);
What is the best way to split a string with the -=- pattern?
What is the method to call to check if getValue can safely be called?
exists()
checkValue()
isReadable()
exists()
canRead()
Consider the following code snippet:
Which of the following is the correct evaluated expression for the $b variable value?
Which options are available in the Symfony\Component\HttpFoundation\Response::setCache(array $options) method ?
etag
max_age
private
public
last_modified
s_maxage
not_modified
last_modified
public
expires
s_maxage
etag
max_age
private
Which of the following is not a supported control structure keyword in PHP?
enddowhile;
endwhile;
endfor;
endif;
endforeach;
enddowhile;
What is the tag to use to listen to different events/hooks in Symfony?
dispatcher.event_listener
kernel.listener
kernel.event_listener
event_listener
event_dispatcher.event_listener
dispatcher.event_listener
dispatcher.listener
What is the command to display the debug information of the container?
debug:container
container:debug
services:debug
debug:container
container:info
debug:services
Which of the following are built-in Twig functions (not from the Symfony bridge)?
date()
dump()
attribute()
path()
date()
render()
path()
dump()
max()
source()
url()
attribute()
What is the output ?
d e f
c d e
b c d
d e f
a b c
Which escape strategies are valid for HTML documents ?
css
url
html_attr
js
html
html
asset
css
html_attr
js
url
What are the options for configuring the session with cookies in the FrameworkBundle Configuration (framework)?
cookie_lifetime
cookie_httponly
cookie_domain
cookie_path
cookie_secure
force_cookie
cookie_domain
cookie_path
use_cookie
cookie_secure
cookie_lifetime
cookie_httponly
What is the tag to use to register a value resolver for controller arguments such as Request?
controller.argument_value_resolver
argument_resolver
controller.argument_value_resolver
controller.argument_resolver
controller.value_resolver
Which of the following parameter bags are not available in the Request object?
controller
response
request
response
server
controller
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Request.php
Which of the following are built-in voting strategies that can be configured in the AccessDecisionManager object?
consensus
unanimous
affirmative
unanimous
priority
consensus
neutral
positive
affirmative
null
veto
Which of the following is the AccessDecisionManager default strategy?
consensus
affirmative
consensus
unanimous
What is the default directory to store PHP, YAML or XML validation files (when not using annotations to define constraints)?
config/validations/
config/validator/constraints/
config/validations/
constraints/
validations/
config/constraints/
config/packages/validations/
validator/
config/validator/
config/packages/validator/
According to the official Symfony Best Practices Guide, where do you need to define the application behavior related configuration options?
config/parameters.yaml
config/parameters.yaml
.env
config/parameters.yaml.dist
.env.dist
config/services.yaml
Which of these ExpressionLanguage methods allow to cache the parsed expression ?
compile
evaluate
parse
evaluate
compile
parse
How to define a class that inherits from Foo ?
class Bar extends Foo {}
class Bar inherits Foo {}
class Bar childof Foo {}
class Bar extends Foo {}
When using the OptionsResolver, what is the correct call to setAllowedTypes to allow the value null for the option named my_option ?
Given the following output, which command could be used to format it?
How to get information on the route foobar of an application?
It is not possible to do this.
Which built-in console command can you use to debug the values of environment variables ?
bin/console debug:dotenv
bin/console debug:container --parameters
bin/console debug:container --env
No built-in command exists to debug environment variables.
bin/console debug:dotenv
Given the following output, which command can be used to trigger it?
bin/console debug:container --env-vars
bin/console debug:container --env-vars
bin/console debug:env
bin/console debug:container-env
None
bin/console debug:container --env-vars-debug
bin/console debug:container --env-display
What will be returned by the following code when the query string is ?foo=bar?
$request->query->get('bar', 'baz');
baz
false
A Symfony\Component\HttpFoundation\Exception\QueryException will be thrown
baz
null
All the pages of a website must have a common.css stylesheet. In addition, the homepage needs to have an extra stylesheet home.css. How to achieve that ?
base.html.twig
home.html.twig
base.html.twig
home.html.twig
base.html.twig
home.html.twig
base.html.twig
home.html.twig
base.html.twig
home.html.twig
base.html.twig
home.html.twig
Given the following form configuration:
What will be returned by $form['foo']->getData() when the checkbox is checked and the form submitted ?
bar
bar
false
true
An exception is thrown
According to the official Symfony Best Practices Guide, which encoder do you need to use for encoding your users' passwords?
auto
mcrypt
pbkdf2
bcrypt
auto
plaintext
sha512
According to the official Symfony Best Practices Guide, where do you need to define the infrastructure-related configuration options?
as environment variables
as environment variables
config/services.yaml
config/parameters.yaml
.env
https://symfony.com/doc/4.0/best_practices/configuration.html#infrastructure-related-configuration
Which function is used to remove and return the first element of an array?
array_shift
array_grab
array_pop
array_pull
array_shift
What line should be added to the cleanArray() function below to ensure this script outputs 1525hello?
array_push($functions, 'array_filter', 'array_unique');
array_push($functions, 'array_reduce');
array_push($functions, 'array_filter', 'array_unique');
array_pop($functions, 'array_clean');
$arr = array_clean($arr);
Which of the following functions compares array1 against array2 and returns the difference by checking array keys in addition?
array_diff_key
array_diff_key
array_diff_ukey
array_diff_uassoc
array_diff_assoc
What is the output?
array(0) { }
array(1) { ["'a'"]=> int(20)}
array(0) { }
array(3) { ["'a'"]=> int(20) [0]=> int(30) [1]=> int(35) }
An error
According to the official Symfony Best Practices Guide, which format do you need to use to configure routing, caching and security whenever possible?
annotations/attributes
yaml
php
annotations/attributes
xml
In Twig, which of the following operators has the lowest precedence?
and
<=
!=
==
and
In Twig, which of the following operators has the lowest precedence?
and
| (filters)
and
?: (ternary operator)
==
or
What is returned by the getData() method of PreSubmitEvent ?
an array
an array
the norm data of the form
the view data of the form
The model data of the form
What is the default Access Decision Strategy?
affirmative
consensus
priority
unanimous
affirmative
Which method should you use to register a new event listener on a FormBuilder instance?
addEventListener
addListener
addEventListener
createListener
registerListener
What is the output ?
a2 = e a1 = x a3 = z
0 = e 1 =x 2 = z
An error
a1 = e a2 = x a3 = z
a2 = e a1 = x a3 = z
How is a DateIntervalType form field rendered when the widget option is set to single_text ?
a single text field
a single text field
two html5 date fields
a single html5 date field
two text fields
Given the following esi call: render_esi(url('myroute')), which sentences are true ?
a path must be specified in the framework.fragments option
myroute must exist
framework.esi must be enabled
myroute must exist
a path must be specified in the framework.fragments option
"url twig function can't be used with render_esi"
Once the form is submitted, What will be the format of the data passed to the underlying object 'dt' property path (i.e. $form['dt']->getData()) ?
a datetime instance
an Ymd H.i.s formatted date string
a datetime instance
an yyyy-MM-dd 00:00:00 formatted date string
an yyyy-MM-dd h:mm:ss formatted date string
When the server can't return an acceptable response according to an If-Match header, it should return:
a 412 response code
a 422 response code
a 418 response code
a 406 response code
a 412 response code
When the server can't return an acceptable response according to the Accept headers, it should return:
a 406 response code
a 418 response code
a 406 response code
a 415 response code
a 412 response code
By default, what is the form field containing the CSRF token?
_token
_token
ThisTokenIsNotSoSecretChangeIt
_secret
_csrf
By default, what parameter can you use inside the login form to specify the target of the redirection?
_target_path
_default_target
_target
_target_path
_path
_path_target
Given the following form type declaration:
Which of these block names allow to customize these form fields ?
_special_field_widget
special_field_widget
special_field_widget
special_field_foo_widget
_my_form_foo_widget
_special_field_foo_widget
_special_field_widget
my_form_foo_widget
What is the attribute in the definition of a route setting the locale of a user?
_locale
_controller
_language
_i18N
_locale
Which attributes are reserved special routing parameters?
_controller
_format
_locale
_type
_format
_locale
_controller
_response
Consider the following code snippet:
Which statement does the ???? placeholder replace in order to make this program execute without any errors?
Which of the following are valid PHP class names ?
_MyClass
myClass
-MyClass
myClass
_MyClass
123MyClass
When customizing the twig environment, which of the following class should be used to create a new instanceof test ?
The expected usage is :
\Twig\TwigTest
\Twig\TwigFilter
\Twig\TwigTest
\Twig\TwigFunction
No need to customize because it is already built-in.
\Twig\Token
Which of the following are not valid interval notations ?
[1,+Inf[
{0,10,100,1000,Inf}
{0,10,100,1000,Inf}
]-Inf,Inf[
]1,Inf[
]Inf, 0]
[1,+Inf[
Which of the following $options allow a Twig_Filter decide how to escape data by itself?
Which of the following $options allow a Twig_Filter decide how to escape data by itself?
Given the $info array defined below, what is the best way to assign the first value to a variable called $name and the third value to a variable called $country?
[$name, $age, $country] = $info;
[$name, , $country] = $info;
array_list($name, $age, $country) = $info;
[$name, $age, $country] = $info;
[$name, $country] = $info;
Regarding this URI : /example?tags.id=2
What will be the content of $request->query->all() ?
The Symfony\Bundle\FrameworkBundle\Controller\TemplateController can be used to render a template without the need to create a dedicated controller. How can you specify the HTTP status code of the response issued by those controllers ?
You can use the statusCode option in the route definition like the following :
You can use the special {_code} route parameter like the following :
You can use the statusCode option in the route definition like the following :
You can't.
https://symfony.com/doc/current/templates.html#rendering-a-template-directly-from-a-route https://symfony.com/blog/new-in-symfony-5-4-misc-features-part-2#configurable-status-code-in-templates-rendered-from-routes
Can a class implement multiple interfaces ?
Yes.
No.
Yes.
From an Event instance, is it possible to get the EventDispatcher instance that dispatched this event?
Yes.
No.
Yes.
Since 3.0 the event dispatcher is passed to the listener call. http://symfony.com/doc/current/components/event_dispatcher.html#event-name-introspection
It is possible to find missing or unused translation messages from templates?
Yes, with the debug:translation command
Yes, with the debug:translate command
Yes, with the debug:translator command
Yes, with the debug:i18n command
Yes, with the debug:translation command
No, it is not possible.
When you are running a program asynchronously, it is possible to send it POSIX signals ?
Yes, with the Symfony\Component\Process\Process::signal method
Yes, with the Symfony\Component\Process\Process::signal method
No, it's not possible.
Yes, with the Symfony\Component\Process\Process::sendSignal method
Yes, with the Symfony\Component\Process\Process::send method
Could empty CollectionType entries be removed?
Yes, using delete_empty option
Yes, using resize_when_empty option
The CollectionType automatically resize itself
It's not possible
Yes, using delete_empty option
Yes, using remove_empty option
Is it possible to autowire the following service?
Let's assume that HtmlTransformer implements TransformerInterface:
Yes, the autowiring mechanism is smart enough to detect a service definition which implements the TransformerInterface
No, the autowiring mechanism doesn't work with interfaces
Yes, the autowiring mechanism is smart enough to detect a service definition which implements the TransformerInterface
Is it possible to use a constant in a parameter?
Yes, in PHP
Yes, in the YAML format (thanks to the expression language component)
Yes in XML format
Yes in XML format
Yes, in PHP
No
Yes, in the YAML format (thanks to the expression language component)
Does this syntax perform any check?
Yes, if foo is an object then if it's an array
No
Yes if foo is an array
Yes, if foo is an object then if it's an array
It is possible to use PSR-18 for your requests?
Yes, by using Symfony\Component\HttpClient\Psr18Client
Yes, by using Symfony\Component\HttpClient\Psr18Client
No
Is it possible to simulate an HTTP request without mocking the HttpClient thanks to createMock() from PHPUnit?
Yes, by using Symfony\Component\HttpClient\MockHttpClient
Yes, by using Symfony\Component\HttpClient\MockHttpClient
No
When using several user providers in your application, is it mandatory to define the provider key on your firewall(s) configuration ?
Yes, but it is not mandatory when there is only one provider.
No, if the value is not set, the first defined provider will be used.
Yes, if the value is not set on one of the firewalls, an error will be thrown.
Yes, but it is not mandatory when there is only one provider.
No, if the value is not set, the last defined provider will be used.
Will Autowiring automatically inject dependencies of an autowired service?
Yes, autowiring will find and register all dependencies
Yes, autowiring will find and register all dependencies
Yes, if dependencies are explicitly declared as autowired or manually configured.
No
When creating stub is it possible to disable the call to the original class constructor?
Yes with the disableOriginalConstructor() method.
No
Yes with the disableOriginalConstruct() method.
Yes with the disableOriginalConstructor() method.
Yes with the disableConstruct() method.
Yes with the disableConstructor() method.
Could an event be dispatched from the ImmutableEventDispatcher?
Yes
Yes
No
Could a status code be defined when rendering a template using TemplateController?
Yes
No
Yes
Could the cache service used to store validation metadata be overridden?
Yes
Yes
No
Could a Closure be executed?
Yes
Yes
No
https://github.com/symfony/symfony/blob/5.3/src/Symfony/Component/Runtime/Runner/ClosureRunner.php
Could the parsed and/or serialized expressions be evaluated?
Yes
No
Yes
Should a Location header be set in a response that use the 301 status code?
Yes
Yes
No
Is the following code valid?
Yes
No
Yes
Could the existence of an event listener be checked from within the ImmutableEventDispatcher?
Yes
Yes
No
Could an Expression be created from within a template?
Yes
No
Yes
Could the alias of an event be changed?
Yes
No
Yes
Is there a way to make sure that the {{ form_end(form) }} does not render all the fields not rendered?
Yes
No
Yes
Is it possible to check that a number is positive?
Yes
Yes
No
Could the default middleware list be disabled?
Yes
No
Yes
Is it possible to pass PHP objects to a Twig template?
Yes
Yes
No
Is it possible to activate an option to log missing translations?
Yes
Yes
No
Could information like the transport name and so on can be retrieved from the worker?
Yes
Yes
No
Is the following code valid?
Yes
Yes
No
Can you have multiple buses in a single application?
Yes
No
Yes
Should attributes be used to define entities mapping?
Yes
Yes
No
https://symfony.com/doc/5.4/best_practices.html#use-attributes-to-define-the-doctrine-entity-mapping
Could the container be dumped into a single file?
Yes
No
Yes
Is it possible to set values of an array with a PropertyAccessor?
Yes
No
Yes
Given the context where a file (called react.0.0.0.js and incremented each time the file is updated) is available via https://example.com/react.0.0.0.js, could an immutable cache-control header be applied to it without encountering any cache issues?
Yes
Yes
No
Could a ParameterBag be frozen?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
Should secrets be used to store sensitive configuration values (like an API key)?
Yes
No
Yes
Can I use Twig without using Symfony?
Yes
No
Yes
Could enumerations be used with !php/const?
Yes
No
Yes
Is it possible to load routes from a file?
Yes
No
Yes
Could synthetic services be injected into other services?
Yes
No
Yes
Could the usage of the session be deactivated per route?
Yes
No
Yes
Could a FlashBag be cleared?
Yes
Yes
No
Could the choices of LanguageType be overridden?
Yes
Yes
No
Is the following code valid when using the safe directive?
Yes
No
Yes
Is the following code valid?
Yes
No
Yes
Could an event listener be registered while using the __invoke() method to listen to an event?
Yes
Yes
No
Does the following code valid ?
Yes
Yes
No
Is the following extends tag valid ?
{% extends ['layout1.html.twig', 'layout2.html.twig'] %}
Yes
Yes
No
When using mirror(...), could files that are not present in the source directory be deleted?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
Could a cache performance optimization (such as pre-fetching) be used with a safe method?
Yes
Yes
No
Could a route be aliased?
Yes
Yes
No
Could a RGB color be validated?
Yes
Yes
No
Could the destination of the dump be customized?
Yes
Yes
No
Is it possible to check that a number is positive or equal to zero?
Yes
No
Yes
Could the number of time each environment variables has been resolved be obtained when using ContainerBuilder?
Yes
No
Yes
Could a class be added into the list of preloaded classes by PHP?
Yes
No
Yes
Could an immutable cache-control header be used with max-age?
Yes
Yes
No
Could the theme used by HtmlDumper be changed?
Yes
No
Yes
Does a response using the 308 status code should contain a Location header?
Yes
No
Yes
Could the session be migrated?
Yes
Yes
No
Could a custom request matcher be created?
Yes
Yes
No
Could the parent request be retrieved from the request stack?
Yes
No
Yes
https://github.com/symfony/symfony/blob/2.4/src/Symfony/Component/HttpFoundation/RequestStack.php
Is the following code valid?
Yes
No
Yes
If a User class extends a BaseUser class, and the applied validation group is User. Will the constraints present in the BaseUser class be applied ?
Yes
No
Yes
Could a custom fragment renderer strategy be created?
Yes
Yes
No
Could you consume server-sent events?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
Is the following code valid?
Yes
No
Yes
Is it possible to define environment variables only for the test environment?
Yes
Yes
No
Could a stale response be marked as reusable when an origin server responds with and error (500, 502, 503 or 504)?
Yes
Yes
No
Is the following code valid?
Yes
No
Yes
Is it possible to change directly the locale of a Request from an URL?
Yes
No
Yes
Can we create a custom escaper for Twig ?
Yes
No
Yes
Should the Symfony secret vault be used in a critical production environment?
Yes
Yes
No
Is the following code valid?
Yes
No
Yes
Could the event listeners related to an event be retrieved from the ImmutableEventDispatcher?
Yes
Yes
No
Is the following code valid?
Yes
No
Yes
Could the container be preloaded using Opcache preloading?
Yes
No
Yes
When creating a service definition using PHP, could the visibility of the service be changed using Symfony\Component\DependencyInjection\Definition::setPublic($boolean) ?
Yes
No
Yes
Is it possible to set the path used to load the .env files?
Yes
Yes
No
Could the number of forwards be limited in a TRACE or OPTIONS request?
Yes
No
Yes
Could a command listen to signals?
Yes
No
Yes
Could existing variables be overwritten when using extract?
Yes
Yes
No
Is it possible to pass a Response instance to the Symfony\Bundle\FrameworkBundle\Controller\Controller::render() method?
Yes
Yes
No
Could the FQCN of a Symfony built-in event be used to subscribe / listen to it?
Yes
Yes
No
Could fields be sorted using a priority?
Yes
Yes
No
5.3, the priority option can be used to sort fields.Is it possible to listen signals and stop command according to them?
Yes
No
Yes
Could the scheme used by the RequestContext be overridden via a parameter?
Yes
No
Yes
Could the default serializer be changed?
Yes
No
Yes
Could variables be extracted as references when using extract?
Yes
No
Yes
Could a JSONP callback be set?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
Could a priority be set when adding a new compiler pass?
Yes
No
Yes
Could a CIDR notation be validated?
Yes
No
Yes
Should the must-understand directive be coupled with no-store for fallback behavior?
Yes
No
Yes
Could a response that use the 301 status code be cached?
Yes
No
Yes
According to the official Symfony Best Practices Guide, is it useful to spend time and effort writing tests that check if your application pages are successfully loading?
Yes
No
Yes
Are the "HTTP-date" directives considered as case-sensitive?
Yes
No
Yes
Could a response to a question be hidden?
Yes
Yes
No
Is the following header value valid?
Yes
No
Yes
Could Command be used as a concrete class without defining the execute method?
Yes
No
Yes
Could an custom asset package be added?
Yes
Yes
No
Can interfaces define constants in PHP?
Yes
Yes
No
Is it possible to bypass a deprecation message triggered by the use of a deprecated option?
Yes
Only when running tests
Yes
No
Could extracted variables be prefixed when using extract?
Yes
No
Yes
Could a closure be defined as a service reference using ContainerConfigurator?
Yes
No
Yes
Is it possible to define environment variables only for the prod environment?
Yes
Yes
No
Should a response using the 511 status code contains a link to a resource that allows the client to authenticate itself?
Yes
Yes
No
Is the following code valid?
Yes
Yes
No
Is it possible to limit the amount of time a process takes to complete?
Yes
Yes
No
Could the FlashBag messages be retrieving while being removed from the bag?
Yes
No
Yes
Should a parent service be declared as abstract if no class is set in its service definition?
Yes
No
Yes
Could you emulate chunked responses and/or timeouts in mocked responses?
Yes
Yes
No
Should a resource marked as immutable be validated again when considered stale?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
Could an exception be thrown in case of a missing asset?
Yes
Yes
No
Could the non-called listeners be retrieved per event when using the TraceableEventDispatcher?
Yes
No
Yes
Is there any way to check if the Finder contains any results?
Yes
Yes
No
Will the following autowiring declaration work?
Yes
No
Yes
Could the constraints of a class be listed?
Yes
No
Yes
Is the following code valid when registering a synthetic service?
Yes
Yes
No
In the Authenticator-Based Security, Is it possible to create a custom entry_point ?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
Is the following code valid?
Yes
Yes
No
Could the Cursor be hidden?
Yes
No
Yes
Could the AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER header directive be used on sub-requests?
Yes
Yes
No
Could the session.flash_bag service be used?
Yes
Yes
No
Could the listeners be debugged per firewall?
Yes
Yes
No
When configuring the main firewall of an application, could its check_path route be covered by another firewall ?
Yes
No
Yes
Can this form (with default configuration) be submitted ?
Yes
No
Yes
Could the priority of a decorating service be defined?
Yes
Yes
No
Could HttpKernelRunner handle terminable kernel?
Yes
Yes
No
Can an Email instance be serialized?
Yes
Yes
No
Is it possible to specify the serialization context in an attribute/annotation?
Yes
No
Yes
Could the ConsoleApplicationRunner be executed without setting an environment?
Yes
Yes
No
Could an Expression be configured using ContainerConfigurator?
Yes
Yes
No
Could values be mapped to fields using callbacks?
Yes
Yes
No
Given the context where the container build time must be configured, is the following code valid?
Yes
Yes
No
Could the parser cache be changed?
Yes
Yes
No
Is it possible to have more than one firewall in your application?
Yes
Yes
No
Could the If-Match etag be transformed to a weak one?
Yes
No
Yes
Could templates be configured to exclusively use yield instead of echo?
Yes
Yes
No
Could the current token be retrieved from Symfony\Component\Security\Core\Security?
Yes
Yes
No
Could normalizers / denormalizers be cached to improve performances?
Yes
Yes
No
Is the following code valid?
Yes
Yes
No
Can PHP sessions work without cookies?
Yes
Yes
No
Could the AST be dumped?
Yes
No
Yes
is the following code valid :
Yes
Yes
No
When using format_datetime(), could the calendar be changed?
Yes
No
Yes
Is it possible to define default values that depend on another option?
Yes
Yes
No
Is it possible to create a service that is not publicly accessible?
Yes
No
Yes
https://symfony.com/doc/2.8/service_container/alias_private.html#marking-services-as-public-private
Could a resource be stored only if the cache understand the requirements to store the response?
Yes
Yes
No
Can you configure multiple transports to ensure that emails are sent even if one mailer server fails?
Yes
Yes
No
Could the called listeners be retrieved per event when using the TraceableEventDispatcher?
Yes
No
Yes
Is setting the choice_loader to null required when overriding the choices of LanguageType?
Yes
No
Yes
Is the following code valid?
Yes
No
Yes
Given the context where a single request is stored in the RequestStack, could the current request be removed from the request stack?
Yes
Yes
No
https://github.com/symfony/symfony/blob/2.4/src/Symfony/Component/HttpFoundation/RequestStack.php
It is possible to specify a default value for an attribute in a route?
Yes
No
Yes
Could multiple use be used in a single template?
Yes
Yes
No
Could the output be cleaned using the Cursor?
Yes
No
Yes
Could you prevent a command from running multiple times on a single server?
Yes
Yes
No
Is it possible to display the value of a constant of a PHP class in a Twig template ?
Yes
No
Yes
Is Message considered as a high-level API?
Yes
Yes
No
Could an IP address be anonymized?
Yes
Yes
No
Is it possible to configure multiple environments in a single file?
Yes
Yes
No
Could a class be removed from the list of preloaded classes by PHP?
Yes
Yes
No
Does Monolog implement the PSR-3 interface?
Yes
Yes
No
Given the context where FooService is defined as a service, is the following code valid?
Yes
No
Yes
Will the following snippet throw an InvalidArgumentException ?
Yes
Yes
No
Could a service be defined as parent even if the children service does not extends the parent class?
Yes
No
Yes
Is the following code valid?
Yes
Yes
No
When using mirror(...), could files instead of links be mirrored on Windows?
Yes
Yes
No
Could a generator contains a return statement?
Yes
Yes, but empty only
Yes
No
Could services be tagged as always required when bootstrapping the container?
Yes
Yes
No
Could the FlashBag messages be retrieved without being removed from the bag?
Yes
No
Yes
Is the following configuration valid with this definition ?
Yes
No
Yes
When using mirror(...), could existing files be overridden?
Yes
Yes
No
Is it possible to override the error handler used?
Yes
Yes
No
Could enumerations be used to display a list of choices?
Yes
No
Yes
Are console events dispatched when testing commands using CommandTester?
Yes
No
Yes
Is the BC promise guaranteed when adding a new property to a custom class that extends a Symfony class ?
Yes
Yes
No
Given a response using the 308 status code and containing a Location header, must the client use the header URI for automatic redirection?
Yes
No
Yes
MAY use the Location field value for automatic redirection, using it is not a requirement.Given the context where the doctrine transport is used, could all the handlers be wrapped in a single transaction?
Yes
Yes
No
Could an email be encrypted?
Yes
Yes
No
Could array_map be applied to multiple arrays at the same time?
Yes
Yes
No
Can you inject a dependency to a service without passing it to the constructor?
Yes
Yes
No
Could the amount of requests proceed by MockHttpClient be accessed?
Yes
Yes
No
Can fields be sorted using a priority?
Yes
No
Yes
5.3, the priority option can be used to sort fields.Does a Symfony\Component\Form\Exception\TransformationFailedException thrown in a DataTransformer::reverseTransform cause a validation error ?
Yes
No
Yes
Can interfaces inherit from other interfaces in PHP?
Yes
No
Yes
Is the following code valid?
Yes
No
Yes
Are console events dispatched when testing commands using ApplicationTester?
Yes
No
Yes
Is it possible to toggle the debug of Symfony applications when using SymfonyRuntime or GenericRuntime?
Yes
Yes
No
Could the longest common base path between multiple files be found?
Yes
No
Yes
Given the case where the opcache/APC cache for template need to be invalidated, is the following code valid?
Yes
Yes
No
Could aliases of services be defined via a value of container parameter?
Yes
No
Yes
Can an interface extend another interface?
Yes
Yes
No
Is the following code valid?
Yes
Yes
No
Could a priority be set when adding a new Route via RouteCollection::add()?
Yes
Yes
No
https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Routing/RouteCollection.php#L85
Is the following code valid?
Yes
Yes
No
Sequentially attribute has been introduced in 5.4, keep in mind that nested attributes requires PHP 8.1 or higherCould the If-Match header be used with a PUT request?
Yes
No
Yes
Is the following exception class valid ?
Yes
No
Yes
Could the usage of __set() method be disabled?
Yes
Yes
No
Is the following code valid?
Yes
No
Yes
Is the following routing configuration valid ?
Yes
No
Yes
Could the files that match .gitignore patterns be ignored?
Yes
Yes
No
Does the 308 status code allow to change the request method?
Yes
Yes
No
Is Symfony\Component\Form\Form::isValid() the method responsible for validating its data?
Yes
No
Yes
ValidationListener actually do the job
Can a custom type guesser be created?
Yes
Yes
No
It is possible to change the class of a service using the ContainerBuilder?
Yes
No
Yes
Is the following code valid ?
Yes
Yes
No
Will the following snippet throw an InvalidArgumentException ?
Yes
No
Yes
Given the context where an application runs under the prod environment and an external library that use getenv() to access environment variables, is it possible to force DotEnv to use putenv() instead of defining environment variables at the machine level?
Yes
Yes
No
Could an application be executing without return something (aka void)?
Yes
Yes
No
Could the fact that a class is available and will remain available in the --no-dev mode of Composer be obtained when using ContainerBuilder?
Yes
No
Yes
Is the following code valid?
Yes
No
Yes
Can the Request object be modified during its handling ?
Yes
No
Yes
Is it possible to make the same listener object listen to multiple events?
Yes
Yes
No
Could a new parameter be set into a ContainerBag?
Yes
No
Yes
In PHP 7, can a generator contain a return statement ?
Yes
No
Yes, but empty only
Yes
Is this firewall valid ?
Yes
Yes
No
Is it possible to write in a file while locking it?
Yes
No
Yes
Could a response be marked as safe?
Yes
No
Yes
https://github.com/symfony/symfony/blob/5.1/src/Symfony/Component/HttpFoundation/Response.php#L1242
Is there any required header in a request to an origin server or gateway for almost every request ?
Yes
No
Yes
Could a ConstraintViolationList be created from a single violation message?
Yes
No
Yes
Are service ids considered as case-sensitive?
Yes
No
Yes
Could enumerations be dumped?
Yes
Yes
No
Could the build directory be overridden?
Yes
No
Yes
Could null values be skipped?
Yes
Yes
No
Could an event be dispatched without creating a custom event class?
Yes
Yes
No
Is the translation activated by default?
Yes
Yes
No
Are Data Transformers applied on a form field which has the inherit_data option set ?
Yes
No
Yes
Let's assume, we have a private service my_private_service.
Will it work?
Yes
No
Yes
Could listeners be removed from an ImmutableEventDispatcher?
Yes
No
Yes
Regarding the following code, will the calls directive of service_parent be overridden by the one from service_child ?
Yes
No
Yes
Could arguments be resolved in a controller not tagged with the controller.service_arguments tag?
Yes
No
Yes
Does PHP provide an extension to work with Zip files by default?
Yes
No
Yes
Could a new Address be created using Address::fromString()?
Yes
No
Yes
Which of the following is a correct YAML group definition?
According to the official Symfony Best Practices Guide, which format do you need to use for your translation files?
XLIFF
CSV
YAML
XLIFF
JSON
https://symfony.com/doc/current/best_practices.html#use-the-xliff-format-for-your-translation-files
What will be the value of $firstName?
Wouter
Wouter
Ryan
How can you disable the validation in a form?
With the validation_groups option set to false
By not calling isValid()
With the validation_groups option set to false
By calling isValid(false)
With the no_validation option set to true
How can you get the value of the current configuration directives (php.ini) of a PHP extension?
With the reflection API
With ini_get_all()
With get_loaded_extensions()
With php://config stream
With the reflection API
With ini_get_all()
With the $GLOBALS array
How can you retrieve a result generated by a handler ?
With a stamp
With a stamp
With the handler.registry service
It's not possible due to the asyncronous behavior of the messenger component
What triggers the form processing in controllers ?
With $form->process().
With $form->isSubmitted().
With $form->process().
With $form->isValid().
With $form->handleRequest().
What is the third argument of the handle method of Symfony\Component\HttpKernel\HttpKernelInterface?
Whether to catch exceptions or not.
The name of the environment
A Request instance
Whether to catch exceptions or not.
The type of the request
Whether to activate the debug or not
Which sentences are true about compiler pass registration ?
When a compiler pass is registered, you can chose the step where it will be executed. 5 steps are available
Compiler pass can be registered in the build method of the Kernel
Compiler pass are automatically registered if they implement CompilerPassInterface and autoconfigure is set to true
Compiler pass can be registered in the build method of the Kernel
When a compiler pass is registered, you can chose the step where it will be executed. 6 steps are available
Compiler pass are automatically registered if they implement CompilerPassInterface and autoconfigure is set to true
When a compiler pass is registered, you can chose the step where it will be executed. 4 steps are available
When a compiler pass is registered, you can chose the step where it will be executed. 5 steps are available
Which of the followings are valid usage of the Vary header?
Vary: User-Agent
Vary: *
Vary: Accept-Encoding
Vary: Cookie
Vary: User-Agent
Vary: *
Vary: Referer
What does the Luhn constraint do?
Validates a card number
Validates a card number
Validates an ISBN number
It doesn't exist
Validates an IBAN number
How would you use the SHA-512 hash algorithm in PHP?
Using the sha512() function
Using the hash() function
Using the crypt() function
Using the sha512() function
Using the hash() function
How can you validate an object but only against a subset of the constraints ?
Using the method validate partial() instead of validate(), as it accepts a list of constraints.
Using the method validate partial() instead of validate(), as it accepts a list of constraints.
Using roles.
Using validation groups.
It is not possible to partially validate an object.
Given the full Symfony framework is installed, how to create a new controller ?
Using the make:controller command
Manually creating a class in the Controller folder
Using the make-controller command
Using the make:controller command
Manually creating a class in the Controller folder
Using the create:controller command
Using the create-controller command
How could be defined the autocompletion suggestions of a command?
Using the complete method
Using the complete method
Using the autocomplete method
It's not possible
Using the suggest method
How one can detect that a given Symfony\Component\Form\Extension\Core\Type\SubmitType form type has been clicked ?
Using the clicked method of the given submit button.
Using the isClicked method of the given submit button.
Using the clicked method of the given parent form.
Using the clicked method of the given submit button.
Using the isClicked method of the parent form.
Identify the best approach to compare two variables in a binary-safe fashion
Using strcmp()
Using === operator
Using === operator
Using == operator
Using strstr()
Using strcmp()
Using str_sompare()
How can we define the status code of MockResponse?
Using status_code option
It's not possible
Using status_code option
Using http_code option
Which of these headers don't belong to the Response ?
User-Agent
Referer
User-Agent
Proxy-Authenticate
Referer
WWW-Authenticate
How does the browser communicate to the server what is the preferred language of the user?
User language preferences are sent using the Accept-Language header
User language preferences are sent using the Accept-Language header
The main language is sent using the Locale header, while secondary languages are usually included in the X-Locale-Alternate header.
The browser doesn’t communicate the language of the user, it’s inferred from the user IP.
The main language is included in the User-Agent header
What is the purpose of the multipart/related MIME message part?
Used to indicate that each message part is a component of an aggregate whole. The most common usage is to display images embedded in the message contents
Used to send different content types in the same message, such as when attaching files
Used when two or more parts are alternatives of the same (or very similar) content. The preferred format must be added last
Used to indicate that each message part is a component of an aggregate whole. The most common usage is to display images embedded in the message contents
What is the purpose of the multipart/alternative MIME message part?
Used to indicate that each message part is a component of an aggregate whole. The most common usage is to display images embedded in the message contents
Used to indicate that each message part is a component of an aggregate whole. The most common usage is to display images embedded in the message contents
Used when two or more parts are alternatives of the same (or very similar) content. The preferred format must be added last
Used to send different content types in the same message, such as when attaching files
According to the official Symfony Best Practices Guide, what is the recommended way to use URLs in a functional test?
Use the URL generator
Hardcode the URLs
Do not use URLs in a functional test
Use the URL generator
What solution can you use to ask the user to type his password twice in a form ?
Use the RepeatedType form type.
Use the ask_confirmation option on the PasswordType form type.
Use the Validation plugin of jQuery.
Call the render_widget twig function twice on the password form type.
Use the RepeatedType form type.
According to the official Symfony Best Practices Guide, which method do you need to use in order to protect broad URL patterns?
Use the @Security annotation
Use access_control in the security configuration
Use the security.authorization_checker service
Use the @Security annotation
If you're using an API and after being authenticated you don't want the session to be kept for the next requests; you have to:
Use stateless: true at firewall level
Use session: false at firewall level
Use session: false at authentication provider level
Use stateless: true at firewall level
Use stateless: true at authentication provider level
Simply use json_login authentication provider
When writing CLI scripts, how can you access the standard input/output/error streams?
Use STDIN, STDOUT and STDERR constants
Use stdin(), stdout() and stderr() functions
Use php::STDIN, php::STDOUT, php::STDERR class constants
Use STDIN, STDOUT and STDERR constants
use FD_0, FD_1 and FD_2 constants
How to configure the HTTP Client provided by the Symfony HttpClient component to save a Cookie between requests?
Use $client->setCookie(new Cookie(...))
Use $client->setCookie(new Cookie(...))
The HTTP Client provided by the Symfony HttpClient component does not handle cookies.
Use $client->getCookieJar()->set(new Cookie(...))
Use $client->cookies->set(new Cookie(...))
Consider the following code snippet:
What will be the outcome of evaluating this Twig code?
Twig will raise a Twig_Error_Syntax exception.
The output will display the string Foo is FOO and Bar is ..
The output will display the string Foo is and Bar is ..
The output will display the string Foo is FOO and Bar is FOO..
Twig will raise a Twig_Error_Syntax exception.
Consider the following Twig code snippet:
What will be the result of evaluating this Twig template?
Twig will raise a Twig_Error_Syntax exception preventing the template from being evaluated.
The template is successfully evaluated and the string My name is Amanda will be displayed in the web browser.
Twig will raise a Twig_Error_Syntax exception preventing the template from being evaluated.
Consider the following Twig code snippet:
What will be the result of evaluating this template without passing it a color variable when the strict_variables global setting is on?
Twig will raise a Twig_Error_Runtime exception preventing the template from being evaluated.
The template will be partially evaluated and the string The will be displayed in the web browser.
The template will be succesfully evaluated and the string The car! will be displayed in the web browser.
Twig will raise a Twig_Error_Runtime exception preventing the template from being evaluated.
The template will be succesfully evaluated and the string The empty car! will be displayed in the web browser.
By default, registered services are private?
True
False
True
https://github.com/symfony/symfony/blob/4.0/src/Symfony/Component/DependencyInjection/Definition.php
To strictly follow the best practices for reusable bundles, the file that contains
the basic description of the bundle should be named README.md.
True
False
True
To follow the best practices for reusable bundles, the file that contains
the basic description of the bundle must be named README.md:
True
False
True
Authentication is the process that makes sure that a user is who he claims to be?
True
False
True
HttpClient provide a MockResponse class because you can't create your own mock of ResponseInterface to test it
True
True
False
HTTP PURGE method was added to http/1.1 to allow to mark pages cached by proxies as stales.
True
False
True
Which types of argument accepts the Symfony\Component\Process\InputStream\write() method?
Traversable objects
Boolean
Scalars
Boolean
Stream resources
Scalars
Traversable objects
Arrays
Which token is used by the Lexer to find the end of a template?
Token::EOF_TYPE
Token::END_OF_FILE
Token::EOF
Token::END_OF_FILE_TYPE
Token::EOF_TYPE
What does the waitUntil method allow you to do?
To wait for a condition to be verified before killing the running async process
To wait for a certain amount of time before killing the running async process
To wait for a condition to be verified before continuing the main script execution
To wait for a condition to be verified before killing the running async process
What is the goal of calling disallowMockingUnknownTypes() when creating a stub or mock?
To throw an Exception if the class or the interface does not exist.
To throw an Exception if the interface does not exist.
To throw an Exception if the class does not exist.
To throw an Exception if the class or the interface does not exist.
To throw an Exception if the class is not a native PHP class.
What is the aim of the prepare() method in Symfony\Component\HttpFoundation\Response?
To send the Response to the client.
To tweak the Response to ensure that it is compliant with RFC 2616.
To convert the Response to a string that is compatible with the HTTP response message format.
To send the Response to the client.
What is the use of the default_protocol option of the Symfony\Component\Form\Extension\Core\Type\UrlType form type ?
To force the submitted value to begin with a given URI scheme (eg. http://).
To prepend the submitted value with an URI scheme (eg. http://) if it does not begin with one.
To render the input with the placeholder property containing the value of the option.
To force the submitted value to begin with a given URI scheme (eg. http://).
What is the purpose of Autoconfiguration in Symfony ?
To automatically configure services based on their class, attributes or interface.
To automatically configure services based on their class, attributes or interface.
To automatically decorate services based on their class, attributes or interface.
To automatically register services based on their class, attributes or interface.
Consider the following PHP code snippet:
What will be the outcome of running this code with PHP 5.4 or greater?
This snippet displays the string Yo World! on the standard output.
PHP will raise a Fatal Error preventing the private hello() method from being overriden in the YoGreater class.
This snippet displays the string Yo World! on the standard output.
This snippet displays the string Hello World! on the standard output.
Which of the following are not true about streams ?
They are always seekable.
They can be applied to any data source.
They are always bi-directional.
They can be filtered.
They can be applied to any data source.
They are always bi-directional.
They are always seekable.
When used properly, they significantly reduce memory consumption.
Which of the following statements are true about the so-called compiler passes?
They allow to add, alter or remove any services definitions of a ContainerBuilder object.
They prevent the ContainerBuilder object from being compiled if they detect any circular references in services definitions.
They perform some optimization operations on a ContainerBuilder instance in order to generate the most efficient PHP code possible.
They check that all registered services definitions are valid and some required global parameters are not missing.
They are always triggered on every HTTP requests made to the Symfony application.
They allow to add, alter or remove any services definitions of a ContainerBuilder object.
They prevent the ContainerBuilder object from being compiled if they detect any circular references in services definitions.
They are always triggered on every HTTP requests made to the Symfony application.
They perform some optimization operations on a ContainerBuilder instance in order to generate the most efficient PHP code possible.
They check that all registered services definitions are valid and some required global parameters are not missing.
Which of the following statements are true about the so-called compiler passes?
They allow to add, alter or remove any services definitions of a ContainerBuilder object.
They prevent the ContainerBuilder object from being compiled if they detect any circular references in services definitions.
They perform some optimization operations on a ContainerBuilder instance in order to generate the most efficient PHP code possible.
They prevent the ContainerBuilder object from being compiled if they detect any circular references in services definitions.
They check that all registered services definitions are valid and some required global parameters are not missing.
They perform some optimization operations on a ContainerBuilder instance in order to generate the most efficient PHP code possible.
They allow to add, alter or remove any services definitions of a ContainerBuilder object.
They are always triggered on every HTTP requests made to the Symfony application.
Which of the following statements are true about the so-called compiler passes?
They allow to add, alter or remove any services definitions of a ContainerBuilder object.
They perform some optimization operations on a ContainerBuilder instance in order to generate the most efficient PHP code possible.
They check that all registered services definitions are valid and some required global parameters are not missing.
They perform some optimization operations on a ContainerBuilder instance in order to generate the most efficient PHP code possible.
They are always triggered on every HTTP requests made to the Symfony application.
They prevent the ContainerBuilder object from being compiled if they detect any circular references in services definitions.
They allow to add, alter or remove any services definitions of a ContainerBuilder object.
They check that all registered services definitions are valid and some required global parameters are not missing.
Consider the following code snippet:
How to retrieve the book title from $book?
There's no way yet.
$book->title
There's no way yet.
$book.title
$book=>title
Consider the following code snippet:
Which of the following statements is a valid replacement for the ???? in the above code snippet to execute successfully?
There is nothing to do! The $first, $last and $phone variables will become automatically defined if the SQL query execution was succesful.
A while loop fetching the row and assigning $first, $last and $phone their proper values.
There is nothing to do! The $first, $last and $phone variables will become automatically defined if the SQL query execution was succesful.
What will be the result of the following code?
The value of $age will be null.
The value of $age will be null.
The value of $age will be 0.
A Symfony\Component\PropertyAccess\Exception\NoSuchIndexException will be thrown.
A Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException will be thrown.
What are the particularities of the InMemoryUserProvider security provider?
The users are not stored in database.
The users must have a plaintext password.
The users must have a plaintext password.
The users are not stored in database.
You need to add new user in the config.
The users have the same password.
Consider the following Twig code snippet:
What will be the result of evaluating this template when passing it the blue value for the color variable and when the strict_variables global setting is off?
The template will be succesfully evaluated and the string The blue car! will be displayed in the web browser.
Twig will raise a Twig_Error_Runtime exception preventing the template from being evaluated.
The template will be succesfully evaluated and the string The blue car! will be displayed in the web browser.
Consider the following Twig code snippet:
What will be the result of evaluating this template without passing it a color variable when the strict_variables global setting is off?
The template will be succesfully evaluated and the string The car! will be displayed in the web browser.
The template will be succesfully evaluated and the string The empty car! will be displayed in the web browser.
The template will be succesfully evaluated and the string The car! will be displayed in the web browser.
Twig will raise a Twig_Error_Runtime exception preventing the template from being evaluated.
The template will be partially evaluated and the string The will be displayed in the web browser.
Given the following console table creation:
What will happen ?
The table will have two rows with two values each
An exception will be thrown
The table will have only one row with two values
The table will have two rows with two values each
Given the following console table creation:
What will happen ?
The table will have only one row with two values
The table will have only one row with two values
The table will have two rows with two values each
An exception will be thrown
Which information is used to store a response that uses the must-understand directive?
The status code
The status code
The value of the Etag directive
The value of the Expires directive
The value of the Last-Modified directive
When configuring tags with priority, what service will come first when getting tagged items ?
The service with the highest priority.
The service with the highest priority.
The service with the priority closest to 0.
The service with the lowest priority.
What is normalization in the context of the Serializer Components ?
The process of converting an object into a string.
The process of converting an object into a string.
The process of converting a string into an object.
The process of converting an array of scalars into an object.
The process of converting an object into an array of scalars.
When declaring a route in PHP, what is the 1st argument of the constructor of the Route class?
The path pattern to match.
The path pattern to match.
An array of options.
A condition that should evaluate to true for the route to match.
A required URI scheme or an array of restricted schemes.
The host pattern to match.
The required HTTP methods.
An array of requirements for parameters (regexes).
An array of default parameter values.
What is the first argument of the Symfony\Component\Config\FileLocator::locate method?
The name of the file to look for.
The type of file to look for.
The name of the directory to look for.
The name of the configuration value to look for.
The name of the file to look for.
What is the first argument of the constructor of Symfony\Component\Translation\Translator
The locale
A translator provider
The translation directory
A translator loader
The locale
When writing a Twig_Test, what is a node_class for?
The given test will be compiled into PHP primitives.
The given test will rely on a custom Twig_NodeVisitorInterface.
The given test will use a semantic validation in addition to the basic evaluation.
The node_class is a mandatory option to get defined in a Twig_Environment.
The given test will be compiled into PHP primitives.
What is true about the PSR-0: Autoloading Standard?
The fully qualified class name MUST have one or more sub-namespace names.
PSR-0 is compatible with PEAR-style classnames.
The autoloader is registered with the spl_autoload_register() function.
PSR-0 is deprecated.
PSR-0 is compatible with PEAR-style classnames.
The autoloader is registered with the spl_autoload_register() function.
The fully qualified class name MUST have one or more sub-namespace names.
The fully qualified class name MAY have one or more sub-namespace names.
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
What is returned by the run() method of Symfony\Component\Process\Process?
The exit status code
The exit status code
Nothing
1
true or false
What are the arguments of the Symfony\Component\HttpKernel\Kernel constructor?
The environment name of the application.
Whether to enable debugging or not.
Whether to enable caching or not.
The environment name of the application.
Whether to enable debugging or not.
The name of the application.
Whether to enable logging or not.
Given the context where a command define three questions to ask and the following command test case is created to test it:
Which values will be received as answers to the command interactive questions ?
The command will receive foo as answer to its first question and bar as answer to its second question
The command will receive one as answer to its first question and bar as answer to its second question
An exception will be thrown
The command will receive foo as answer to its first question and bar as answer to its second question
Given the following console event subscriber:
What can be said about the setCode command method ?
The code above will result to an error
This method doesn't exist
The code above will result to an error
The code above will change the command exit status code to 232
https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Console/Command/Command.php#L252
We assume using a filter in a template with:
with the filter definition:
How the arguments will be passed to the callable ?
The callable function will be called with the given parameters respectively:
('a', 'b', 'foo')
The callable function will be called with the given parameters respectively:
('foo', ['a', 'b'])
The callable function will be called with the given parameters respectively:
('foo', ['patterns' => ['a', 'b']])
The callable function will be called with the given parameters respectively:
('foo', 'a', 'b')
The callable function will be called with the given parameters respectively:
('a', 'b', 'foo')
Which of the following Twig internal objects is responsible for converting a tokens stream into a meaningful tree of nodes (aka AST or Abstract Syntax Tree)?
The Parser
The Compiler
The Parser
The Lexer
The Environment
Which of the following Twig internal objects is responsible for transforming an AST (Abstract Syntax Tree) into PHP code?
The Parser
The Environment
The Lexer
The Parser
The Compiler
The Compiler is used to transform a Node into a valid PHP class, but which class actually call the compiler?
The Node
The Node
The Lexer
The Compiler
The Environment
The Compiler is used to transform a Node into a valid PHP class, but which class actually calls the compiler?
The Node
The Compiler
The Node
The Environment
The Lexer
Which of the following Twig internal objects is responsible for tokenizing the template source code into smaller pieces for easier processing?
The Lexer
The Environment
The Lexer
The Compiler
The Parser
Which of the following Twig internal objects is responsible for transforming an AST (Abstract Syntax Tree) into PHP code?
The Lexer
The Parser
The Environment
The Lexer
The Compiler
In a Symfony application, what is the element that links the core components together ?
The FrameworkBundle.
The FrameworkBundle.
The Container.
The Kernel.
Which statement is true about FlashBag::add() and FlashBag::set()?
The FlashBag::add() method allow to add a single message while FlashBag::set() allow to add a set of messages while overriding the existing ones
The FlashBag::add() method allow to add a set of messages while FlashBag::set() allow to add a single message
They behave the same way
The FlashBag::add() method allow to add a single message while FlashBag::set() allow to add a set of messages while overriding the existing ones
The FlashBag::add() method allow to add a single message while FlashBag::set() allow to add a set of message using a callback
Consider the following code snippet:
What will be the expected outcome when running this piece of code?
The $result variable will contain a valid implementation of the Symfony\Component\Validator\ConstraintViolationListInterface interface.
The $result variable will contain a simple boolean value (true or false).
The validate method will throw a Symfony\Component\Validator\Exception\ValidatorException exception if the given object's state doesn't match its mapped validation constraint rules.
The $result variable will contain a valid implementation of the Symfony\Component\Validator\ConstraintViolationListInterface interface.
The $result variable will contain an array of Symfony\Component\Validator\ConstraintViolation instances.
The $result variable will contain null because the validate method must always return void.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/ConstraintViolationList.php https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Validator/ValidatorInterface.php
Which mechanism allows to aggregate services by domain in the service container?
Tag
Scope
Abstraction
Tag
Listener
Which interface must be implemented to configure a service locator?
Symfony\Contracts\Service\ServiceSubscriberInterface
Symfony\Components\DependencyInjection\ServiceSubscriberInterface
Symfony\Contracts\DependencyInjection\ServiceLocatorSubscriberInterface
Symfony\Contracts\Service\ServiceSubscriberInterface
Symfony\Contracts\DependencyInjection\ServiceSubscriberInterface
What is the method to transform a PHP array into a YAML representation?
Symfony\Component\Yaml\Yaml::write
Symfony\Component\Yaml\Yaml::write
Symfony\Component\Yaml\Yaml::dump
Symfony\Component\Yaml\Yaml::yaml
Symfony\Component\Yaml\Yaml::toYaml
What is the exception class used when an error occurs during parsing with Symfony\Component\Yaml\Yaml::parse method?
Symfony\Component\Yaml\Exception\ParseException
Symfony\Component\Yaml\Exception\ParsingException
Symfony\Component\Yaml\ParsingException
Symfony\Component\Yaml\Exception\ParseException
Symfony\Component\Yaml\ParseException
What is the return type of the Symfony\Component\Validator\Validator\ValidatorInterface::validate method?
Symfony\Component\Validator\ConstraintViolationListInterface
array<string>
array<Symfony\Component\Validator\ConstraintViolationInterface>
Doctrine\Common\Collections\Collection<Symfony\Component\Validator\ConstraintViolationInterface>
Symfony\Component\Validator\ConstraintViolationListInterface
What is the listener that handles security exceptions and when appropriate, helps the user to authenticate?
Symfony\Component\Security\Http\Firewall\ExceptionListener
Symfony\Component\Security\Http\Firewall\SecurityListener
Symfony\Component\Security\Http\Firewall\AuthenticationListener
Symfony\Component\Security\Http\Firewall\AuthListener
Symfony\Component\Security\Http\Firewall\ExceptionListener
By default, which function provides the choices of the Symfony\Component\Form\Extension\Core\Type\LanguageType form type?
Symfony\Component\Intl\Languages::getNames()
Symfony\Component\Intl\Languages::getNames()
Symfony\Component\Intl\Intl::getLanguageBundle()->getLanguageNames()
Symfony\Component\Form\Extension\Core\Type\LanguageType::getChoices()
Intl::getLanguages()
How to get the kernel version?
It's not possible
What is the base class for events thrown in the HttpKernel component.
Symfony\Component\HttpKernel\Event\KernelEvent
Symfony\Component\HttpKernel\Event\HttpKernelEvent
Symfony\Component\HttpKernel\HttpKernelEvent
Symfony\Component\HttpKernel\BaseKernelEvent
Symfony\Component\HttpKernel\KernelEvent
Symfony\Component\HttpKernel\Event\BaseKernelEvent
Symfony\Component\HttpKernel\Event\KernelEvent
Which classes exist to help you test some code that is using a Symfony\Component\HttpFoundation\Session\Session object?
Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockSessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockMemorySessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockDatabaseSessionStorage
Symfony\Component\HttpFoundation\Session\Storage\MockSessionStorage
In which namespace does the Request object live ?
Symfony\Component\HttpFoundation
Symfony\Component\HttpClient
Symfony\Component\HttpFoundation
\ (built in class)
Symfony\Component\HttpKernel
Which of these form types does not inherit from the Symfony\Component\Form\Extension\Core\Type\TextType type ?
Symfony\Component\Form\Extension\Core\Type\PasswordType
Symfony\Component\Form\Extension\Core\Type\LocaleType
Symfony\Component\Form\Extension\Core\Type\HiddenType
Symfony\Component\Form\Extension\Core\Type\RangeType
Symfony\Component\Form\Extension\Core\Type\SearchType
Symfony\Component\Form\Extension\Core\Type\HiddenType
Symfony\Component\Form\Extension\Core\Type\PasswordType
Symfony\Component\Form\Extension\Core\Type\RangeType
Symfony\Component\Form\Extension\Core\Type\LocaleType
Symfony\Component\Form\Extension\Core\Type\SearchType
Which of the following form types is the parent of the Symfony\Component\Form\Extension\Core\Type\BirthdayType form type ?
Symfony\Component\Form\Extension\Core\Type\DateType
Symfony\Component\Form\Extension\Core\Type\DateTimeType
Symfony\Component\Form\Extension\Core\Type\TimeType
Symfony\Component\Form\Extension\Core\Type\DateType
Which interface should be implemented when you want to set the choice_loader option of the Symfony\Component\Form\Extension\Core\Type\ChoiceType form type ?
Symfony\Component\Form\Extension\Core\ChoiceLoaderInterface
Symfony\Component\Form\ChoiceLoaderInterface
Symfony\Component\Form\Extension\Core\ChoiceLoaderInterface
Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface
Which Tester class should you use to test a console event (e.g. the ConsoleEvents::TERMINATE event)?
Symfony\Component\Console\Tester\CommandTester
Symfony\Component\Console\Tester\ApplicationTester
Symfony\Component\Console\Tester\CommandTester
Symfony\Component\Console\Tester\CommandCompletionTester
Given the following definition:
What is the foo option's mode?
Symfony\Component\Console\Input\InputOption::VALUE_OPTIONAL
Symfony\Component\Console\Input\InputOption::VALUE_IS_ARRAY
Symfony\Component\Console\Input\InputOption::VALUE_OPTIONAL
Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED
Symfony\Component\Console\Input\InputOption::VALUE_NEGATABLE
Symfony\Component\Console\Input\InputOption::VALUE_NONE
Which of the following constants exist?
Symfony\Component\Console\Input\InputOption::VALUE_NONE
Symfony\Component\Console\Input\InputOption::VALUE_OPTIONAL
Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED
Symfony\Component\Console\Input\InputOption::VALUE_IS_ARRAY
Symfony\Component\Console\Input\InputOption::VALUE_NEGATABLE
Symfony\Component\Console\Input\InputOption::VALUE_NONE
Symfony\Component\Console\Input\InputOption::VALUE_IS_ARRAY
Symfony\Component\Console\Input\InputOption::VALUE_NEGATABLE
Symfony\Component\Console\Input\InputOption::VALUE_OPTIONAL
Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED
https://github.com/symfony/console/blob/6.0/Input/InputOption.php https://symfony.com/doc/6.0/console/input.html#using-command-options
Which of the following constants do not exist?
Symfony\Component\Console\Input\InputArgument::IS_ARRAY
Symfony\Component\Console\Input\InputArgument::REQUIRED
Symfony\Component\Console\Input\InputArgument::OPTIONAL
Symfony\Component\Console\Input\InputArgument::REQUIRED
Symfony\Component\Console\Input\InputArgument::NEGATABLE
Symfony\Component\Console\Input\InputArgument::IS_ARRAY
Symfony\Component\Console\Input\InputArgument::NONE
Symfony\Component\Console\Input\InputArgument::OPTIONAL
https://github.com/symfony/console/blob/6.0/Input/InputArgument.php#L24-L26 https://symfony.com/doc/6.0/console/input.html#using-command-arguments
Which of these events are not built-in?
Symfony\Component\Console\ConsoleEvents::TERMINATE
Symfony\Component\Console\ConsoleEvents::COMMAND
Symfony\Component\Console\ConsoleEvents::ERROR
Symfony\Component\Console\ConsoleEvents::HANDLE_COMMAND
Symfony\Component\Console\ConsoleEvents::TERMINATE
Symfony\Component\Console\ConsoleEvents::COMMAND
Symfony\Component\Console\ConsoleEvents::VIEW
Symfony\Component\Console\ConsoleEvents::ERROR
Which of these events are not built-in?
Symfony\Component\Console\ConsoleEvents::ERROR
Symfony\Component\Console\ConsoleEvents::VIEW
Symfony\Component\Console\ConsoleEvents::HANDLE_COMMAND
Symfony\Component\Console\ConsoleEvents::HANDLE_COMMAND
Symfony\Component\Console\ConsoleEvents::TERMINATE
Symfony\Component\Console\ConsoleEvents::VIEW
Symfony\Component\Console\ConsoleEvents::COMMAND
Symfony\Component\Console\ConsoleEvents::ERROR
Which abstraction HTTPClient is interoperable with?
Symfony contracts
HTTPlug v2
HTTPlug v1
PSR-18
HTTPlug v1
HTTPlug v2
PSR-18
Symfony contracts
Which of the following are valid Symfony response classes extending the base Symfony\Component\HttpFoundation\Response class?
StreamedResponse
BinaryFileResponse
RedirectResponse
JsonResponse
ImageFileResponse
StreamedResponse
BinaryResponse
ImageResponse
RedirectedResponse
FileResponse
StreamResponse
JsonResponse
BinaryFileResponse
NotFoundResponse
RedirectResponse
What is the Response structure ?
Status-Line CRLF
Headers CRLF
CRLF
Message-bodyStatus-Line
Headers CRLF
Message-bodyStatus-Line CRLF
Headers CRLF
CRLF
Message-bodyStatus-Line
Headers
Message-bodyStatus-Line
CRLF
Headers
CRLF
Message-bodyWhich of the following operations must occur prior to any output being sent to the client (assuming output buffering is disabled)
Starting a session
Modifying session data
Starting a session
Sending HTTP Headers
Processing GET and POST data
Manipulating Cookie data
What is the way to always get a new instance of a service?
Setting the option shared to false.
Setting the option scope to prototype.
Setting the option shared to false.
Setting the option singleton to false.
Setting the option scope to request.
By passing an instance of the CompilerPass to the pushCompilerPass of a ContainerBuilder.
What are the recommended types of injections when injecting a service dependency into another?
Setter injection
Constructor injection
Property injection
Immutable-setter Injection
Setter injection
Immutable-setter Injection
Property injection
Constructor injection
Getter injection
Which of the following value resolvers are shipped with the HttpKernel component?
SessionValueResolver
RequestValueResolver
UserValueResolver
RequestValueResolver
VariadicValueResolver
DefaultValueResolver
SessionValueResolver
ServiceValueResolver
RequestAttributeValueResolver
UserValueResolver
https://symfony.com/doc/current/controller/argument_value_resolver.html#built-in-value-resolvers
Which exception is thrown when a service is not defined while using ContainerInterface::get()?
ServiceUndefinedException
ServiceGetException
UndefinedServiceException
ServiceUnavailableException
ServiceUndefinedException
ServiceNotFoundException
What does this script do ?
Sends a form to a server
A classical Web request to a server
Display a webpage into an other
Sends a form to a server
Reads the content of a webpage and store in into a file
Which of the followings are not validation constraints?
Search
File
All
File
Search
Password
What are the availables process status constants in the Symfony\Component\Process\Process class ?
STATUS_STARTED
STATUS_READY
STATUS_TERMINATED
STATUS_STARTED
STATUS_READY
STATUS_FAILED
STATUS_TERMINATED
STATUS_SENT
STATUS_STOPPED
STATUS_INITIALIZED
Which protocols secure HTTP?
SSL
TLS
SSL
SMTP
TLS
SSH
Which exception is thrown when a Route defined with /page/{foo}/{foo} cannot be compiled?
RouteCompilationException
LogicException
RouteCompilationException
RuntimeException
InvalidRouteCompilationContextException
InvalidArgumentException
https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/Routing/RouteCompiler.php#L39
Which type is returned by FormRegistry::getType()?
ResolvedFormTypeInterface
ResolvedFormTypeInterface
FormInterface
ResolvedForm
GuessedType
What is the request structure ?
Request-Line CRLF Headers CRLF CRLF Body
Request-Line Headers CRLF Body
Request-Line CRLF Headers CRLF CRLF Body
Request-Line Headers CRLF CRLF Body
Request-Line
Headers
Body
What is the main purpose of the built-in Symfony\Bundle\FrameworkBundle\Controller:TemplateController controller?
Render templates that do not require a controller, such as static pages.
Render templates that do not require a controller, such as static pages.
Render custom error templates.
Extract translation keys/strings from templates.
Provide information about the template being rendered for the profiler.
Which ROLE allows you to impersonate a user?
ROLE_ALLOWED_TO_SWITCH
ROLE_ADMIN_ALLOWED_TO_SWITCH
ROLE_ADMIN
ROLE_ALLOWED_TO_SWITCH
ROLE_USER_ALLOWED_TO_SWITCH
Given the following access_control configuration:
The requested url is http://mydomain.tld/profile. Which role is needed to access to /profile ?
ROLE_ADMIN
Neither ROLE_USER nor ROLE_ADMIN, an exception is thrown
ROLE_ADMIN
ROLE_USER
requires_channel allows to make a redirection, it's not involved in request matching
Which of the following elements can contain validation constraints?
Public properties
Classes
Public getters/issers
Public getters/issers
Public properties
Private and protected getters/issers
Classes
Private and protected properties
Which of the following language structures are allowed in an interface?
Public methods signatures.
Traits imports.
Public concrete methods.
Public constants.
Private (or protected) methods signatures.
Static attributes.
Public constants.
Traits imports.
Public methods signatures.
Private (or protected) constants.
Public concrete methods.
Which of the following language structures are allowed in an interface?
Public methods signatures.
Private (or protected) constants.
Public constants.
Public methods signatures.
Traits imports.
Public constants.
Private (or protected) constants.
Private (or protected) methods signatures.
Static attributes.
Public concrete methods.
Which of the following are supported visibilities for class attributes and methods in PHP ?
Protected
Private
Public
Global
Private
Public
Protected
Friend
How do you call a variable defined at an object level ?
Property
Attribute
ClassVar
Argument
Property
What are the console helpers ?
Process helper
Question helper
Formatter helper
Process helper
Answer helper
Formatter helper
Validator helper
Question helper
Dialog helper
What is the format of the bin/console file?
Plain PHP script
Binary file
Plain PHP script
PHAR file
Self-executable compressed file
What does the 308 HTTP status code stand for?
Permanent redirect
Temporary redirect
Permanent redirect
Found (moved temporarily)
Moved permanently
Which method is used to generate an hashed password?
PasswordHasherInterface::hash
PasswordHasherInterface::new
PasswordHasherInterface::encode
PasswordHasherInterface::hash
PasswordHasherInterface::crypt
Which PSR described a common interface for reading the system clock, implemented by the Clock component since Symfony 6.2?
PSR-20
PSR-20
PSR-8
PSR-4
PSR-17
Which event listeners can the following form have?
POST_SUBMIT
PRE_SUBMIT
SUBMIT
POST_SET_DATA
PRE_SET_DATA
PRE_SUBMIT
PRE_SET_DATA
POST_SUBMIT
SUBMIT
POST_SET_DATA
Which HTTP verbs are safe ?
POST
DELETE
PUT
GET
PATCH
OPTIONS
HEAD
DELETE
COPY
GET
PUT
POST
LINK
PATCH
TRACE
Consider the following HTML generated from a Symfony form:
Which HTTP method will be present in the Symfony Request object assuming HTTP methods overriding setting is turned on?
POST
PATCH
GET
PUT
POST
Since which PHP version can you use anonymous functions ?
PHP 5.3
PHP 5.5
PHP 5.3
PHP 7.0
PHP 5.4
PHP 5.6
Which of these methods aren't mentioned as commonly implemented in the RFC7231 (previously RFC2616 ?
PATCH
LINK
TRACE
LINK
CONNECT
PATCH
What are the console verbosity levels?
If you define an option as deprecated thanks to OptionsResolver::setDeprecated(), when will the deprecation message appear?
Only if the option is provided by the user
When running tests
Only if the option is provided by the user
Always
Which sentences are true about security events ?
On a session-based authentication, the security.authentication.success is dispatched on each page when the user is authenticated
security.authentication.failure is launched when an authentication attempt fails
security.logout_on_change is triggered when the user use the logout feature of the firewall
On a session-based authentication, the security.authentication.success is dispatched on each page when the user is authenticated
When you log in via an http basic header, a security.interactive_login event is triggered
security.authentication.failure is launched when an authentication attempt fails
Which sentences are true about security events?
On a session-based authentication, the security.authentication.success is dispatched on each page when the user is authenticated
security.authentication.failure is launched when an authentication attempt fails
When you log in via an http basic header, a security.interactive_login event is triggered
security.authentication.failure is launched when an authentication attempt fails
On a session-based authentication, the security.authentication.success is dispatched on each page when the user is authenticated
security.logout_on_change is triggered when the user use the logout feature of the firewall
Which of the followings are built-in normalizers?
ObjectNormalizer
DataUriNormalizer
GetSetMethodNormalizer
DateTimeNormalizer
CustomNormalizer
GetSetMethodNormalizer
DateTimeNormalizer
JsonNormalizer
CustomNormalizer
DataUriNormalizer
XmlNormalizer
DateNormalizer
TimeNormalizer
ObjectNormalizer
What is returned by the Symfony\Component\Filesystem\Filesystem::mkdir method if the directory has been successfully created ?
Nothing
true or false
A string with the directory path
The FileSystem object
Nothing
Given an object Foo which implements \Countable and the method count() which return 1, what will be displayed?
Nothing
The value of foo.get('name')
Nothing
What is the output of the following PHP script?
Not found
Not found
2 - string
4 - integer
0 - integer
Which class can be used as argument when listening to kernel.controller_arguments?
None, this event does not exist
FilterControllerEvent
FilterControllerArgumentsEvent
None, this event does not exist
ControllerArgumentsEvent
ControllerEvent
What is the finder service id ?
None of them, the finder is not a service
None of them, the finder is not a service
finder.iterator
finder
finder.finder
The finder is not a service due to its stateful nature
Given that Twig is configured with "strict_variables" set to true.
Consider the following Twig snippet:
Will the Twig template work as expected?
No. The template will display an error because the maxItems variable is not defined outside the with tag.
Yes
No. The template will display an error because the maxItems variable is not defined outside the with tag.
No. The template won't iterate from 1 to 7. It will execute the for loop just one time (where i is 1).
No. The template will display an error because the with tag is not defined.
Twig 1.28 (November 2016) introduced a new with tag that allows to create different scopes in the same template. Variables defined inside a with tag are not available outside of it. See http://twig.symfony.com/doc/tags/with.html
Could an event subscriber be added to a Button
No
No
Yes
Does the following code follow the Twig coding standard?
No
No
Yes
Is the Safe header considered as a secure mechanism?
No
Yes
No
Does the render_esi Twig function throw an exception when the request is not coming from a gateway cache?
No
No
Yes
Could a Route defined with /page/{foo}/{foo} path be compiled?
No
No
Yes
Could a button receive an event listener?
No
Yes
No
Could you use Helper::strlen() to obtain the length of a string?
No
Yes
No
Helper::strlen() method has been removed, consider using Helper::width() or Helper::length() instead.Does the session service still available?
No
Yes
No
session alias has been deprecated, consider using Request::getSession() or RequestStack::getSession() instead.Is this Twig template valid ?
No
No
Yes
Will the following snippet throw an InvalidArgumentException ?
No
No
Yes
Could the safe directive be considered as a reliable indicator that the end user is a child?
No
Yes
No
Given the following header, will the resource be considered as fresh?
No
No
Yes
Is the following code valid?
No
No
Yes
Is the following header value valid?
No
No
Yes
Could a parameter be removed from a FrozenParameterBag?
No
Yes
No
Could a Route defined with /page/{2foo} path be compiled?
No
No
Yes
https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/Routing/RouteCompiler.php#L39
Is it considered as a good practice to store in cache a response using the 511 status code?
No
Yes
No
Will the following snippet throw an InvalidArgumentException?
No
Yes
No
Could subscribers be removed from an ImmutableEventDispatcher?
No
Yes
No
Could a Cookie be created from a string?
No
No
Yes
It is possible to handle anonymous users in a custom voter ?
No
No
Yes
Consider the following simple PHPUnit test:
Will the previous code successfully test the error that will happen? (Note: remember that in most PHP versions, this kind of errors doesn't trigger an exception).
No
No
Yes
By default, PHPUnit converts PHP errors, warnings, and notices that are triggered during the execution of a test to an exception. See https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.errors
Could a service identifier be returned from a ReverseContainer if the service is not tagged as container.reversible and defined as private?
No
Yes
No
Could the session.attribute_bag service be used?
No
No
Yes
Could the build time be configured?
No
Yes
No
Given the context the --no-scripts option is used with composer install and the Composer version set to < 2.1, will the autoload_runtime.php file be generated?
No
Yes
No
Could a response that use the must-understand directive be stored if the cache does not understand the directive?
No
No
Yes
Given the context where the doctrine transport is used, could the connection be pinged and reconnected (if closed) each time a message is handled?
No
No
Yes
Should an immutable cache-control header be used with non-secure protocol such as HTTP?
No
No
Yes
Should extract be used on $_GET, $_FILES and other unsecured data sources?
No
No
Yes
Could a Route defined with /page/{_fragments} path be compiled?
No
No
Yes
https://github.com/symfony/symfony/blob/3.2/src/Symfony/Component/Routing/RouteCompiler.php#L39
Does this syntax perform any check?
No
Yes, if foo is an object then if it's an array
No
Yes if foo is an array
Could a response that use the 301 status code be cached without taking in consideration its header directives?
Yes
No
Yes
Could functions and filters be defined at runtime without any overhead?
No
Yes
No
https://twig.symfony.com/doc/1.x/recipes.html#defining-undefined-functions-and-filters-on-the-fly
Could a hidden response be validated?
No
No
Yes
Could interfaces and/or abstract classes be serialized?
No
No
Yes
Does using Router::getRouteCollection() considered as a best practice when checking if a route exist?
No
Yes
No
RouteCollection is not loaded, the collection is fully loaded from the loader that trigger the cache compilation.Is it possible to create a Symfony\Component\HttpFoundation\RedirectResponse with the 201 status code?
No
No
Yes
Given the AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER header directive is set, is an expiration date defined in the response?
No
No
Yes
Are the following Mailer configuration and environment variable definition valid?
No
No
Yes
Could environment variables be configured using ContainerConfigurator?
No
No
Yes
Could a MockResponse be issued outside of MockHttpClient?
No
Yes
No
Does the Pragma HTTP response header allow to efficiently transmit cache instructions in HTTP/1.1 ?
No
No
Yes
Is the following code valid when returning a "safe version" of a content?
No
No
Yes
Given the following code snippet:
Is the onDownloadComplete method guaranteed to be called when the .iso file had been downloaded completely?
No
Yes
No
Is the Form component required to generate a csrf token in templates?
No
No
Yes
Could a service definition be hidden using setPrivate()?
No
Yes
No
Is it possible for a PHP class to be declared private or protected in order to limit its scope to the current namespace only ?
No
Yes
No
Given the context where the ProxyManager bridge is not installed, could lazy services be defined and used as lazy services?
No
No
Yes
Is the salt property needed for all encoders ?
No
No
Yes
Could service configurators use __invoke() to configure a service?
No
No
Yes
Will the following snippet throw an InvalidArgumentException?
No
No
Yes
Could a Button have a child?
No
Yes
No
Could the current firewall be retrieved from a BadgeInterface implementation?
No
Yes
No
Is the following code valid?
No
Yes
No
Could the build hash of the container be configured?
No
Yes
No
container.build_hash parameter is exposed but cannot be configured, the hash is obtained thanks to ContainerBuilder::hash() during the compilation/dump phase of the container.Considering the following definition of route:
Will the /hello/John/Doe URI match this route?
No
No
Yes
Could a parameter be removed from a Symfony\Component\DependencyInjection\ParameterBag\ContainerBag?
No
Yes
No
Will the following code raise an error or a warning?
No
Yes, the declaration of B::foo($arg1, $arg2) must be compatible with A::foo($arg1)
Yes, class B cannot inherit from class A
No
Given the following routing configuration:
Does the path /blog/articles?page=1 can display the page without error ?
No
No
Yes
According to the official Symfony Best Practices Guide, is it recommended to store global settings that rarely change in raw PHP constants instead of storing them under a configuration dedicated file?
No
No
Yes
With the following class definition what will be returned by \NamespaceName\Example\ClassName::class?
NamespaceName\Example\ClassName
NamespaceName\Example\ClassName
\NamespaceName\Example\ClassName
NamespaceName\Example
ClassName
What will be the output ?
NULL
NULL
object(SimpleClass)#1 (1) {
["var"]=>
string(30) "$assigned will have this value"
}An error
NULL
NULL
object(SimpleClass)#1 (1) {
["var"]=>
string(30) "$assigned will have this value"
}What is the output ?
My name is Jean and I'm 09
My name is Jean 9 and I'm Luc
My name is 9 and I'm Jean Luc
My name is Jean and I'm 09
My name is $Jean Luc and I'm $9
My name is Jean Luc and I'm 9
Which type of Message can be used to MessageConverter::toEmail() in order to create an Email?
Message
RawMessage
RawMessage
Message
string
https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Mime/MessageConverter.php#L31
Which exception is thrown when clearing parameters from a FrozenParameterBag?
LogicException
InvalidArgumentException
RuntimeException
LogicException
BadMethodCallException
Which exception is thrown when removing a parameter from a FrozenParameterBag?
LogicException
InvalidArgumentException
BadMethodCallException
RuntimeException
LogicException
What is the purpose of the logging: true option in the translator config?
Log a message when Symfony doesn't find a translation for the given locale.
Translate all log messages in the default locale.
Log a message when Symfony translate a string in the given locale.
Log a message when the given local is not configured.
Log a message when Symfony doesn't find a translation for the given locale.
What are Twig loaders responsible for?
Loaders are responsible for loading templates from a resource name.
Loaders are responsible for loading token parsers.
Loaders are responsible for loading extensions.
Loaders are responsible for loading environments such as Twig_Evironment.
Loaders are responsible for loading templates from a resource name.
What are the "confidence" constants available in the Symfony\Component\Form\Guess\Guess class?
LOW_CONFIDENCE
HIGH_CONFIDENCE
MEDIUM_CONFIDENCE
VERY_HIGH_CONFIDENCE
UNKNOWN_CONFIDENCE
HIGH
VERY_VERY_LOW_CONFIDENCE
UNKNOWN
MEDIUM
VERY_VERY_HIGH
VERY_HIGH_CONFIDENCE
VERY_VERY_HIGH_CONFIDENCE
LOW
VERY_LOW_CONFIDENCE
LOW_CONFIDENCE
MEDIUM_CONFIDENCE
VERY_LOW
HIGH_CONFIDENCE
VERY_VERY_LOW
VERY_HIGH
The Symfony validator is based on…?
JSR 303
RFC 2616
PSR-2
JSR 303
CVE-2015-2308
Which interface(s) should an Object implement to be usable in a foreach statement?
IteratorAggregate
ArrayAccess
IteratorAggregate
ArrayAccess
Traversable
Which interface should an object implement to use brackets notation as an array?
IteratorAggregate
Iterator
Traversable
IteratorAggregate
ArrayAccess
It will return {"data":["foo","bar","baz"]}
It will throw an \InvalidArgumentException
It will return {"data":["foo","bar","baz"]}
It will return {"data":{}}
JsonReponse you'll have to use StreamedJsonResponse introduced in 6.3.Given the following console event subscriber:
What will be the result of setCode method call?
It will change the command exit status code to 232
It will change the command exit status code to 232
It will trigger an error
https://github.com/symfony/symfony/blob/2.2/src/Symfony/Component/Console/Command/Command.php#L248
What can happen to an HTTP response whose Cache-Control header value equals private, max-age=120?
It will be cached by the web browser.
It will only be cached by any shared proxy servers including reverse proxies.
It prevents the response from being cached by the web browser or any shared proxies.
It will be cached by the web browser.
It will be cached by a reverse proxy cache like Varnish.
It will be cached by any proxy server.
What does the CardScheme Constraint stand for ?
It validates that a card number is valid for a given credit card company
It validates that a card number is valid for a given credit card company
It doesn't exist
It validates if a credit card is a VISA one
It validates a credit card number
What should do an intermediary if the Max-Forwards header is equal to 0?
It should not forward the request
It should not forward the request
Nothing
This header doesn't exist
It should forward the request no matter the header value
Which of the following statements is true about the AbstractController class located in the FrameworkBundle bundle?
It must always be the parent class for every single controller of the application.
It must always be the parent class for every single controller of the application.
It declares a controller as a service.
It provides helper methods.
It can provide by default any services of the application.
What is the default command of a Symfony/Component/Console/Application?
In other words, what is the default value of the Symfony\Component\Console\Application::$defaultCommand property?
It is mandatory to specify a default command name when creating a Symfony\Component\Console\Application.
help
It is mandatory to specify a default command name when creating a Symfony\Component\Console\Application.
version
list
https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Console/Application.php#L96 https://symfony.com/doc/6.0/components/console/changing_default_command.html
With de the default configuration, how to enable CSRF protection on a form ?
It is enabled by default.
By adding the csrf_token option to the form type.
By adding the csrf_token option to the form view.
It is enabled by default.
By adding the csrf_protection option to the form type.
Which of the following are true about Symfony\Component\OptionsResolver\Options?
It is an interface.
The OptionsResolver class implements Options.
It is an abstract class.
The OptionsResolver class implements Options.
It is an interface.
The OptionsResolver class extends Options.
How does the AccessDecisionManager behave when configured with a consensus voting strategy?
It grants access if there is at least a majority of all the voters granting access.
It grants access if over two-thirds of voters answer the access is granted.
It grants access as soon as there is one voter granting access.
It grants access if there is at least a majority of all the voters granting access.
It only grants access if none of the voters deny access.
What is the purpose of Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::fixXmlConfig ?
It ensures that single XML elements are turned into an array
It normalizes XML element name (e.g. pluralizing the key used in XML)
It applies a custom function to an XML element if an error occurs
It normalizes XML element name (e.g. pluralizing the key used in XML)
It ensures that single XML elements are turned into an array
It always applies a custom function to an XML element
What is the main difference between the Symfony\Component\Form\Extension\Core\Type\BirthdayType form type and its parent Symfony\Component\Form\Extension\Core\Type\DateType ?
It defaults the years option to 120 years ago to the current year.
It defaults the years option to 120 years ago to the current year.
It adds a little "bithday cake" icon right before the widget.
Those form types does not inherit from each other.
This is only semantical, there is no real difference between them.
Which of the following assertions are true about the instanceof keyword?
It checks if a variable value is an instance of a dedicated class.
It checks if a variable value is an instance of a class that implements a certain interface.
It checks if a variable value is an instance of a class that implements a certain interface.
It checks if a variable value is an iterable data structure.
It checks if a variable value is of type object.
It checks if a variable value is an instance of a dedicated class.
Which sentence is true about the ConsoleLogger shipped in the console component ?
It allows to display log messages to stdout
It allows to display log messages to stdout
It allows to log messages (formatted in a simpler format than Monolog default log format) into a file without having to install Monolog
It allows to log messages (formatted with Monolog default log format) into a file without having to install Monolog
What is the purpose of the autowire configuration flag in a service definition?
It allows implicit dependencies registration based on the service constructor's typehint.
It allows the service to be automatically called on some kernel events.
It allows to get ride of the a circular reference error for the service.
It allows implicit dependencies registration based on the service constructor's typehint.
Which of the following are Symfony built-in validation constraint?
IsNull
Blank
NotNull
NotBlank
Null
IsNull
NotNull
Blank
IsBlank
NotBlank
Which exception is thrown if Request::getClientIps() detect that ips are not consistent?
InvalidArgumentException
LogicException
InconsistentIpsException
ConflictingHeadersException
InvalidArgumentException
RuntimeException
https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/HttpFoundation/Request.php#L798
What is the purpose of the wrap method of the AbstractString class?
Instantiate multiple objects of the String component in one call by passing an array of strings as an argument
Instantiate multiple objects of the String component in one call by passing an array of strings as an argument
To concatenate multiple strings in one, like the \implode(...) native method
To compress strings passed as arguments to minimize memory consumption when dealing with gigantic strings
According to the official Symfony Best Practices Guide, where do you have to store your assets?
Inside the assets/ directory.
Inside the public/ directory.
Inside the assets/ directory.
Inside the src/Resources/public/ directory.
Which of the following are not built-in option variants ?
InputOption::VALUE_OPTIONAL
InputOption::VALUE_NONE
InputOption::VALUE_REQUIRED
InputOption::VALUE_IS_ARRAY
InputOption::VALUE_NOT_REQUIRED
InputOption::VALUE_IS_ARRAY
InputOption::VALUE_NONE
InputOption::VALUE_REQUIRED
InputOption::VALUE_OPTIONAL
InputOption::VALUE_IS_MULTIPLE
Given the following route attribute, to display a blog post:
how to retrieve the post id ?
Injecting $post into the controller action:
$post will contain the post id
Injecting $post into the controller action:
$post will contain the post id
What is the aim of the Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest() listener on kernel.request event?
Initializes the locale based on the current request.
Find the user locale based on the user session.
Initializes the locale based on the current request.
Save the current locale in a cookie
What is the aim of the Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest() listener on kernel.request event?
Initializes the context from the request and sets request attributes based on a matching route.
Initializes the context from the request and sets request attributes based on a matching route.
Find the correct URL to generate for a route to create a redirect response.
Checks if the user is allowed to use the current route.
What do 1xx codes stand for ?
Informational
Client Error
They don't exist.
Server Error
Informational
Given the context where a form needs to contain multiple buttons, where shouldn't the buttons be defined?
In the template
In the controller
In the template
In the form type
According to the official Symfony Best Practices Guide, where should the application specific configuration parameters be stored?
In the config/services.yaml file.
In the .app.yml file at the root of the project directory.
In the config/parameters.yaml file.
In the src/Kernel.php file.
In global environment variables.
In the config/services.yaml file.
Where should sensitive informations (like API tokens) be stored ?
In an .env file like .env.local.
In config/parameters.yaml.
In config/services.yaml.
In an .env file like .env.local.
What should you do in order to use the form inheritance mechanism ?
Implement the getParent method of the Symfony\Component\Form\FormTypeInterface.
Declare your form as a service and define the parent property on it.
Implement the getParent method of the Symfony\Component\Form\FormTypeInterface.
Set the inherit_data option to true.
Use the PHP built-in class inheritance.
Which Request header is used to check the ETag validity ?
If-None-Match
If-None-Match
Last-Modified
Etag
Cache-Control
Among the following, which one is not a built-in form type?
IbanType
PasswordType
MoneyType
IbanType
NumberType
Which role allows you to check that a user is logged in (whatever the means, ex: remember_me cookie, login form, etc)?
IS_AUTHENTICATED
IS_AUTHENTICATED_FULLY
IS_AUTHENTICATED_REMEMBERED
IS_AUTHENTICATED
IS_FULLY_AUTHENTICATED
IS_AUTHENTICATED_ANONYMOUSLY
IS_AUTHENTICATED_REMEMBERED
IS_AUTHENTICATED_FULLY
Which exception is thrown when a directory creation has failed ?
IOException
DirectoryException
FileException
FileSystemException
IOException
InvalidFileException
Which type of loader is not supported by Symfony?
INI
YML
Closure
INI
PHP
What will be the output of the following code?
I am at the top of the auto-loaders stackLoaded
PHP Fatal error: Uncaught Error: Class 'Exception' not found
Nothing
I am at the top of the auto-loaders stackLoaded
I am at the top of the auto-loaders stack
Loaded
Which of these extensions are a built-in ones ?
HttpFoundationRequestHandler
HttpFoundationExtension
DataCollectorExtension
HttpFoundationExtension
HttpFoundationRequestHandler
DependencyInjectionExtension
HttpFoundationRequestHandler is an implementation of RequestHandlerInterface and not an extension.Which of these extensions are a built-in ones ?
HttpFoundationExtension
DependencyInjectionExtension
DependencyInjectionExtension
HttpFoundationExtension
HttpFoundationRequestHandler
DataCollectorExtension
HttpFoundationRequestHandler is an implementation of RequestHandlerInterface and not an extension.If the user variable is not defined, what will be the result of rendering this Twig template?
Hi anonymous!
Hi null!
Hi anonymous!
This template will display an error when rendering it.
Hi!
Hi ??!
?? operator is called "null coalesce operator" (as in PHP) and it was introduced in Twig 1.24 (January 2016)What is the aim of the Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest() listener on kernel.request event?
Handle as content fragments by this listener all URL paths starting with /_fragment.
Handle as content fragments by this listener all URL paths starting with /_fragment.
Handle as content all files to let user download them.
Handle as content all image, css, javascript that not require security.
Handle as content all image, css, javascript that require security.
What is PSR-7 about?
HTTP
Autoloading
Logger
Caching
HTTP
What does FQCN stand for ?
Fully Qualified Class Name
Fake Query Content Normalizer
Fully Qualified Class Name
Full Query Class Normalize
If you need to modify the data given during pre-population or modify a form depending on the pre-populated data (adding or removing fields dynamically), to which event your code should be hooked?
FormEvents::PRE_SET_DATA
FormEvents::POST_SET_DATA
FormEvents::SUBMIT
FormEvents::POST_SUBMIT
FormEvents::PRE_SET_DATA
FormEvents::PRE_SUBMIT
What mechanism determines whether the errors belonging to a Symfony\Component\Form\Extension\Core\Type\HiddenType form type will be displayed ?
Form type inheritance.
Hidden fields listener.
Form type inheritance.
It is not possible to change the behavior of whether HiddenType errors are displayed.
Error bubbling.
What would be the output of this code ?
Foo Bar Baz
Foo Bar Baz
Bar
Foo
Foo Bar
Given the following object to validate configuration (and assuming no group is specified when validate is called):
First, $foo, $foo2 will be validated, then, $bar will be validated, and finally $bar2
$foo, $foo2, $bar, $bar2 will be validated in the same time
$foo, $foo2, $bar will be validated in the same time
First, $foo, $foo2 will be validated, then, $bar will be validated, and finally $bar2
First, $foo, $foo2 will be validated and then, $bar
First, $foo, $foo2 will be validated and then, $bar, $bar2
Which class can be used as argument when listening to kernel.controller_arguments?
FilterControllerArgumentsEvent
None, this event does not exist
FilterControllerEvent
ControllerEvent
ControllerArgumentsEvent
FilterControllerArgumentsEvent
Which of the following classes are Twig loaders available by default?
FilesystemLoader
ArrayLoader
ChainLoader
FilesystemLoader
DoctrineLoader
ArrayLoader
CacheLoader
ChainLoader
Assuming that the validate() method detects no violations, what will the Response object contain?
Fatal error: Object of class ConstraintViolationList could not be converted to string.
Fatal error: Object of class ConstraintViolationList could not be converted to string.
Notice: Array to string conversion.
An empty string
False
According to the Symfony Best practices, is "smoke testing" considered a bad practice ?
False
True
False
Authorization is the process that makes sure that a user is who he claims to be?
False
True
False
Given $process is a Process object that runs a command asynchronously; calling $process->stop(3) will immediately send a SIGKILL signal to the running command.
False
False
True
True or false: The Expires header's value must contain the number of seconds the response should be cached.
False
True
False
What will be the result of that assertion?
Failure
Failure
Success
What will be the result of that assertion in a PHPUnit test?
Failure
Success
Failure
What is the prerequisite to create a FormTypeExtension
Extending the Symfony\Component\Form\AbstractTypeExtension
Creating a service with the form.type_extension tag
Implementing the interface Symfony\Component\Form\FormTypeExtensionInterface
Extending the Symfony\Component\Form\AbstractTypeExtension
Putting the new MyFormExtension class in the Form\Extension namespace
What are the four primary headers in HTTP cache?
Expires
ETag
Last-Modified
Cache-Control
Expires-After
Expires
Cache-Control
Last-Modified
ETag
Cached-Until
Which of the following HTTP response headers belong to the expiration caching model?
Expires
Cache-Control
Etag
Last-Modified
Cache-Control
Expires
Pragma
Which of the following assertions is true about HTTP caching?
Expiration and validation are mutually exclusive and therefore cannot be used simultaneously.
Expiration and validation are mutually exclusive and therefore cannot be used simultaneously.
Validation always wins over expiration.
Expiration always wins over validation.
Consider the following code snippet:
Since PHP 7.0, which type/class could be used to replace the ???? placeholder in order to output Oups, there is a serious problem there! ?
Exception
Warning
ErrorException
Exception
Error
BadFunctionCallException
Which HTTP response headers are involved in the validation caching model?
Etag
Last-Modified
Last-Modified
Cache-Control: s-max-age
Cache-Control: max-age
Etag
What will be the result of this code?
Error: Only the last parameter can be variadic
1
2
Error: Only the last parameter can be variadic
Error : Variadic functions should have only one argument.
Which method is used to render the desired template?
Environment::render()
Environment::showTemplate()
Environment::resolveTemplate()
Environment::render()
Environment::display()
According to the Symfony Best Practices Guide and the Symfony's coding conventions, which directory of your application is meant to store your Doctrine entity classes?
Entity
Mapping
ActiveRecord
Entity
Model
Doctrine
Which sentence about page fragments caching methods is true ?
Edge Side Includes are partially implemented by Symfony
Server Side Includes are more performant than Edge Side Includes and are recommanded by Symfony
Server Side Includes don't exist
Server Side Includes are not implemented by Symfony
Edge Side Includes are partially implemented by Symfony
ESI are partially implemented ("The ESI specification describes tags you can embed in your pages to communicate with the gateway cache. Only one tag is implemented in Symfony[...]")
Is the Filesystem component based on a lazy or eager implementation?
Eager
Eager
Lazy
Which HTTP headers can be used with the validation model?
ETag
Last-Modified
ETag
Cache-Control
Expires
Last-Modified
What kind of help provides the bin/console config:dump-reference command?
Dumps the default configuration of a bundle.
Dumps the current configuration of a bundle.
Dumps the current configuration in .htaccess format using the php_value directive.
Adds the default configuration of a bundle in the app/config/config.yml file.
Dumps the default configuration of a bundle.
What is the default ORM that integrates with Symfony ?
Doctrine.
Hibernate.
Doctrine.
Propel.
Symfony ORM.
What does the command debug:container router?
Displays the configured routes
Displays information for the service router
Displays the configured routes
What is the aim of the HandleTrait?
Dispatch sync message via a BusList and return a MessageList
Dispatch async messages and return the messages as a MessageList
Dispatch sync message via a BusList and return a MessageList
Dispatch sync messages via a bus and return its result.
What's true about the addListener()'s $priority value from Symfony\Component\EventDispatcher\EventDIspatcherInterface?
Defaults to 0
The higher this value, the earlier an event listener will be triggered in the chain
The higher this value, the later an event listener will be triggered in the chain
Defaults to 1
The higher this value, the earlier an event listener will be triggered in the chain
Defaults to 100
Defaults to 0
Which formats of date are accepted in Email->date()?
DatetimeImmutable
Datetime
string
DatetimeImmutable
Datetime
Which HTTP verbs are idempotent ?
DELETE
PUT
HEAD
GET
OPTIONS
POST
CONNECT
PATCH
DELETE
PUT
OPTIONS
HEAD
GET
Which encryption means is used to secure credentials when authenticating an HTTP request with the HTTP Basic mechanism?
Credentials are not encrypted but only Base64 encoded.
Hashing (md5, sha1, etc.)
Credentials are not encrypted but only Base64 encoded.
Asymmetric-key encryption
Symmetric-key encryption
Credentials are not encrypted and transmitted in plain text in the HTTP request.
From Symfony 5, what is provided by the ControllerTrait ?
ControllerTrait doesn't exist anymore
ControllerTrait doesn't exist anymore
some helpers to render views
shortcuts to return specific responses (json responses, redirect responses...)
a service locator
What are the recommended types of injections when injecting a service dependency into another?
Constructor injection
Immutable-setter Injection
Setter injection
Constructor injection
Getter injection
Property injection
Immutable-setter Injection
Which exception is thrown if ValidateRequestListener::onKernelRequest() detect that ips are not consistent?
ConflictingHeadersException
InvalidArgumentException
LogicException
ConflictingHeadersException
RuntimeException
InconsistentIpsException
If the expanded and multiple options are set to true on a Symfony\Component\Form\Extension\Core\Type\ChoiceType form type, what is displayed when rendering the form ?
Checkboxes.
Checkboxes.
Radio buttons.
Select tag.
Select tag (with multiple attribute).
What UserProvider allows to fetch users from multiple sources ?
ChainUserProvider
CompositeUserProvider
ChainUserProvider
MultipleUserProvider
AggregateUserProvider
Which HTTP response header instructs a cache to send a request to the origin server for validation before releasing a cached copy ?
Cache-control: must-revalidate
Cache-control: no-cache
Cache-control: no-store
Cache-control: must-revalidate
Cache-control: no-cache
Cache-control: private
Which of these HTTP headers tell a reverse proxy cache like Varnish to cache the response it receives during 90 minutes?
Cache-Control: public, s-maxage=5400
Cache-Control: public, s-maxage=5400
Cache-Control: public, s-maxage=90
Cache-Control: public
Cache-Control: private, maxage=5400
Cache-Control: private, maxage=90
Given the following code, what will be displayed?
C:/
C:/Programs
C:/Programs/
C:/Programs/Apache/Config
C:/
C:/Programs/Apache/
C:/Programs/Apache
When dealing with binary content, which class of the String component are you the most likely to use?
ByteString
ByteString
CodePointString
UnicodeString
We sometimes come across arrow functions declared as static, like in the code below:
Which of the following choices is true
By using the static modifier, $this (representing the current instance of Foo) won't be bound and "injected" in the arrow function. It will result in a faster execution, as this binding doesn't have to be made
By using the static modifier, $this (representing the current instance of Foo) won't be bound and "injected" in the arrow function. It will result in a faster execution, as this binding doesn't have to be made
It allows the arrow function to be able to access to $this, representing the current instance of Foo calling this method
Nothing actually changes
With cURL installed, how does the HTTP/2 support can be activated for http URLs?
By using the 'http_version' => '2.0' configuration key when creating a new HttpClient
It's activated by default
By using the 'http_version' => '2.0' configuration key when creating a new HttpClient
How to overwrite a configuration array if the value is also defined in a second configuration array ?
By using ->performNoDeepMerging()
By using ->canBeOverwritten()
By using ->performNoDeepMerging()
By using ->performDeepMerging()
By using ->enableMerging()
How is it possible to generate absolute URLs from the Console?
By running
By overloading the parameter router.request_context.host in the configuration.
By overloading the parameter router.request_context.host in the configuration.
The host is automatically known by Symfony, there is no need to specify it in CLI.
By running
By specifying the host parameter in the Twig function url().
How can you register a new compiler pass?
By passing an instance of the CompilerPass to the addCompilerPass of a ContainerBuilder.
By passing an instance of the CompilerPass to the pushCompilerPass of a ContainerBuilder.
By creating a new service with the tag compiler_pass.
By passing an instance of the CompilerPass to the registerCompilerPass of a ContainerBuilder.
By passing an instance of the CompilerPass to the addCompilerPass of a ContainerBuilder.
By creating a new service with the tag compiler.pass.
How can you modify the copy of an object during a clone operation ?
By implementing the __clone() method.
By implementing the __construct() method.
By implementing the __clone() method.
By creating your own method and putting the @clone annotation on it.
By implementing the __get() and __set() methods.
It is not possible.
What are the possibles ways to register new functions in Symfony\Component\ExpressionLanguage\ExpressionLanguage?
By calling the register() method.
By calling the addFunction() method.
By calling the registerProvider() method.
By calling the registerProvider() method.
By calling the register() method.
By calling the createFunction() method.
By calling the addFunction() method.
By calling the setFunctions() method.
How to make a route matching only a specific host ?
By adding a hostkey in the requirements section of a route definition
By adding domain key in the route definition
By adding a host key in the route definition
it's not possible
By adding a hostkey in the requirements section of a route definition
By adding domain key in the requirements section of a route definition
When is the Symfony\Component\Console\Command::interact method executed?
Before Symfony\Component\Console\Command::execute method.
After Symfony\Component\Console\Command::initialize method.
Before Symfony\Component\Console\Command::initialize method.
Before Symfony\Component\Console\Command::execute method.
After Symfony\Component\Console\Command::execute method.
After the InputDefinition is validated.
Before the InputDefinition is validated.
After Symfony\Component\Console\Command::initialize method.
What will be the output of the following code?
BarFoo
BarFoo
Bar
FooBar
Foo
Which exception is thrown when trying to remove a subscriber from an ImmutableEventDispatcher?
BadMethodCallException
InvalidArgumentException
FrozenEventDispatcherException
BadMethodCallException
RuntimeException
LogicException
InvalidArgumentException
Which exception is throw when trying to add a subscriber into an ImmutableEventDispatcher?
BadMethodCallException
RuntimeException
BadMethodCallException
InvalidArgumentException
FrozenEventDispatcherException
LogicException
Which exception is throw when trying to add a listener into an ImmutableEventDispatcher?
BadMethodCallException
LogicException
RuntimeException
Symfony\Component\DependencyInjection\Exeption\InvalidArgumentException
InvalidArgumentException
BadMethodCallException
FrozenEventDispatcherException
Consider the following PHP code snippet:
What is the expected output when executing this script?
B-fooPHP will raise a fatal error because it's not allowed to override a private method.
B-fooA-fooWhich class can be used to extracts security errors from a Request?
AuthenticationUtils
FrameworkUtils
AuthenticationUtils
HttpUtils
RequestUtils
SecurityUtils
Which of the following formats are available to define validation rules or constraints?
Attributes
YAML
Annotations
PHP
PHP
JSON
Attributes
XML
YAML
Annotations
According to the official Symfony Best Practices Guide, which format do you need to use to define the mapping information of the Doctrine entities?
Attributes
Annotations
Yaml
Xml
PHP
Attributes
https://symfony.com/doc/5.3/best_practices.html#use-attributes-to-define-the-doctrine-entity-mapping
Which slugger is defined in the String Component?
AsciiSlugger
Slugger
AsciiSlugger
UnicodeSlugger
TraceableSlugger
What is the output of such a script ?
An error
What type is the __debugInfo() magic method supposed to return?
Array
Object
Boolean
Any type
Array
String
Nothing
What's the aim of the apply tag?
Apply one or multiple filters on a block
Apply one and only one filter on a block
Define a new tag
Apply a camelCase transformation to a text
Apply one or multiple filters on a block
Given the following two routes, what controller will be executed for the URL /book/123?
App\Controller\BookController::detail
App\Controller\BookController::detailSection
App\Controller\BookController::detail
Error: The routing file contains unsupported keys for “defaults”
Error: No route found
Given the following routes, what controller will be executed for /book/123 ?
App\Controller\BookController::detail
App\Controller\BookController::download
Error: No route found
App\Controller\BookController::detail
App\Controller\BookController::list
If no methods are specified for a route, what methods will be matched?
Any methods
Safe methods: GET or HEAD
Any methods
GET or POST
GET
According to the official Symfony Best Practices Guide, what format do you need to use to define/configure your own services?
Annotations
Annotations
XML
PHP
YAML
If I want to allow the client to specify CLI option --force, what am I going to add to the definition?
An option InputOption.
A parameter InputParameter.
An option InputOption.
An argument InputArgument.
A choice InputChoice.
What is the kind of value of $file in the following code?
An instance of Symfony\Component\Finder\SplFileInfo.
An instance of Symfony\Component\Finder\File.
An instance of Symfony\Component\Finder\File\SplFileInfo.
An instance of Symfony\Component\Finder\FileInfo.
An instance of Symfony\Component\Finder\File\SplFile.
An instance of Symfony\Component\Finder\SplFileInfo.
An instance of Symfony\Component\Finder\File\File.
Given a new process created in front of a Symfony command that return a 1 code, what will be returned by Process::mustRun()?
An instance of Process
1
An instance of Process
true
Nothing, a ProcessFailedException will be thrown
false
Which type of argument is passed if a closure is used in empty_data option?
An instance of FormInterface
An array
An instance of FormInterface
Nothing
An instance of Option
What will be the output of the following piece of code ?
An error saying Failed to open stream: HTTP wrapper does not support writeable connections.
1
An error saying Failed to open stream: HTTP wrapper does not support writeable connections.
3
The results of the "foo" search on Google as plaintext.
An error saying Failed to open stream: Permission denied.
The results of the "foo" search on Google as HTML.
What would be the output of this code ?
An error is thrown
An error is thrown
2
1
What is the output of the following PHP script?
An error
50937
09537
An error
375509
What is the output ?
An error
[1, 2, 3, 4, 5, 6]
An error
[1 => 4, 2 => 5, 3 => 6]
[1 => 2, 3 => 4, 5 => 6]
Which of the following can be represented as a Symfony\Component\Form\Extension\Core\Type\FormType?
An entire <form> with multiple fields to edit a user profile
A group of several HTML fields used to input a postal address
An entire <form> with multiple fields to edit a user profile
A group of several HTML fields used to input a postal address
A single <input type="text"> form field
What is the default value of the empty_data option when data_class is set?
An empty string
An empty string
An empty array
null
A new instance of the class set in data_class
What will return Symfony\Component\Mime\MimeTypes::getExtensions(string $mimeType) when passing it an invalid MIME type?
Example: $mimeTypes->getExtensions('not/a-valid-type')
An empty array
An Exception will be thrown.
null
An empty array
What is a serializer context?
An array passed on (de)serialization to control serializer features
An array passed on (de)serialization to control serializer features
The global configuration of the serializer component
The object to update during deserialization
The initial data to serialize/deserialize
What is the constructor argument of ValidationStamp?
An array of string or a GroupSequence
An instance of Constraint
A formatted string using the following syntax foo, bar
An array of string or a GroupSequence
Which of the following are valid ways in PHPUnit to test the exceptions that occur when executing some PHP code?
Add the following PHP call inside the test method:
You can't test PHP exceptions with PHPUnit.
Wrap the entire test method in a try...catch but without processing the exception in any special way:
Add the following PHP call inside the test method:
Which headers can trigger a 406 response status code if the server cannot produce a valid response?
Accept-Language
Accept
Accept-Encoding
If-Range
If-None-Match
If-Match
Accept-Encoding
Accept
Accept-Language
Which are the constants defined in Symfony\Component\Security\Core\Security class?
AUTHENTICATION_ERROR
ACCESS_DENIED_ERROR
LAST_USERNAME
MAX_USERNAME_LENGTH
LAST_USERNAME
BAD_CREDENTIALS
ACCESS_DENIED_ERROR
AUTHENTICATION_ERROR
MAX_USERNAME_LENGTH
AUTHENTICATION_FAILURE
WRONG_PASSWORD
Which of the following statements best describes the purpose of PHP's extract() function? This function accepts an array as its first argument.
A variable is created in the current scope for each element in the given associative array.
The second argument is used to specify a data type (such as 'string'). All values in the passed array of that type are returned in a new array.
Any ZIP files referenced in the passed array are extracted to the current working directory.
The passed array is populated by any variables in the current scope.
A variable is created in the current scope for each element in the given associative array.
What is a sub request?
A sub request serves to render just one small portion of a page instead of a full page.
A sub request is a request from a HTTP reverse proxy.
A sub request serves to render just one small portion of a page instead of a full page.
A sub request serves to create HTTP cache headers.
A sub request is a request used in tests.
What value type is returned by the Symfony\Bundle\FrameworkBundle\Controller\AbstractController::renderView() method?
A string.
A string.
An instance of Symfony\Component\HttpFoundation\Response.
An instance of Symfony\Component\View\View.
An instance of Symfony\Component\BrowserKit\Response.
What is the third argument of the addListener method of the Symfony\Component\EventDispatcher\EventDispatcher class?
A priority integer that determines when a listener is triggered versus other listeners.
A PHP callable that will be executed when the specified event is dispatched
An Event object.
The event name (string) that this listener wants to listen to.
A priority integer that determines when a listener is triggered versus other listeners.
What is mysqlnd?
A low level connector designed to replace libmysql dependency
A low level connector designed to replace libmysql dependency
A persistent connection to a MySQL server
A PHP extension adding some functions to interact with a MySQL server, like PDO
A new RDBMS like MySQL or MariaDB
What is a Dumper?
A dumper is responsible for getting each property values of PHP object.
A dumper is responsible for getting each property values of PHP object.
A dumper is responsible for creating a var_export of any PHP variable.
A dumper is responsible for outputting a string representation of a PHP variable.
A dumper is responsible for creating a var_dump of any PHP variable.
What is PSR-12?
A coding style guide.
A standard way to convert fully qualified names into file paths.
A utility to convert non-namespaced PHP classes into namespaced ones.
A coding style guide.
A common logger interface.
What are PSR-0 and PSR-4?
A coding style guide.
A specification for autoloading classes from file paths.
A utility to convert non-namespaced PHP classes into namespaced ones.
A coding style guide.
A common logger interface.
What is PSR-1?
A basic coding standard.
A coding style guide.
A basic coding standard.
A standard way to convert fully qualified names into file paths.
A common logger interface.
What will be in $result with the following code?
A Symfony\Component\VarDumper\Cloner\Data object
An array.
A Symfony\Component\VarDumper\Cloner\Clone object
A Symfony\Component\VarDumper\Cloner\Data object
An object of the same class of $myVar.
A Symfony\Component\VarDumper\Cloner\CloneData object
A Symfony\Component\VarDumper\Data object
What will be the result of the following code?
A Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException will be thrown.
A Symfony\Component\PropertyAccess\Exception\NoSuchIndexException will be thrown.
The value of $age will be null.
The value of $age will be 0.
A Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException will be thrown.
What will be the result of the following code?
A Symfony\Component\PropertyAccess\Exception\NoSuchIndexException will be thrown.
The value of $age will be null.
A Symfony\Component\PropertyAccess\Exception\NoSuchIndexException will be thrown.
The value of $age will be 0.
A Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException will be thrown.
With the following class:
what exception will be thrown while executing the code:
A Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException.
A Symfony\Component\OptionsResolver\Exception\InvalidOptionsException.
A Symfony\Component\OptionsResolver\Exception\NoSuchOptionException.
A Symfony\Component\OptionsResolver\Exception\OptionDefinitionException.
A Symfony\Component\OptionsResolver\Exception\MissingOptionsException.
A Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException.
Consider the following code:
What does the $result variable contain at the end of this script?
A Symfony\Component\HttpFoundation\Response instance.
An array.
A Symfony\Component\HttpFoundation\Request instance.
A Symfony\Component\HttpFoundation\Response instance.
A string.
A Symfony\Component\BrowserKit\Response instance.
A Symfony\Component\BrowserKit\Request instance.
What happens if you try to get the output of process that has its output disabled?
A LogicException is thrown
An InvalidArgumentException is thrown
An empty string is returned
A LogicException is thrown
null is returned
https://github.com/symfony/symfony/blob/6.2/src/Symfony/Component/Process/Process.php#L565-L578
What happens if you try to get the output of process that has not been started yet?
A LogicException is thrown
null is returned
An InvalidArgumentException is thrown
A LogicException is thrown
An empty string is returned
https://github.com/symfony/symfony/blob/6.2/src/Symfony/Component/Process/Process.php#L563-L577
What will be stored in $yaml with the following code:
A DateTime object
DateTime {
+"date": "1983-07-01 00:00:00.000000"
+"timezone_type": 3
+"timezone": "UTC"
}An array
array:1 [
0 => '1983-07-01'
]425865600An array
array:1 [
0 => DateTime {
+"date": "1983-07-01 00:00:00.000000"
+"timezone_type": 3
+"timezone": "UTC"
}
]1983-07-01An array
array:1 [
0 => 425865600
]A DateTime object
DateTime {
+"date": "1983-07-01 00:00:00.000000"
+"timezone_type": 3
+"timezone": "UTC"
}Which constraint should be used to assert that a collection contains exactly 2 items?
We assume that Assert is an Alias to Symfony\Component\Validator\Constraints namespace.
@Assert\Count(min=2, max=2)@Assert\Length(2)@Assert\Length(min=2, max=2)@Assert\Count(min=2, max=2)@Assert\Count(min=2)Is the following code correct?
No
Yes
No
Is the following route definition correct?
Yes
No
Yes
Which of the following assertions is correct?
PHP is a loosely-typed declarative language.
PHP is a strongly-typed imperative language.
PHP is a strongly-typed, functionnal language.
PHP is a loosely-typed imperative language.
PHP is a loosely-typed functionnal language.
PHP is a loosely-typed declarative language.
In the following code, what is the key of the element with value 25?
9
9
0
8
29
What is the output of the following PHP script?
876
5678
876
8765
321
What will be the value stored in $width when using the following code within a command and assuming that no environment variables are set and the stty command isn't available.
80
0
An error
Nothing
The width of the actual terminal
120
80
200
What are the HTTP status codes for Server Error?
5xx
1xx
5xx
3xx
2xx
4xx
Which status code will be returned if a proxy detect that a client must be authenticated to gain network access?
511
506
508
404
511
510
What is the HTTP status codes for HTTP Version Not Supported?
505
504
505
503
502
500
501
What is the HTTP status codes for Gateway Timeout?
504
501
502
504
503
505
500
What is the HTTP status codes for Bad Gateway?
502
505
502
501
500
504
503
What is the HTTP status codes for Not Implemented?
501
503
505
500
502
504
501
What is the HTTP status codes for Internal Server Error?
500
505
501
500
503
502
504
What will be the output of the following script?
5An error
2453What are the HTTP status codes for client errors?
4xx
3xx
4xx
1xx
5xx
2xx
Which status code must be used to respond if a resource is unavailable due to legal reasons?
451
425
418
401
404
403
451
What is the status code for Too Many Requests?
429
431
502
429
420
503
What is the status code for Gone?
410
411
403
404
410
409
What is the status code for Unauthorized ?
403
401
405
402
403
What will be the output of the following code?
42An error
304What are the HTTP status codes for redirection?
3xx
3xx
4xx
5xx
1xx
2xx
What is the output ?
32
17
32
1
16
9
What is the default status code of a Symfony\Component\HttpFoundation\RedirectResponse object?
301
300
304
301
302
What is the output of the following PHP code?
3
3
An error
4
1
5
The Application class of the Console component allows you to optionally hook into the lifecycle of a console application via events.
How many events are dispatched?
3
6
1
2
4
3
5
What will be displayed by the following code?
230
230
42
440
true
1
What is the default status code of a Symfony\Component\HttpFoundation\Response object?
200
204
201
400
202
200
https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/HttpFoundation/Response.php#L127
When was the Symfony BC promise introduced ?
2.3
2.0
2.6
2.9
3.2
2.8
2.3
3.3
2.1
3.0
2.7
3.1
2.4
2.2
2.5
How many HTTP requests (without using JavaScript) are required to determine whether or not a client supports cookies?
2
2
This is not possible without javascript.
1
0
What will be the output of the following code?
2
0
2
42
null
What is the output of the following code ?
1:2, 2:20, 3:16
1:2, 2:30, 3:15
1:3, 2:21, 3:16
1:2, 2:20, 3:16
1:3, 2:20, 3:15
1:2, 2:21, 3:15
When was PHP first released by Rasmus Lerdorf?
1995
1995
2000
2005
1987
What is the output of the following script?
15
4
16
5
15
Given the context where COLUMNS is set as an environment variable with the value of 120, what will be the value returned using the following code?
120
Nothing
The width of the actual terminal if used in the context of a terminal
80
An error
0
200
120
Consider the following code snippet:
What does this script output when it's executed with PHP?
120
An error saying something like Undefined variable: ....
70
110
60
120
What the default sleep option value of the worker?
1000000
10
1000
1000000
100
What will be the output of the following code ?
10
4
2
10
8
What is the output of the following twig code?
1,3,5,7,9
1,3,5,7,9
2,4,6,8,10
1,10,1,10
1,2,3,4,5,6,7,8,9,10
What is the output ?
1
1
2
Nothing
Error, function declarations can not be split over multiple PHP segments
What is the output ?
1
4
2
0
1
Given the following code, what will be displayed?
1
1
0
-1
What will be the output of the following script ?
0.1Total is 3
3Total is 3
1/8Total is 1/8
0.1Total is 3
0.125Total is 0.1
0.125Total is 0.125
What is the priority of the MessageListener->onMessage()?
0
-100
0
100
-255
Given the following code, what will be displayed?
0
-1
0
1
What is the default priority used when adding a new compiler pass?
0
1000
-255
0
100
10
What is the output ?
0
1
0
An error
-1
Given a new process created in front of a Symfony command that return a 0 code, what will be returned by Process::mustRun()?
0
false
0
An instance of Process
true
1
Given /var/www/myfile.txt is a regular file (not a symlink); what does (new Filesystem())->readlink("/var/www/myfile.txt") return ?
/var/www/myfile.txt
null
/var/www/myfile.txt
nothing, an exception is thrown
Given the following code and an existing path set to /srv/app which is a symbolic link to srv/sf, what will be stored in $value?
/srv/sf
An error
false
/srv/sf
/srv/app
true
For a request to http://example.com/blog/index.php/post/hello-world, what will be the value of $pathInfo in the following code?
/post/hello-world
example.com/blog/index.php/post/hello-world
/index.php/post/hello-world
/post/hello-world
/blog/index.php/post/hello-world
Given the following definition of the book_list route, what will be the value of the generated URL when calling $router->generate('book_list', ['page' => 2]);?
/books?page=2
An error will be thrown
https://example.com/books?_page=2
https://example.com/books?page=2
/books?page=2
/books?_page=1
Given the following definition of the book_list route, what will be the value of the variable $url?
/books?page=1
/books?_page=1
Error: Parameter "page" is not defined.
/books?page=1
What will be the generated URL when calling path('list') from a Twig template?
/blog/1
/blog
/blog/1
A MissingMandatoryParametersException will be raised.
/blog/
According to the following definition of route, which ones are matching?
/blog
/blog/
/blog/1
/blog/1
/blog/page-1
/blog
/blog/
When using the Finder to search for files in a directory, it can be instructed to ignore files and paths excluded from Git using the .gitignore file.
What is the said instruction ?
Given the following code, what will be displayed?
/
/etc/apache2/sites-available
/
/etc/apache2
/etc
/etc/apache2/
/etc/
Consider the following code snippet:
What must the ??? placeholder be replaced with in order to make the script print the string Yes on the standard output since PHP 5.6?
...$args
...$args
$args
$args = func_get_args()
array $args
What is the console option to display debug message verbosity?
-vvv
--debug-messages
--debug
-d
-vvv
What is the priority of the EnvelopeListener->onMessage()?
-255
255
-255
0
-100
100
What will be the output of the following code?
-1
-1
1
0
How can you set true as default value for a Node Type ?
What will be the output of the following command?
Considering the following HTML structure:
And the following PHP script:
What Xpath query should go in the /* ... */ to display the bgcolor attribute of the first body node in the XML Document ?
*[local-name()="body"]
/body[0]/text
*[local-name()="body"]
*[lname()="body"]
name="body"
/body/body[0]
What are valid output types defined in Process?
'err'
'out'
'input'
'output'
'out'
'err'
'error'
'in'
With the following code, what can be set as the value of the choice_label option to display the name property of each choice ?
Which of the following values doesn't trigger a violation when the Date constraint is applied to it?
'15/01/2020'
new \DateTime('2020-01-15')
'2020-01-15'
'15/01/2020'
'2020-13-15'
'15/13/2020'
null
new \DateTime('2020-01-15')
'2020-01-15'
Which of the following values don't trigger a violation when the Date constraint is applied to them?
'15/01/2020'
new \DateTime('2020-01-15')
'2020-01-15'
'2020-01-15'
'15/01/2020'
'2020-13-15'
null
new \DateTime('2020-01-15')
'15/13/2020'
Which ESI (Edge Side Include) element is supported by Symfony?
<esi:include src="..."/>
<esi:remove>
<esi:comment text="..." />
<esi:inline name="...">
<esi:include src="..."/>
<esi:choose>
<esi:try>
<esi:vars>
Which will be the output of the following code ?
<h1>Hello from Twig</h1>
<h1>Hello from Twig</h1>
An error
What is the way to add a loader to the translator?
Considering the following definition of route:
How can you retrieve the parameter title?
From the Request object passed by argument to the action of the controller, by writing the following:
What statement _______ is missing for this code to display 'bar' as a result ?
How would one access the $a property from within the commented part of the following code?
How to make a stub to throw an exception on a method call?
Consider the following PHP script.
What /** line **/ should be used to apply a callback function to every element of an array?
Which are the valid ways of caching a Response based not only on the URI but also the value of the Accept-Encoding and User-Agent request headers?
This is the default behavior
This is not possible without calling a reverse proxy
Which are the valid ways of caching a Response based not only on the URI but also the value of the Accept-Encoding and User-Agent request headers?
This is not possible without calling a reverse proxy
This is the default behavior
Which of theses are the way to add the Cache-Control: public,s-maxage=900 HTTP response header on a Symfony\Component\HttpFoundation\Response object?
https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/HttpFoundation/Response.php#L693
How can one add a cookie named foo with value bar in a Response?
In which cases the following call will return true?
In which cases the following call will return true?
How can you add an option named my_option without setting a default value?
How to access $_SERVER data when using a Symfony\Component\HttpFoundation\Request $request object?
$request->server$request->server$request->getServerData()$request->getServer()$request->servers$request->getServersData()https://symfony.com/doc/2.3/components/http_foundation/introduction.html#accessing-request-data
How to access $_POST data when using a Symfony\Component\HttpFoundation\Request $request object?
$request->request$request->post$request->request$request->getPostData()$request->getPost()How to get a cookie from a $request object?
Which of the following are valid statements to read request data from the Request object?
How to access $_FILES data when using a Symfony\Component\HttpFoundation\Request $request object?
$request->files$request->file$request->getFiles()$request->getFileData()$request->getFilesData()$request->filesWhich of the following is not a valid way to create an instance of Symfony\Component\HttpFoundation\Request?
How could you simulate a POST request to /login with login parameter set to admin ?
How could you simulate a GET request to /hello-world ?
What is the method to access the pid of the running process of the following code :
What values in $user or $pass will modify the SQL semantics and lead to SQL injection in the code below ?
None
What happens if you remove the type-hint Options of $options, in the callable below?
$options will automatically be casted to a nullable array
Nothing special
$options will automatically be casted to a nullable array
A fatal error is thrown because of the lack of type-hint
The callable itself will be considered as the default value
How do you add the value 10 to an array called $myArray?
What is the way to return Honeycrisp with the following code?
What is the most recommended way to count the number of occurences of each unique value in the following array?
What is the most recommended way to count the number of occurences of each unique value in the following array?
What is the Symfony\Component\Filesystem\Filesystem method to check if the given path is absolute ?
What is the Symfony\Component\Filesystem\Filesystem method to dump contents to a file?
Which of the following snippets is valid to set the maximum and minimum value for a Symfony\Component\Form\Extension\Core\Type\RangeType form type ?
Which method of a Symfony\Component\Form\Form instance is the most recommended one to invoke in order to process a form in a Symfony controller?
$form->handleRequest(...);
$form->validate(...);
$form->submit(...);
$form->handleRequest(...);
$form->bind(...);
$form->process(...);
What is the way to get the value of the first_name index of the $person array?
Which solution will match /home/me/myFile.txt file ?
Which solution will match /home/me/myFile.txt file ?
By default, the Finder ignores popular VCS files, what is the method to use them ?
Which solution will match /home/me/myFile.txt file ?
What should ????? be replaced with to add a <title> node with the value of "Hello, World!"?
None of the above
How can you register the AcmeListener to the EventDispatcher in order to call the onFooAction method when the acme.action event is dispatched with the following code?
It's 10AM, which values of $date Symfony\Component\Finder\Finder::date($date) will find a file modified yesterday at 9AM ?
It's 10AM, which values of $date Symfony\Component\Finder\Finder::date($date) will find a file modified yesterday at 9AM ?
With the following service definition how is it possible to access the mailer service?
It is not possible.
How can you control the maximum number of retry attempts with Symfony\Component\HttpClient\RetryableHttpClient?
How to add a DataTransformer to the tags field?
What is the way to enable magic __call method?
Which of the following operators is also known as the Elvis operator?
From which global arrays is it possible to read submitted form data?
$_GET
$_POST
$_POST
$_GET
$_COOKIE
$_REQUEST
$_SESSION
$_ENV
Given you have an already register env var MYVAR=foo in your shell and you load MYVAR=bar from a .env file via the Dotenv component. What will happen ?
$_ENV['MYVAR'] will be equal to bar
getenv('MYVAR') will return bar
$_ENV['MYVAR'] will be equal to bar
$_ENV['MYVAR'] will be equal to foo
getenv('MYVAR') will return bar
an exception will be thrown
getenv('MYVAR') will return foo
Which PHP superglobal variable contains the command line arguments when the script runs in CLI mode?
$_ENV
$_SERVER
$_POST
PHP cannot run from the command line interface.
$_CLI
$_ENV
Which of the following list of potential data sources should be considered trusted ?
$_ENV
$_COOKIE
$_SERVER
None
$_ENV
$_POST
Which of the following Composer commands is recommended to execute on production servers to increase the performance of your Symfony applications?
$ composer dump-autoload --optimize --apc-class-autoload
$ composer optimize-autoload --no-dev
$ composer optimize-autoload
$ composer dump-autoloader --optimize --no-dev
$ composer dump-autoload --optimize --no-dev --classmap-authoritative
$ composer dump-autoload --optimize --apc-class-autoload
How to specify the date format for a date attribute in a serialization context ?
It's not possible
Which of the following allows to give a default value to a route parameter ?
Which of the following allows to give a default value to a route parameter ?
Given the following denormalization attempt:
What will be displayed ?
"symfony"
"symfony"
nothing, an exception will be thrown
an empty string
Which of the following are valid types to use in setAllowedTypes method of Symfony\Component\OptionsResolver\OptionsResolver to validate a integer value?
Which of the following are valid types to use in setAllowedTypes method of Symfony\Component\OptionsResolver\OptionsResolver to validate a boolean value?