diff --git a/.travis.yml b/.travis.yml index 044083721..a5a21f55b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ matrix: - php: 7.0 - php: 7.1 - php: 7.2 + - php: 7.3 - php: nightly fast_finish: true diff --git a/doc/filters/json_encode.rst b/doc/filters/json_encode.rst index e93199f63..f02a7a89a 100644 --- a/doc/filters/json_encode.rst +++ b/doc/filters/json_encode.rst @@ -14,11 +14,10 @@ The ``json_encode`` filter returns the JSON representation of a value: Arguments --------- -* ``options``: A bitmask of `json_encode options`_ (``{{ +* ``options``: A bitmask of `json_encode options`_: ``{{ data|json_encode(constant('JSON_PRETTY_PRINT')) }}``. - Combine constants using `Twig's bitwise operators`: ``{{ - data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT') }}``) + Combine constants using :ref:`bitwise operators`: + ``{{ data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT') }}`` .. _`json_encode`: https://secure.php.net/json_encode .. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php -.. _`Twig's bitwise operators`: https://twig.symfony.com/doc/2.x/templates.html#logic diff --git a/doc/templates.rst b/doc/templates.rst index 4205cfb93..792f212fe 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -651,6 +651,8 @@ but exists for completeness' sake. The following operators are supported: * ``**``: Raises the left operand to the power of the right operand. ``{{ 2 ** 3 }}`` would return ``8``. +.. _template_logic: + Logic ~~~~~ @@ -666,7 +668,7 @@ You can combine multiple expressions with the following operators: .. note:: - Twig also support bitwise operators (``b-and``, ``b-xor``, and ``b-or``). + Twig also supports bitwise operators (``b-and``, ``b-xor``, and ``b-or``). .. note:: diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 321b9773f..3d3877875 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -1310,7 +1310,7 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a } } - $result = null; + $result = ''; try { $result = $env->resolveTemplate($template)->render($variables); } catch (Twig_Error_Loader $e) {