php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74898 1
Submitted: 2017-07-11 08:02 UTC Modified: 2017-07-11 08:09 UTC
From: tongsq77 at qq dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.0.21 OS: centos7
Private report: No CVE-ID: None
 [2017-07-11 08:02 UTC] tongsq77 at qq dot com
Description:
------------
i use $str = 1.'abc'; and got Parse error

Test script:
---------------
var_dump(1 . '');//this is ok
var_dump(1.'');  //this cause Parse error

Expected result:
----------------
string(1) "1"
string(1) "1"

Actual result:
--------------
Parse error: syntax error, unexpected ''

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-11 08:09 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2017-07-11 08:09 UTC] requinix@php.net
Because 1. is a number. If there's some bizarre reason making you concatenate 1 and '' then you have to have that space.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC