Browse Source

Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4

# By Michael Wallner (2) and others
# Via Michael Wallner
* 'PHP-5.4' of https://git.php.net/repository/php-src:
  fix test
  fix memleak on resetting rebind_proc
  Fix bug #65322: compile time errors won't trigger auto loading
  5.4.20 release date
PHP-5.4.21
Christopher Jones 13 years ago
parent
commit
679bf479b6
  1. 5
      NEWS
  2. 22
      Zend/tests/bug65322.phpt
  3. 18
      Zend/tests/errmsg_045.phpt
  4. 4
      Zend/zend.c
  5. 1
      ext/ldap/ldap.c
  6. 20
      ext/ldap/tests/ldap_search_variation6.phpt

5
NEWS

@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.4.21
- Core:
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
- CLI server:
. Fixed bug #65633 (built-in server treat some http headers as
case-sensitive). (Adam)
@ -23,7 +26,7 @@ PHP NEWS
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
imap). (ryotakatsuki at gmail dot com)
?? ??? 2013, PHP 5.4.20
19 Sep 2013, PHP 5.4.20
- Core:
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).

22
Zend/tests/bug65322.phpt

@ -0,0 +1,22 @@
--TEST--
Bug #65322: compile time errors won't trigger auto loading
--FILE--
<?php
spl_autoload_register(function($class) {
var_dump($class);
class B {}
});
set_error_handler(function($_, $msg, $file) {
var_dump($msg, $file);
new B;
});
eval('class A { function a() {} function __construct() {} }');
?>
--EXPECTF--
string(50) "Redefining already defined constructor for class A"
string(%d) "%s(%d) : eval()'d code"
string(1) "B"

18
Zend/tests/errmsg_045.phpt

@ -0,0 +1,18 @@
--TEST--
Error message in error handler during compilation
--FILE--
<?php
set_error_handler(function($_, $msg, $file) {
var_dump($msg, $file);
echo $undefined;
});
eval('class A { function a() {} function __construct() {} }');
?>
--EXPECTF--
string(50) "Redefining already defined constructor for class A"
string(%d) "%s(%d) : eval()'d code"
Notice: Undefined variable: undefined in %s on line %d

4
Zend/zend.c

@ -1183,7 +1183,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
* such scripts recursivly, but some CG() variables may be
* inconsistent. */
in_compilation = zend_is_compiling(TSRMLS_C);
in_compilation = CG(in_compilation);
if (in_compilation) {
saved_class_entry = CG(active_class_entry);
CG(active_class_entry) = NULL;
@ -1195,6 +1195,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
SAVE_STACK(declare_stack);
SAVE_STACK(list_stack);
SAVE_STACK(context_stack);
CG(in_compilation) = 0;
}
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
@ -1219,6 +1220,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
RESTORE_STACK(declare_stack);
RESTORE_STACK(list_stack);
RESTORE_STACK(context_stack);
CG(in_compilation) = 1;
}
if (!EG(user_error_handler)) {

1
ext/ldap/ldap.c

@ -2107,6 +2107,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
/* unregister rebind procedure */
if (ld->rebindproc != NULL) {
zval_dtor(ld->rebindproc);
FREE_ZVAL(ld->rebindproc);
ld->rebindproc = NULL;
ldap_set_rebind_proc(ld->link, NULL, NULL);
}

20
ext/ldap/tests/ldap_search_variation6.phpt

@ -217,14 +217,26 @@ array(2) {
[1]=>
resource(%d) of type (ldap result)
}
NULL
NULL
array(1) {
["count"]=>
int(0)
}
array(1) {
["count"]=>
int(0)
}
array(2) {
[0]=>
resource(%d) of type (ldap result)
[1]=>
resource(%d) of type (ldap result)
}
NULL
NULL
array(1) {
["count"]=>
int(0)
}
array(1) {
["count"]=>
int(0)
}
===DONE===
Loading…
Cancel
Save