Skip to content

Commit

Permalink
Merge branch 'PHP-5.5' of git.php.net:/php-src into PHP-5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes committed Jan 29, 2013
2 parents d7d9ce0 + 3bedc8e commit 078b025
Show file tree
Hide file tree
Showing 67 changed files with 2,678 additions and 336 deletions.
56 changes: 37 additions & 19 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 201?, PHP 5.5.0 Alpha 3
?? ??? 201?, PHP 5.5.0 Beta 1
- Core:
. Fixed bug #60833 (self, parent, static behave inconsistently
case-sensitive). (Stas, mario at include-once dot org)
. Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik).

- cURL:
. Implemented FR #46439 - added CURLFile for safer file uploads.
(Stas)

24 Jan 2013, PHP 5.5.0 Alpha 4

- Core:
. Fixed bug #63980 (object members get trimmed by zero bytes). (Laruence)
. Implemented RFC for Class Name Resolution As Scalar Via "class" Keyword.
(Ralph Schindler, Nikita Popov, Lars)

- DateTime
. Added DateTimeImmutable - a variant of DateTime that only returns the
modified state instead of changing itself. (Derick)

- FPM:
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)

- pgsql:
. Bug #46408: Locale number format settings can cause pg_query_params to
break with numerics. (asmecher, Lars)

- dba:
. Bug #62489: dba_insert not working as expected.
(marc-bennewitz at arcor dot de, Lars)

- Reflection:
. Fixed bug #64007 (There is an ability to create instance of Generator by hand).
(Laruence)

10 Jan 2013, PHP 5.5.0 Alpha 3

- General improvements:
. Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick)
Expand All @@ -19,26 +52,11 @@ PHP NEWS

- cURL:
. Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror
curl_pause, curl_reset, curl_share_close, curl_share_init,
curl_share_setopt curl_strerror and curl_unescape. (Pierrick)
curl_pause, curl_reset, curl_share_close, curl_share_init,
curl_share_setopt curl_strerror and curl_unescape. (Pierrick)
. Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION,
CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE,
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick)

- DateTime
. Added DateTimeImmutable - a variant of DateTime that only returns the
modified state instead of changing itself. (Derick)

- FPM:
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)

- pgsql:
. Bug #46408: Locale number format settings can cause pg_query_params to
break with numerics. (asmecher, Lars)

- dba:
. Bug #62489: dba_insert not working as expected.
(marc-bennewitz at arcor dot de, Lars)
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick)

18 Dec 2012, PHP 5.5.0 Alpha 2

Expand Down
21 changes: 18 additions & 3 deletions README.PARAMETER_PARSING_API
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ Both functions return SUCCESS or FAILURE depending on the result.
The auto-conversions are performed as necessary. Arrays, objects, and
resources cannot be auto-converted.

PHP 5.5 includes a new function:

int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...);

This function behaves like zend_parse_parameters_ex() except that instead of
reading the arguments from the stack, it receives a single zval to convert
(passed with double indirection). The passed zval may be changed in place as
part of the conversion process.

See also https://wiki.php.net/rfc/zpp_improv#expose_zend_parse_arg_as_zend_parse_parameter


Type specifiers
---------------
Expand Down Expand Up @@ -65,9 +76,13 @@ Type specifiers
will not be touched by the parsing function if they are not
passed to it.
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
! - the parameter it follows can be of specified type or NULL (applies
to all specifiers except for 'b', 'l', and 'd'). If NULL is passed, the
results pointer is set to NULL as well.
! - the parameter it follows can be of specified type or NULL. If NULL is
passed and the output for such type is a pointer, then the output
pointer is set to a native NULL pointer.
For 'b', 'l' and 'd', an extra argument of type zend_bool* must be
passed after the corresponding bool*, long* or double* arguments,
respectively. A non-zero value will be written to the zend_bool iif a
PHP NULL is passed.


