php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76112 Unable to compile ibm_db2.c:5106:107: error: ‘IS_TYPE_IMMUTABLE’ undeclared
Submitted: 2018-03-19 08:07 UTC Modified: 2018-08-14 06:40 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: guy dot baconniere at applic8 dot com Assigned: vnkbabu (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.2.3 OS: 18.04 LTS (Bionic Beaver)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: guy dot baconniere at applic8 dot com
New email:
PHP Version: OS:

 

 [2018-03-19 08:07 UTC] guy dot baconniere at applic8 dot com
Description:
------------

Unable to compile ibm_db2 with any PHP 7.2 branch
due to removal of IS_TYPE_IMMUTABLE from php-src/Zend/zend.h

http://php.net/ChangeLog-7.php

Version 7.2.0
30 Nov 2017

Core: 
Removed IS_TYPE_IMMUTABLE (it's the same as COPYABLE & !REFCOUNTED).
(Dmitry)

Check https://bugs.php.net/bug.php?id=76021 for the full log
This ticket is about the missing IS_TYPE_IMMUTABLE while
76021 is about the warning warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]



Test script:
---------------
Install Ubuntu 18.04 http://cdimage.ubuntu.com/ubuntu-server/daily/current/
and run

pecl install ibm_db2

with any version of DB2 DS Driver (IBM Data Server Driver)

DB2 Installation Directory? : /opt/ibm/dsdriver
from ibm_data_server_driver_package_linuxx64_v11.1.tar.gz

DB2 Installation Directory? : /opt/ibm/dsdriver
from ibm_data_server_driver_package_linuxx64_v10.5.tar.gz


Expected result:
----------------
Compile correctly

Actual result:
--------------
/tmp/pear/temp/ibm_db2/ibm_db2.c:5106:107: error: ‘IS_TYPE_IMMUTABLE’ undeclared (first use in this function); did you mean ‘IS_ARRAY_IMMUTABLE’?
     if (parameters_array && Z_TYPE_P(parameters_array) == IS_ARRAY && (Z_TYPE_FLAGS_P(parameters_array) & IS_TYPE_IMMUTABLE)) {
                                                                                                           ^~~~~~~~~~~~~~~~~
                                                                                                           IS_ARRAY_IMMUTABLE
/tmp/pear/temp/ibm_db2/ibm_db2.c:5106:107: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/ibm_db2/ibm_db2.c: In function ‘zif_db2_execute_many’:
/tmp/pear/temp/ibm_db2/ibm_db2.c:7820:77: error: ‘IS_TYPE_IMMUTABLE’ undeclared (first use in this function); did you mean ‘IS_ARRAY_IMMUTABLE’?
     if (params && Z_TYPE_P(params) == IS_ARRAY && (Z_TYPE_FLAGS_P(params) & IS_TYPE_IMMUTABLE)) {
                                                                             ^~~~~~~~~~~~~~~~~
                                                                             IS_ARRAY_IMMUTABLE


Patches

ibm_db2_IS_TYPE_IMMUTABLE.patch (last revision 2018-03-19 09:05 UTC by guy dot baconniere at applic8 dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-19 08:40 UTC] guy dot baconniere at applic8 dot com
-Summary: ibm_db2.c:5106:107: error: ‘IS_TYPE_IMMUTABLE’ undeclared +Summary: guy.baconniere@applic8.com
 [2018-03-19 08:40 UTC] guy dot baconniere at applic8 dot com
git log -S IS_TYPE_IMMUTABLE

git diff 3e9bb03a62393d7bad1a0261b7a312c2ced8aac0

  e. IS_TYPE_IMMUTABLE is removed, IS_TYPE_COPYABLE can be used instead
     Z_IMMUTABLE() check function is still available

commit 6499162ff0d8aa6e862d3e3cdd2288b87636b8a1
Date:   Thu Apr 28 04:13:34 2016 +0300

    - get rid of EG(scope). zend_get_executed_scope() should be used instead.
    - ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.

git diff 6499162ff0d8aa6e862d3e3cdd2288b87636b8a1 | less

--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h

 /* zval.u1.v.type_flags */
-#define IS_TYPE_CONSTANT                       (1<<0)
-#define IS_TYPE_IMMUTABLE                      (1<<1)
-#define IS_TYPE_REFCOUNTED                     (1<<2)
-#define IS_TYPE_COLLECTABLE                    (1<<3)
-#define IS_TYPE_COPYABLE                       (1<<4)
+#define IS_TYPE_REFCOUNTED                     (1<<0)
+
+#if 1
+/* This optimized version assumes that we have a single "type_flag" */
+# define Z_TYPE_INFO_REFCOUNTED(t)     (((t) & Z_TYPE_FLAGS_MASK) != 0)
+#else
+# define Z_TYPE_INFO_REFCOUNTED(t)     (((t) & (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) != 0)
+#endif
 [2018-03-19 08:47 UTC] guy dot baconniere at applic8 dot com
-Summary: guy.baconniere@applic8.com +Summary: Unable to compile ibm_db2.c:5106:107: error: ‘IS_TYPE_IMMUTABLE’ undeclared
 [2018-03-19 08:47 UTC] guy dot baconniere at applic8 dot com
/* array flags */
-#define IS_ARRAY_IMMUTABLE                     (1<<1) /* the same as IS_TYPE_IMMUTABLE */
+#define IS_ARRAY_IMMUTABLE                     GC_IMMUTABLE
+#define IS_ARRAY_PERSISTENT                    GC_PERSISTENT
 [2018-03-19 09:06 UTC] guy dot baconniere at applic8 dot com
A possible workaround is to replace IS_TYPE_IMMUTABLE with IS_ARRAY_IMMUTABLE

git clone https://git.php.net/repository/pecl/database/ibm_db2.git
cd ibm_db2
phpize --clean
phpize
./configure --with-php-config=/usr/bin/php-config --with-IBM_DB2=/opt/ibm/dsdriver
perl -p -i -e 's/IS_TYPE_IMMUTABLE/IS_ARRAY_IMMUTABLE/g' ibm_db2.c
make
make install
ls -la /usr/lib/php/20170718/ibm_db2.so
 [2018-03-22 15:03 UTC] sford_kc at hotmail dot com
I'm having the same issue on Debian 9 with DB2 10.5 FP 9 WSE and PHP 7.2.3. Cannot PECL install, nor compile on my owh - fails on make with the same errors below.
 [2018-03-22 15:37 UTC] guy dot baconniere at applic8 dot com
If you are using PECL you can use the following workaround:

pecl bundle ibm_db2
cd ibm_db2
phpize --clean
phpize
./configure --with-php-config=/usr/bin/php-config --with-IBM_DB2=/opt/ibm/dsdriver
perl -p -i -e 's/IS_TYPE_IMMUTABLE/IS_ARRAY_IMMUTABLE/g' ibm_db2.c
make
make install
 [2018-08-14 06:40 UTC] vnkbabu@php.net
Released the ibm_db2 module with php 7.2 support.
 [2018-08-14 06:40 UTC] vnkbabu@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: vnkbabu
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC