Print INT_MIN as -INT_MAX-1 to avoid it getting parsed as a float
literal due to integer overflow.
custom wrapper). (Laruence)
. Fixed bug #77669 (Crash in extract() when overwriting extracted array).
(Nikita)
+ . Fixed bug #76717 (var_export() does not create a parsable value for
+ PHP_INT_MIN). (Nikita)
07 Mar 2019, PHP 7.2.16
--- /dev/null
+--TEST--
+Bug #76717: var_export() does not create a parsable value for PHP_INT_MIN
+--FILE--
+<?php
+
+$min = eval('return '.var_export(PHP_INT_MIN, true).';');
+$max = eval('return '.var_export(PHP_INT_MAX, true).';');
+var_dump($min === PHP_INT_MIN);
+var_dump($max === PHP_INT_MAX);
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
smart_str_appendl(buf, "NULL", 4);
break;
case IS_LONG:
+ /* INT_MIN as a literal will be parsed as a float. Emit something like
+ * -9223372036854775807-1 to avoid this. */
+ if (Z_LVAL_P(struc) == ZEND_LONG_MIN) {
+ smart_str_append_long(buf, ZEND_LONG_MIN+1);
+ smart_str_appends(buf, "-1");
+ break;
+ }
smart_str_append_long(buf, Z_LVAL_P(struc));
break;
case IS_DOUBLE: