Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c3c0f53
Scalar type hints with ZPP casting rules
hikari-no-yume Dec 13, 2014
75a225d
Do not make scalar type hints reserved words, merely reserve class name
hikari-no-yume Dec 27, 2014
d4dd2a9
Use new names of arg parsing functions
hikari-no-yume Dec 29, 2014
a13d134
Refactor scalar type hints implementation per Dmitry's patch
hikari-no-yume Dec 29, 2014
a03af7f
Fix class name prohibition to work for namespaced classes, too
hikari-no-yume Jan 4, 2015
1a28ad0
Forbid scalar type hint names for use, class_alias
hikari-no-yume Jan 6, 2015
5544e37
Inline
hikari-no-yume Jan 6, 2015
cc01e37
It Begins
hikari-no-yume Jan 10, 2015
02ec357
Per-file
hikari-no-yume Jan 12, 2015
fe663cc
Partial ZPP strictness implementation
hikari-no-yume Jan 13, 2015
ca49012
Add strict scalar types test
hikari-no-yume Jan 13, 2015
e1a2386
Shorten syntax to strict_types=1
hikari-no-yume Jan 25, 2015
b112c13
Test strict code calling weak code and vice-versa
hikari-no-yume Jan 25, 2015
2985944
Fix usage of zend_wrong_param_count in ext/mysqli
hikari-no-yume Jan 25, 2015
86b0685
Prefix zend_wrong_param_count with _ to discourage use
hikari-no-yume Jan 25, 2015
17b3707
Test strict code including weak code and vice-versa
hikari-no-yume Jan 25, 2015
c6e8048
Fix fix
hikari-no-yume Jan 25, 2015
187a95f
Test nested strict/weak function calls
hikari-no-yume Jan 25, 2015
0af3b7c
Test behaviour of weak type hints with references
hikari-no-yume Jan 25, 2015
cbbaea0
Fix merge error
hikari-no-yume Jan 29, 2015
c7719ab
Refactor typehint lookup
hikari-no-yume Feb 1, 2015
6b6b2b4
Implement scalar return types (strict only for now)
hikari-no-yume Feb 1, 2015
44ed070
Fix Gd usages of ZEND_WRONG_PARAM_COUNT, add usage note
hikari-no-yume Feb 1, 2015
5a7ac0f
Implement per-file strictness for scalar return types
hikari-no-yume Feb 1, 2015
0294485
Prevent "undefined variable opline" errors
hikari-no-yume Feb 2, 2015
b5513cd
Add scalar return types test
hikari-no-yume Feb 5, 2015
d6bea5b
Fixed use after free on the following code
dstogov Feb 10, 2015
10f03cd
Merge return_types_none_null_distinction
hikari-no-yume Feb 14, 2015
4ab6937
Void return type
hikari-no-yume Feb 14, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 7 additions & 6 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)

- Core:
. Fixed #68933 (Invalid read of size 8 in zend_std_read_property).
. Fixed bug #68933 (Invalid read of size 8 in zend_std_read_property).
(Laruence, arjen at react dot com)
. Fixed #68868 (Segfault in clean_non_persistent_constants() in SugarCRM
. Fixed bug #68868 (Segfault in clean_non_persistent_constants() in SugarCRM
6.5.20). (Laruence)
. Fixed bug #68104 (Segfault while pre-evaluating a disabled function).
(Laruence)
Expand All @@ -19,7 +19,7 @@
. Added PHP_INT_MIN constant. (Andrea)
. Added Closure::call() method. (Andrea)
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
. Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
. Fixed bug #67959 (Segfault when calling phpversion('spl')). (Florian)
. Implemented the RFC `Catchable "Call to a member function bar() on a
non-object"`. (Timm)
. Added options parameter for unserialize allowing to specify acceptable
Expand All @@ -45,6 +45,7 @@
. Invalid octal literals in source code now produce compile errors, fixes PHPSadness #31. (Andrea)
. Removed dl() function on fpm-fcgi. (Nikita)
. Removed support for hexadecimal numeric strings. (Nikita)
. Removed obsolete extensions and SAPIs. See the full list in UPGRADING. (Anatol)

