Nuances of String Conversion in PHP

In the previous lesson, we learned how to add numbers as strings. However, there are nuances to such addition when not variables are added, but numbers directly.

The point is that the dot is used not only for string concatenation, but also for separating the fractional part from the integer part.

If you put spaces around the dot, there will be no problems:

php<?php
  echo 1 . 2; // will output '12'
?>

And if you remove the spaces around the dot, we get a float number, not string concatenation:

php<?php
  echo 1.2; // will output 1.2
?>

Because of such nuances, it is easy to get an error if you put a space on one side of the dot and not on the other:

php<?php
  echo 1. 2; // will throw an error
?>

However, with variables, this problem will not occur:

php<?php
  $a = 1;
  $b = 2;
  
  echo $a.$b; // will output '12', not an error
?>
Задание 1

The code author wanted to add numbers 3 and 4 as strings:

php<?php
  echo 3.4;
?>

However, the code does not work correctly. Fix the author's code error.