Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5388] change echo and print in examples #5452

Merged
merged 3 commits into from
Jun 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/expression_language/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
// the parse() method returns a ParsedExpression
$expression = $language->parse('1 + 4', array());

echo $language->evaluate($expression); // prints 5
var_dump($language->evaluate($expression)); // prints 5

.. code-block:: php

Expand All @@ -68,7 +68,7 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
serialize($language->parse('1 + 4', array()))
);

echo $language->evaluate($expression); // prints 5
var_dump($language->evaluate($expression)); // prints 5

.. _DoctrineBridge: https://github.com/symfony/DoctrineBridge
.. _`doctrine cache library`: http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/caching.html
3 changes: 2 additions & 1 deletion components/expression_language/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This method has 3 arguments:
return strtolower($str);
});

echo $language->evaluate('lowercase("HELLO")');
var_dump($language->evaluate('lowercase("HELLO")'));

This will print ``hello``. Both the **compiler** and **evaluator** are passed
an ``arguments`` variable as their first argument, which is equal to the
Expand Down Expand Up @@ -126,3 +126,4 @@ or by using the second argument of the constructor::
parent::__construct($parser, $providers);
}
}

8 changes: 4 additions & 4 deletions components/expression_language/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ The main class of the component is

$language = new ExpressionLanguage();

echo $language->evaluate('1 + 2'); // displays 3
var_dump($language->evaluate('1 + 2')); // displays 3

echo $language->compile('1 + 2'); // displays (1 + 2)
var_dump($language->compile('1 + 2')); // displays (1 + 2)

Expression Syntax
-----------------
Expand All @@ -96,12 +96,12 @@ PHP type (including objects)::
$apple = new Apple();
$apple->variety = 'Honeycrisp';

echo $language->evaluate(
var_dump($language->evaluate(
'fruit.variety',
array(
'fruit' => $apple,
)
);
));

This will print "Honeycrisp". For more information, see the :doc:`/components/expression_language/syntax`
entry, especially :ref:`component-expression-objects` and :ref:`component-expression-arrays`.
Expand Down
24 changes: 12 additions & 12 deletions components/expression_language/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ to JavaScript::
$apple = new Apple();
$apple->variety = 'Honeycrisp';

echo $language->evaluate(
var_dump($language->evaluate(
'fruit.variety',
array(
'fruit' => $apple,
)
);
));

This will print out ``Honeycrisp``.

Expand All @@ -72,12 +72,12 @@ JavaScript::

$robot = new Robot();

echo $language->evaluate(
var_dump($language->evaluate(
'robot.sayHi(3)',
array(
'robot' => $robot,
)
);
));

This will print out ``Hi Hi Hi!``.

Expand All @@ -93,9 +93,9 @@ constant::

define('DB_USER', 'root');

echo $language->evaluate(
var_dump($language->evaluate(
'constant("DB_USER")'
);
));

This will print out ``root``.

Expand All @@ -114,12 +114,12 @@ array keys, similar to JavaScript::

$data = array('life' => 10, 'universe' => 10, 'everything' => 22);

echo $language->evaluate(
var_dump($language->evaluate(
'data["life"] + data["universe"] + data["everything"]',
array(
'data' => $data,
)
);
));

This will print out ``42``.

Expand All @@ -140,14 +140,14 @@ Arithmetic Operators

For example::

echo $language->evaluate(
var_dump($language->evaluate(
'life + universe + everything',
array(
'life' => 10,
'universe' => 10,
'everything' => 22,
)
);
));

This will print out ``42``.

Expand Down Expand Up @@ -230,13 +230,13 @@ String Operators

For example::

echo $language->evaluate(
var_dump($language->evaluate(
'firstName~" "~lastName',
array(
'firstName' => 'Arthur',
'lastName' => 'Dent',
)
);
));

This would print out ``Arthur Dent``.

Expand Down
2 changes: 1 addition & 1 deletion components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ having unique identifiers::
});

$serializer = new Serializer(array($normalizer), array($encoder));
echo $serializer->serialize($org, 'json');
var_dump($serializer->serialize($org, 'json'));
// {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"}]}

JMSSerializer
Expand Down