- Curl:
. Fixed bug #68937 (Segfault in curl_multi_exec). (Laruence)
Expand Down Expand Up @@ -94,7 +95,7 @@
+ Opcache). (Laruence)

- OpenSSL:
. Fix bug #61285, #68329, #68046, #41631: encrypted streams don't observe
. Fixed bug #61285, #68329, #68046, #41631: encrypted streams don't observe
socket timeouts (Brad Broerman)

- pcntl:
Expand Down Expand Up @@ -131,12 +132,12 @@
. Fixed bug #68479 (Added escape parameter to SplFileObject::fputcsv). (Salathe)

- Sqlite3:
. Fix bug #68260 (SQLite3Result::fetchArray declares wrong
. Fixed bug #68260 (SQLite3Result::fetchArray declares wrong
required_num_args). (Julien)

- Standard:
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
. Fixed user session handlers (See rfc:session.user.return-value). (Sara)
. Added intdiv() function. (Andrea)
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
. Remove string category support in setlocale(). (Nikita)
Expand Down
21 changes: 19 additions & 2 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PHP X.Y UPGRADE NOTES
5. Changed Functions
6. New Functions
7. New Classes and Interfaces
8. Removed Extensions
8. Removed Extensions and SAPIs
9. Other Changes to Extensions
10. New Global Constants
11. Changes to INI File Handling
Expand Down Expand Up @@ -170,9 +170,26 @@ PHP X.Y UPGRADE NOTES


========================================
8. Removed Extensions
8. Removed Extensions and SAPIs
========================================

- sapi/aolserver
- sapi/apache
- sapi/apache_hooks
- sapi/apache2filter
- sapi/caudium
- sapi/continuity
- sapi/isapi
- sapi/milter
- sapi/phttpd
- sapi/pi3web
- sapi/roxen
- sapi/thttpd
- sapi/tux
- sapi/webjames
- ext/mssql
- ext/sybase_ct
For more details see https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts

========================================
9. Other Changes to Extensions
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug40509.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ var_dump(key($arr["v"]));
int(0)
int(0)
int(0)
NULL
int(0)
2 changes: 1 addition & 1 deletion Zend/tests/bug40705.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ int(0)
int(0)
int(1)
int(2)
NULL
int(0)
42 changes: 42 additions & 0 deletions Zend/tests/bug69017.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--TEST--
#69017 (Fail to push to the empty array with the constant value defined in class scope)
--FILE--
<?php

class c1
{
const ZERO = 0;
const ONE = 1;
const MAX = PHP_INT_MAX;
public static $a1 = array(self::ONE => 'one');
public static $a2 = array(self::ZERO => 'zero');
public static $a3 = array(self::MAX => 'zero');
}


c1::$a1[] = 1;
c1::$a2[] = 1;
c1::$a3[] = 1;

var_dump(c1::$a1);
var_dump(c1::$a2);
var_dump(c1::$a3);
?>
--EXPECTF--
Warning: Cannot add element to the array as the next element is already occupied in %sbug69017.php on line %d
array(2) {
[1]=>
string(3) "one"
[2]=>
int(1)
}
array(2) {
[0]=>
string(4) "zero"
[1]=>
int(1)
}
array(1) {
[%d]=>
string(4) "zero"
}
15 changes: 15 additions & 0 deletions Zend/tests/bug69025.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Bug #69025 (Invalid read of size 4 when calling __callStatic)
--FILE--
<?php
class A {
public static function __callStatic($method, $args)
{
}
}

