|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79841 Syntax error in configure / unescaped "[]" in php.m4
Submitted: 2020-07-13 06:44 UTC Modified: 2020-07-13 07:42 UTC
From: rainer dot jung at kippdata dot de Assigned: nikic (profile)
Status: Closed Package: *Compile Issues
PHP Version: 8.0.0alpha2 OS: Any using "configure"
Private report: No CVE-ID: None
 [2020-07-13 06:44 UTC] rainer dot jung at kippdata dot de
"configure" warns:

./configure: line 5571: -z: command not found

The script contains wrong syntax:

 5571      -z "$php_bison_version"  && php_bison_version=0.0.0
 5676      -z "$php_re2c_version"  && php_re2c_version=0.0.0

The root cause is in file build/php.m4 introduced in commit (#78750, GH-5681):

1787     [ -z "$php_bison_version" ] && php_bison_version=0.0.0
1852     [ -z "$php_re2c_version" ] && php_re2c_version=0.0.0

The square brackets need escaping in the m4 macro files. Directly below those lines a different syntax is used. Therefore I suggest to replace the two lines as follows:

    if test -z "$php_bison_version" ; then


    if test -z "$php_re2c_version" ; then

Note that the problematic change also was back-ported to PHP 7.4 after 7.4.8 ( It should be fixed there as well before the next PHP 7.4 release.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-13 07:41 UTC]
Automatic comment on behalf of
Log: Fixed bug #79841
 [2020-07-13 07:41 UTC]
-Status: Open +Status: Closed
 [2020-07-13 07:42 UTC]
-Assigned To: +Assigned To: nikic
 [2020-07-13 07:42 UTC]
I've fixed this in master, but I'm not seeing any any autoconf code using [ -z ] on 7.4.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 03:01:29 2024 UTC