Note on 64bit compatibility
Expand Down
20 changes: 20 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ PHP 5.5 UPGRADE NOTES
- Drop Windows XP and 2003 support. (Pierre)
- All internal case insensitivity handling for class, function and constant
names is done according to ASCII rules, current locale settings are ignored.
- self, parent & static keywords now are always case-insensitive (see bug
#60833).
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
zend_logo_guid() have been removed
- Removal of Logo GUIDs
Expand Down Expand Up @@ -75,6 +77,8 @@ PHP 5.5 UPGRADE NOTES
for example. (https://wiki.php.net/rfc/empty_isset_exprs)
- Added generators.
(https://wiki.php.net/rfc/generators)
- ClassName::class syntax returning full class name for a class as
a string constant. (https://wiki.php.net/rfc/class_name_scalars)

========================================
2. Changes in SAPI modules
Expand Down Expand Up @@ -149,6 +153,10 @@ PHP 5.5 UPGRADE NOTES
Furthermore both set_error_handler(NULL) and set_exception_handler(NULL) will
now return the previously defined error/exception handler. Previously
bool(true) was returned.
- setcookie(), setrawcookie() and ext/session now send Max-Age headers alongside
Expires headers. (see https://wiki.php.net/rfc/cookie_max-age)
- curl_setopt now accepts new option CURLOPT_SAFE_UPLOAD and CURLFile object for
safer file uploads (see https://wiki.php.net/rfc/curl-file-upload)

========================================
5. New Functions
Expand All @@ -161,6 +169,9 @@ PHP 5.5 UPGRADE NOTES
- password_needs_rehash()
- password_verify()

- cURL:
- curl_file_create

- Hash:
- hash_pbkdf2()

Expand Down Expand Up @@ -261,6 +272,9 @@ PHP 5.5 UPGRADE NOTES
- IntlRuleBasedBreakIterator
- IntlCodePointBreakIterator

- cURL:
- CURLFile

========================================
7. Removed Extensions
========================================
Expand All @@ -280,10 +294,16 @@ PHP 5.5 UPGRADE NOTES
- mysqli:
- Added MYSQLI_SERVER_PUBLIC_KEY constant to be used with mysqli_options()

- cURL:
- Added CURLOPT_SAFE_UPLOAD to be used with curl_setopt().

========================================
10. Changes to INI File Handling
========================================

- Core:
- Added sys_temp_dir INI directive, for specifying temp firectory.

- Intl:
- Added intl.use_exceptions INI directive, which controls what happens when
global errors are set together with intl.error_level.
Expand Down
40 changes: 40 additions & 0 deletions Zend/tests/bug60833.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--TEST--
Bug #60833 (self, parent, static behave inconsistently case-sensitive)
--FILE--
<?php
class A {
static $x = "A";
function testit() {
$this->v1 = new sELF;
$this->v2 = new SELF;
}
}

class B extends A {
static $x = "B";
function testit() {
PARENT::testit();
$this->v3 = new sELF;
$this->v4 = new PARENT;
$this->v4 = STATIC::$x;
}
}
$t = new B();
$t->testit();
var_dump($t);
?>
--EXPECTF--
object(B)#%d (4) {
["v1"]=>
object(A)#%d (0) {
}
["v2"]=>
object(A)#%d (0) {
}
["v3"]=>
object(B)#%d (0) {
}
["v4"]=>
string(1) "B"
}

74 changes: 74 additions & 0 deletions Zend/tests/bug63462.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
--TEST--
Test script to verify that magic methods should be called only once when accessing an unset property.
--CREDITS--
Marco Pivetta <ocramius@gmail.com>
--FILE--
<?php
class Test {
public $publicProperty;
protected $protectedProperty;
private $privateProperty;

public function __construct() {
unset(
$this->publicProperty,
$this->protectedProperty,
$this->privateProperty
);
}

function __get($name) {
echo '__get ' . $name . "\n";
return $this->$name;
}

function __set($name, $value) {
echo '__set ' . $name . "\n";
$this->$name = $value;
}

function __isset($name) {
echo '__isset ' . $name . "\n";
return isset($this->$name);
}
}

$test = new Test();

$test->nonExisting;
$test->publicProperty;
$test->protectedProperty;
$test->privateProperty;
isset($test->nonExisting);
isset($test->publicProperty);
isset($test->protectedProperty);
isset($test->privateProperty);
$test->nonExisting = 'value';
$test->publicProperty = 'value';
$test->protectedProperty = 'value';
$test->privateProperty = 'value';

?>

--EXPECTF--
__get nonExisting

Notice: Undefined property: Test::$nonExisting in %s on line %d
__get publicProperty

Notice: Undefined property: Test::$publicProperty in %s on line %d
__get protectedProperty

Notice: Undefined property: Test::$protectedProperty in %s on line %d
__get privateProperty

Notice: Undefined property: Test::$privateProperty in %s on line %d
__isset nonExisting
__isset publicProperty
__isset protectedProperty
__isset privateProperty
__set nonExisting
__set publicProperty
__set protectedProperty
__set privateProperty

77 changes: 77 additions & 0 deletions Zend/tests/class_name_as_scalar.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
--TEST--
class name as scalar from ::class keyword
--FILE--
<?php

namespace Foo\Bar {
class One {
// compile time constants
const A = self::class;
const B = Two::class;
}
class Two extends One {
public static function run() {
var_dump(self::class); // self compile time lookup
var_dump(static::class); // runtime lookup
var_dump(parent::class); // runtime lookup
var_dump(Baz::class); // default compile time lookup
}
}
class Three extends Two {
// compile time static lookups
public static function checkCompileTime(
$one = self::class,
$two = Baz::class,
$three = One::A,
$four = self::B
) {
var_dump($one, $two, $three, $four);
}
}
echo "In NS\n";
var_dump(Moo::CLASS); // resolve in namespace
}

namespace {
use Bee\Bop as Moo,
Foo\Bar\One;
echo "Top\n";
var_dump(One::class); // resolve from use
var_dump(Boo::class); // resolve in global namespace
var_dump(Moo::CLASS); // resolve from use as
var_dump(\Moo::Class); // resolve fully qualified
$class = One::class; // assign class as scalar to var
$x = new $class; // create new class from original scalar assignment
var_dump($x);
Foo\Bar\Two::run(); // resolve runtime lookups
echo "Parent\n";
Foo\Bar\Three::run(); // resolve runtime lookups with inheritance
echo "Compile Check\n";
Foo\Bar\Three::checkCompileTime();
}

?>
--EXPECTF--
In NS
string(11) "Foo\Bar\Moo"
Top
string(11) "Foo\Bar\One"
string(3) "Boo"
string(7) "Bee\Bop"
string(3) "Moo"
object(Foo\Bar\One)#1 (0) {
}
string(11) "Foo\Bar\Two"
string(11) "Foo\Bar\Two"
string(11) "Foo\Bar\One"
string(11) "Foo\Bar\Baz"
Parent
string(11) "Foo\Bar\Two"
string(13) "Foo\Bar\Three"
string(11) "Foo\Bar\One"
string(11) "Foo\Bar\Baz"
Compile Check
string(13) "Foo\Bar\Three"
string(11) "Foo\Bar\Baz"
string(11) "Foo\Bar\One"
string(11) "Foo\Bar\Two"
13 changes: 13 additions & 0 deletions Zend/tests/class_name_as_scalar_error_001.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
class name as scalar from ::class keyword error using static in class constant
--FILE--
<?php

namespace Foo\Bar {
class One {
const Baz = static::class;
}
}
?>
--EXPECTF--
Fatal error: static::class cannot be used for compile-time class name resolution in %s on line %d
13 changes: 13 additions & 0 deletions Zend/tests/class_name_as_scalar_error_002.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
class name as scalar from ::class keyword error using parent in class constant
--FILE--
<?php

namespace Foo\Bar {
class One {
const Baz = parent::class;
}
}
?>
--EXPECTF--
Fatal error: parent::class cannot be used for compile-time class name resolution in %s on line %d
Loading

0 comments on commit 078b025

Please sign in to comment.