A::init();
?>
OK
--EXPECT--
OK
71 changes: 71 additions & 0 deletions Zend/tests/foreach_003.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
--TEST--
Iterator exceptions in foreach by value
--FILE--
<?php
class IT implements Iterator {
private $n = 0;
private $count = 0;
private $trap = null;

function __construct($count, $trap = null) {
$this->count = $count;
$this->trap = $trap;
}

function trap($trap) {
if ($trap === $this->trap) {
throw new Exception($trap);
}
}

function rewind() {$this->trap(__FUNCTION__); $this->n = 0;}
function valid() {$this->trap(__FUNCTION__); return $this->n < $this->count;}
function key() {$this->trap(__FUNCTION__); return $this->n;}
function current() {$this->trap(__FUNCTION__); return $this->n;}
function next() {$this->trap(__FUNCTION__); $this->n++;}
}

foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) {
$obj = new IT(3, $trap);
try {
// IS_CV
foreach ($obj as $key => $val) echo "$val\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
unset($obj);

try {
// IS_VAR
foreach (new IT(3, $trap) as $key => $val) echo "$val\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}

try {
// IS_TMP_VAR
foreach ((object)new IT(2, $trap) as $key => $val) echo "$val\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
}
?>
--EXPECT--
rewind
rewind
rewind
valid
valid
valid
key
key
key
current
current
current
0
next
0
next
0
next
65 changes: 65 additions & 0 deletions Zend/tests/foreach_004.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
--TEST--
Iterator exceptions in foreach by reference
--FILE--
<?php
class IT extends ArrayIterator {
private $n = 0;

function __construct($trap = null) {
parent::__construct([0, 1]);
$this->trap = $trap;
}

function trap($trap) {
if ($trap === $this->trap) {
throw new Exception($trap);
}
}

function rewind() {$this->trap(__FUNCTION__); return parent::rewind();}
function valid() {$this->trap(__FUNCTION__); return parent::valid();}
function key() {$this->trap(__FUNCTION__); return parent::key();}
function next() {$this->trap(__FUNCTION__); return parent::next();}
}

foreach(['rewind', 'valid', 'key', 'next'] as $trap) {
$obj = new IT($trap);
try {
// IS_CV
foreach ($obj as $key => &$val) echo "$val\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
unset($obj);

try {
// IS_VAR
foreach (new IT($trap) as $key => &$val) echo "$val\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}

try {
// IS_TMP_VAR
foreach ((object)new IT($trap) as $key => &$val) echo "$val\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
}
?>
--EXPECT--
rewind
rewind
rewind
valid
valid
valid
key
key
key
0
next
0
next
0
next
22 changes: 22 additions & 0 deletions Zend/tests/foreach_005.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
Nested foreach by reference on the same array
--FILE--
<?php
$a = [1,2,3];
foreach($a as &$x) {
foreach($a as &$y) {
echo "$x-$y\n";
$y++;
}
}
?>
--EXPECT--
1-1
2-2
2-3
3-2
3-3
4-4
5-3
5-4
5-5
20 changes: 20 additions & 0 deletions Zend/tests/foreach_006.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Foreach by reference on constant
--FILE--
<?php
for ($i = 0; $i < 3; $i++) {
foreach ([1,2,3] as &$val) {
echo "$val\n";
}
}
?>
--EXPECT--
1
2
3
1
2
3
1
2
3
13 changes: 13 additions & 0 deletions Zend/tests/foreach_007.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
Foreach by reference and inserting new element when we are already at the end
--FILE--
<?php
$a = [1];
foreach($a as &$v) {
echo "$v\n";
$a[1]=2;
}
?>
--EXPECT--
1
2
21 changes: 21 additions & 0 deletions Zend/tests/foreach_008.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
Nested foreach by reference and array modification
--FILE--
<?php
$a = [0, 1, 2, 3];
foreach ($a as &$x) {
foreach ($a as &$y) {
echo "$x - $y\n";
if ($x == 0 && $y == 1) {
unset($a[2]);
unset($a[1]);
}
}
}
?>
--EXPECT--
0 - 0
0 - 1
0 - 3
3 - 0
3 - 3
Loading