|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2017-01-24 10:42 UTC] nikic@php.net
  [2017-01-24 13:47 UTC] andrew dot nester dot dev at gmail dot com
  [2017-01-26 09:05 UTC] krakjoe@php.net
  [2017-01-26 09:05 UTC] krakjoe@php.net
 
-Status: Open
+Status: Closed
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
Description: ------------ This happens when a constant is define()d to be a value with the type resource. This affects php 7.0.14 and 7.1.0 and 7.1.1, other versions weren't tested. php-config used: --prefix [/php-7.1.1-install] --includes [-I/php-7.1.1-install/include/php -I/php-7.1.1-install/include/php/main -I/php-7.1.1-install/include/php/TSRM -I/php-7.1.1-install/include/php/Zend -I/php-7.1.1-install/include/php/ext -I/php-7.1.1-install/include/php/ext/date/lib] --ldflags [ -L/usr/lib/x86_64-linux-gnu] --libs [-lcrypt -lexslt -ltidy -lresolv -lcrypt -lreadline -ltermcap -lrt -lstdc++ -lpng -lz -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl -lapparmor -lpthread -lxml2 -lssl -lcrypto -lcurl -lxml2 -licui18n -licuuc -licudata -licuio -lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lxslt -lxml2 -lcrypt ] --extension-dir [/php-7.1.1-install/lib/php/extensions/debug-zts-20160303] --include-dir [/php-7.1.1-install/include/php] --man-dir [/php-7.1.1-install/php/man] --php-binary [/php-7.1.1-install/bin/php] --php-sapis [ cli fpm phpdbg cgi] --configure-options [--prefix=/php-7.1.1-install --enable-debug --enable-maintainer-zts --enable-fpm --enable-intl --with-pear --with-gd --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-curl --with-tidy --with-xmlrpc --enable-sysvsem --enable-sysvshm --enable-shmop --enable-pcntl --with-readline --enable-mbstring --with-gettext --enable-sockets --with-bz2 --with-openssl --enable-bcmath --enable-sysvmsg] --version [7.1.1] --vernum [70101] Test script: --------------- // In CLI, with --enable-debug --enable-maintainer-zts define('myerr', fopen('php://stderr', 'w')); var_dump(myerr); // resource(2) of type (stream) debug_zval_dump(myerr); // php: /php-7.1.1/Zend/zend_types.h:822: zval_refcount_p: Assertion `(((*(pz)).u1.v.type_flags & (1<<2)) != 0) || // (((*(pz)).u1.v.type_flags & (1<<1)) != 0)' failed. // [1] 4964 abort /php-7.1.1-install/bin/php -a Expected result: ---------------- debug_zval_dump should print information about constant resource and reference counting information without crashing. (When compiled with --enable-debug) Actual result: -------------- php crashes because of an assertion error when debug_zval_dump is called with a resource assigned to a constant. (Only when compiled with --enable-debug)