Strange echo, print behaviour in PHP?

前端 未结 4 2057
半阙折子戏
半阙折子戏 2020-12-02 00:57

The following code outputs 43211, why?

  echo print(\'3\').\'2\'.print(\'4\');
4条回答
  •  -上瘾入骨i
    2020-12-02 01:38

    print is returning 1

    On the documentation

    Return Values: Returns 1, always.

    You should just probably stick to using echo.

提交回复
热议问题