Create new instances with every call of a Symfony service

Code
<?php

use Symfony\Component\DependencyInjection\ContainerInterface;
use 
Symfony\Component\DependencyInjection\ContainerBuilder;
use 
Symfony\Component\DependencyInjection\Definition;
use 
Symfony\Component\DependencyInjection\Reference;

class 
Foo
{
}

class 
Bar
{
}

$fooDefinition = new Definition('Foo');
// In 2.X it was setScope() set to prototype
$fooDefinition->setShared(false);

$barDefinition = new Definition('Bar');

// set definitions in container builder
$containerBuilder = new ContainerBuilder();
$containerBuilder->setDefinition('foo'$fooDefinition);
$containerBuilder->setDefinition('bar'$barDefinition);

// calling bar service
$bar1 $containerBuilder->get('bar');
$bar2 $containerBuilder->get('bar');
var_dump($bar1 === $bar2);

// calling foo service
$foo1 $containerBuilder->get('foo');
$foo2 $containerBuilder->get('foo');
var_dump($foo1 === $foo2);
Result
bool(true)
bool(false)