5.4 has reached end-of-life and will no longer receive
bugfixes or security patches from the PHP Project. Some downstream distributions may still continue to provide
backported fixes for a time, depending on their support policy.
Fixed bug #64660 (Segfault on memory exhaustion within function definition).
calendar
Fixed bug #64895 (Integer overflow in SndToJewish).
fileinfo
Fixed bug #64830 (mimetype detection segfaults on mp3 file).
fpm
Ignore QUERY_STRING when sent in SCRIPT_FILENAME.
Fixed some possible memory or resource leaks and possible null dereference detected by code coverity scan.
Log a warning when a syscall fails.
Add --with-fpm-systemd option to report health to systemd, and systemd_interval option to configure this. The service can now use Type=notify in the systemd unit file.
MySQLi
Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer has closed).
Phar
Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or with non std tmp dir).
snmp
Fixed bug #64765 (Some IPv6 addresses get interpreted wrong).
Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals).
zlib
Fixed bug #61306 (initialization of global inappropriate for ZTS).
Fixed bug #61287 (A particular string fails to decompress).
Fixed bug #61139 (gzopen leaks when specifying invalid mode).
PHP 5.4.0
Released 01 Mar, 2012
installation
autoconf 2.59+ is now supported (and required) for generating the configure script with ./buildconf. Autoconf 2.60+ is desirable otherwise the configure help order may be incorrect.
removed legacy features
break/continue $var syntax.
Safe mode and all related php.ini options.
register_globals and register_long_arrays php.ini options.
import_request_variables().
allow_call_time_pass_reference.
define_syslog_variables php.ini option and its associated function.
highlight.bg php.ini option.
safe_mode, safe_mode_gid, safe_mode_include_dir, safe_mode_exec_dir, safe_mode_allowed_env_vars and safe_mode_protected_env_vars php.ini options.
zend.ze1_compatibility_mode php.ini option.
Session bug compatibility mode (session.bug_compat_42 and session.bug_compat_warn php.ini options).
session_is_registered(), session_register() and session_unregister() functions.
y2k_compliance php.ini option.
magic_quotes_gpc, magic_quotes_runtime and magic_quotes_sybase php.ini options. get_magic_quotes_gpc, get_magic_quotes_runtime are kept but always return false, set_magic_quotes_runtime raises an E_CORE_ERROR.
Removed support for putenv("TZ=..") for setting the timezone.
Removed the timezone guessing algorithm in case the timezone isn't set with date.timezone or date_default_timezone_set(). Instead of a guessed timezone, "UTC" is now used instead.
moved extensions to pecl
ext/sqlite. (Note: the ext/sqlite3 and ext/pdo_sqlite extensions are not affected)
general improvements
Added short array syntax support ([1,2,3]), see UPGRADING guide for full details.
Added binary number format (0b001010).
Added support for Class::{expr}() syntax
Added multibyte support by default. Previously PHP had to be compiled with --enable-zend-multibyte. Now it can be enabled or disabled through the zend.multibyte directive in php.ini.
Removed compile time dependency from ext/mbstring
Added support for Traits.
Added closure $this support back.
Added array dereferencing support.
Added callable typehint.
Added indirect method call through array. FR #47160.
Added DTrace support.
Added class member access on instantiation (e.g. (new foo)->bar()) support.
<?= is now always available regardless of the short_open_tag setting.
Implemented Zend Signal Handling (configurable option --enable-zend-signals, off by default).
Improved output layer, see README.NEW-OUTPUT-API for internals.
Improved UNIX build system to allow building multiple PHP binary SAPIs and one SAPI module the same time. FR #53271, FR #52419.
Implemented closure rebinding as parameter to bindTo.
Improved the warning message of incompatible arguments.
Improved ternary operator performance when returning arrays.
Changed error handlers to only generate docref links when the docref_root php.ini setting is not empty.
Changed silent conversion of array to string to produce a notice.
Changed default encoding from ISO-8859-1 to UTF-8 when not specified in htmlspecialchars and htmlentities.
Changed casting of null/''/false into an Object when adding a property from E_STRICT into a warning.
Changed E_ALL to include E_STRICT.
Disabled Windows CRT warning by default, can be enabled again using the php.ini directive windows_show_crt_warnings.
Fixed bug #55378: Binary number literal returns float number though its value is small enough.
improved zend engine memory usage
Improved parse error messages.
Replaced zend_function.pass_rest_by_reference by ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags.
Replaced zend_function.return_reference by ZEND_ACC_RETURN_REFERENCE in zend_function.fn_flags.
Removed zend_arg_info.required_num_args as it was only needed for internal functions. Now the first arg_info for internal functions is represented by the zend_internal_function_info structure.
Moved zend_op_array.size, size_var, size_literal, current_brk_cont, backpatch_count into CG(context) as they are used only during compilation.
Moved zend_op_array.start_op into EG(start_op) as it's used only for 'interactive' execution of a single top-level op-array.
Replaced zend_op_array.done_pass_two by ZEND_ACC_DONE_PASS_TWO in zend_op_array.fn_flags.
op_array.vars array is trimmed during pass_two.
Replaced zend_class_entry.constants_updated by ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags.
Reduced the size of zend_class_entry by sharing the same memory space by different information for internal and user classes. See zend_class_entry.info union.
Reduced size of temp_variable.
improved zend engine - performance tweaks and optimizations
Inlined most probable code-paths for arithmetic operations directly into executor.
Eliminated unnecessary iterations during request startup/shutdown.
Changed $GLOBALS into a JIT autoglobal, so it's initialized only if used.
Improved performance of @ operator.
Simplified string offset reading. Given $str="abc" then $str[1][0] is now a legal construct.
Added caches to eliminate repeatable run-time bindings of functions, classes, constants, methods and properties.
Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed.
ZEND_RECV now always has IS_CV as its result.
ZEND_CATCH now has to be used only with constant class names.
ZEND_FETCH_DIM_? may fetch array and dimension operands in different order.
Simplified ZEND_FETCH_*_R operations. They can't be used with the EXT_TYPE_UNUSED flag any more. This is a very rare and useless case. ZEND_FREE might be required after them instead.
Split ZEND_RETURN into two new instructions ZEND_RETURN and ZEND_RETURN_BY_REF.
Optimized access to global constants using values with pre-calculated hash_values from the literals table.
Optimized access to static properties using executor specialization. A constant class name may be used as a direct operand of ZEND_FETCH_* instruction without previous ZEND_FETCH_CLASS.
zend_stack and zend_ptr_stack allocation is delayed until actual usage.
other improvements to zend engine
Added an optimization which saves memory and emalloc/efree calls for empty HashTables.
Added ability to reset user opcode handlers .
Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table.
Fixed (disabled) inline-caching for ZEND_OVERLOADED_FUNCTION methods.
improved core functions
Enforce an extended class' __construct arguments to match the abstract constructor in the base class.
Disallow reusing superglobal names as parameter names.
Added optional argument to debug_backtrace() and debug_print_backtrace() to limit the amount of stack frames returned.
Added hex2bin() function.
number_format() no longer truncates multibyte decimal points and thousand separators to the first byte. FR #53457.
Added support for object references in recursive serialize() calls. FR #36424.
Added support for SORT_NATURAL and SORT_FLAG_CASE in array sort functions (sort, rsort, ksort, krsort, asort, arsort and array_multisort). FR#55158
Added stream metadata API support and stream_metadata() stream class handler.
User wrappers can now define a stream_truncate() method that responds to truncation, e.g. through ftruncate(). FR #53888.
Improved unserialize() performance.
Changed array_combine() to return empty array instead of FALSE when both parameter arrays are empty. FR #34857.
Fixed bug #61095 (Incorect lexing of 0x00*+<NUM>).
Fixed bug #60965 (Buffer overflow on htmlspecialchars/entities with $double=false).
Fixed bug #60895 (Possible invalid handler usage in windows random functions).
Fixed bug #60879 (unserialize() Does not invoke __wakeup() on object).
Fixed bug #60825 (Segfault when running symfony 2 tests).
Sanitized return values of existing functions. Now it returns FALSE on failure.
Allow ~infinite OIDs in GET/GETNEXT/SET queries. Autochunk them to max_oids upon request.
Introducing unit tests for extension with ~full coverage.
IPv6 support.
Way of representing OID value can now be changed when SNMP_VALUE_OBJECT is used for value output mode. Use or'ed SNMP_VALUE_LIBRARY(default if not specified) or SNMP_VALUE_PLAIN.
Fixed bug #60749 (SNMP module should not strip non-standard SNMP port from hostname).
Fixed bug #60585 (php build fails with USE flag snmp when IPv6 support is disabled).
Fixed bug #54089 (token_get_all with regards to __halt_compiler is not binary safe).
improved xsl extension
Added XsltProcessor::setSecurityPrefs($options) and getSecurityPrefs() to define forbidden operations within XSLT stylesheets, default is not to enable write operations from XSLT. Bug #54446
XSL doesn't stop transformation anymore, if a PHP function can't be called
improved zlib extension
Re-implemented non-file related functionality.
Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression).
↑ and ↓ to navigate •
Enter to select •
Esc to close • / to open
Press Enter without
selection to search using Google