mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 19:20:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef52cac05 |
No files matched your search
+5
-4
@@ -1,9 +1,10 @@
|
||||
language: php
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /^PHP-5\.3.*/
|
||||
- /^PHP-5\.4.*/
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script: exit 0
|
||||
+6
-9
@@ -45,17 +45,14 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
|
||||
changes now.
|
||||
|
||||
PHP-5.1 This branch is closed.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ resources cannot be auto-converted.
|
||||
Type specifiers
|
||||
---------------
|
||||
The following list shows the type specifier, its meaning and the parameter
|
||||
types that need to be passed by address. All passed parameters are set
|
||||
types that need to be passed by address. All passed paramaters are set
|
||||
if the PHP parameter is non optional and untouched if optional and the
|
||||
parameter is not present. The only exception is O where the zend_class_entry*
|
||||
has to be provided on input and is used to verify the PHP parameter is an
|
||||
|
||||
@@ -154,15 +154,7 @@ origin <branch>``".
|
||||
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
12. Commit those two tarballs to web/php-distributions.git, then update the git
|
||||
submodule reference in web/php.git:
|
||||
git submodule init;
|
||||
git submodule update;
|
||||
cd distributions;
|
||||
git pull origin master;
|
||||
cd ..;
|
||||
git commit distributions;
|
||||
git push;
|
||||
12. Commit those two tarballs to Git (php-distributions.git)
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
Failed tests usualy indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
|
||||
@@ -640,9 +640,6 @@ c. New functions
|
||||
- SPL
|
||||
- class_uses()
|
||||
|
||||
- SplFixedArray
|
||||
- SplFixedArray::__wakeup() (5.4.18)
|
||||
|
||||
d. New global constants
|
||||
|
||||
- CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ fields and using different execution methods (call threading, switch threading
|
||||
and direct threading). As a result ZE2 got more than 20% speedup on raw PHP
|
||||
code execution (with specialized executor and direct threading execution
|
||||
method). As in most PHP applications raw execution speed isn't the limiting
|
||||
factor but system calls and database calls are, your mileage with this patch
|
||||
factor but system calls and database callls are, your mileage with this patch
|
||||
will vary.
|
||||
|
||||
Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can
|
||||
|
||||
+3
-3
@@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
|
||||
that of other object-oriented languages, such as Java: When the
|
||||
last reference to an object is destroyed the object's
|
||||
destructor, which is a class method name __destruct() that
|
||||
receives no parameters, is called before the object is freed
|
||||
recieves no parameters, is called before the object is freed
|
||||
from memory.
|
||||
|
||||
Example:
|
||||
@@ -1136,7 +1136,7 @@ Changes in the Zend Engine 1.0
|
||||
(supports breakpoints, expression evaluation, step-in/over,
|
||||
function call backtrace, and more).
|
||||
|
||||
The Zend Engine claims 100% compatibility with the engine of PHP
|
||||
The Zend Engine claims 100% compatability with the engine of PHP
|
||||
3.0, and is shamelessly lying about it. Here's why:
|
||||
|
||||
* Static variable initializers only accept scalar values
|
||||
@@ -1161,6 +1161,6 @@ Changes in the Zend Engine 1.0
|
||||
printed the letter { and the contents of the variable $somevar in
|
||||
PHP 3.0), it will result in a parse error with the Zend Engine.
|
||||
In this case, you would have to change the code to print
|
||||
"\{$somevar"; This incompatibility is due to the full variable
|
||||
"\{$somevar"; This incompatability is due to the full variable
|
||||
reference within quoted strings feature added in the Zend
|
||||
Engine.
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ var_dump($global_var);
|
||||
test_unset3();
|
||||
var_dump($global_var);
|
||||
|
||||
//Note: No error conditions relating to passing arguments can be tested
|
||||
//Note: No error conditions relating to passing arugments can be tested
|
||||
// because these are not functions but statements, it will result in syntax error.
|
||||
?>
|
||||
===DONE===
|
||||
|
||||
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
|
||||
fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d
|
||||
|
||||
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
|
||||
Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d
|
||||
===DONE===
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32428 (The @ warning error suppression operator is broken)
|
||||
Bug #32428 (The @ warning error supression operator is broken)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = @$not_exists;
|
||||
|
||||
@@ -4,7 +4,6 @@ test of larger than 8kb text file being parsed by require statement
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
error(require(notfound.php): failed to open stream: No such file or directory)
|
||||
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #62343 (Show class_alias In get_declared_classes())
|
||||
--FILE--
|
||||
<?php
|
||||
class a { }
|
||||
class_alias("a", "b");
|
||||
$c = get_declared_classes();
|
||||
var_dump(end($c));
|
||||
var_dump(prev($c));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "b"
|
||||
string(1) "a"
|
||||
@@ -1,74 +0,0 @@
|
||||
--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
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63882 (zend_std_compare_objects crash on recursion)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test { public $x = 5; }
|
||||
|
||||
$testobj1 = new Test;
|
||||
$testobj2 = new Test;
|
||||
$testobj1->x = $testobj1;
|
||||
$testobj2->x = $testobj2;
|
||||
|
||||
var_dump($testobj1 == $testobj2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php on line 9
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63976 (Parent class incorrectly using child constant in class property)
|
||||
--FILE--
|
||||
<?php
|
||||
if (1) {
|
||||
class Foo {
|
||||
const TABLE = "foo";
|
||||
public $table = self::TABLE;
|
||||
}
|
||||
}
|
||||
if (1) {
|
||||
class Bar extends Foo {
|
||||
const TABLE = "bar";
|
||||
}
|
||||
}
|
||||
$bar = new Bar();
|
||||
var_dump($bar->table);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63982 (isset() inconsistently produces a fatal error on protected property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
protected $protectedProperty;
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
var_dump(isset($test->protectedProperty));
|
||||
var_dump(isset($test->protectedProperty->foo));
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (get_class_methods() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
}
|
||||
}
|
||||
print_r(get_class_methods("A"));
|
||||
print_r(get_class_methods("B"));
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
@@ -1,58 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T1;
|
||||
public function test() { $this->backtrace(); }
|
||||
}
|
||||
|
||||
class B {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
}
|
||||
|
||||
trait T1 {
|
||||
protected function backtrace() {
|
||||
$b = new B();
|
||||
$b->Bmethod();
|
||||
}
|
||||
}
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1));
|
||||
}
|
||||
}
|
||||
$a = new A();
|
||||
$a->test();
|
||||
|
||||
$c = new C();
|
||||
$c->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->Bmethod();
|
||||
$a->t2method();
|
||||
|
||||
$c = new C();
|
||||
$c->Bmethod();
|
||||
$c->t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
#0 C->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public static function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public static function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
A::Bmethod();
|
||||
A::t2method();
|
||||
|
||||
C::Bmethod();
|
||||
C::t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
#0 C::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64354 (Unserialize array of objects whose class can't be autoloaded fail)
|
||||
--FILE--
|
||||
<?php
|
||||
class B implements Serializable {
|
||||
public function serialize() {
|
||||
throw new Exception("serialize");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function unserialize($data) {
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(new B);
|
||||
|
||||
try {
|
||||
serialize($data);
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(9) "serialize"
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64417 (BC break: ArrayAccess::&offsetGet() in a trait causes fatal error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait aa {
|
||||
private $container = array();
|
||||
public function offsetSet($offset, $value) {
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
public function &offsetGet($offset) {
|
||||
$result = null;
|
||||
if (isset($this->container[$offset])) {
|
||||
$result = &$this->container[$offset];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
class obj implements ArrayAccess {
|
||||
use aa;
|
||||
}
|
||||
|
||||
$o = new obj;
|
||||
$o['x'] = 1;
|
||||
++$o['x'];
|
||||
echo $o['x'], "\n";
|
||||
--EXPECT--
|
||||
2
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($unused = null, $unused = null, $arg = array()) {
|
||||
return 1;
|
||||
}
|
||||
foo();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $err) { var_dump($err); });
|
||||
|
||||
function x($s) { $s['a'] = 1; };
|
||||
$y = '1';
|
||||
x($y);
|
||||
print_r($y);
|
||||
--EXPECTF--
|
||||
string(25) "Illegal string offset 'a'"
|
||||
1
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64660 (Segfault on memory exhaustion within function definition)
|
||||
--FILE--
|
||||
<?php
|
||||
function a() {
|
||||
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[Line truncated
|
||||
}
|
||||
echo "Done\n";
|
||||
--EXPECTF--
|
||||
|
||||
Parse error: memory exhausted in %s on line %d
|
||||
@@ -1,48 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64720 (SegFault on zend_deactivate)
|
||||
--FILE--
|
||||
<?php
|
||||
class Stat {
|
||||
private static $requests;
|
||||
public static function getInstance() {
|
||||
if (!isset(self::$requests[1])) {
|
||||
self::$requests[1] = new self();
|
||||
}
|
||||
return self::$requests[1];
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
unset(self::$requests[1]);
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
Stat::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Error {
|
||||
private $trace;
|
||||
public function __construct() {
|
||||
$this->trace = debug_backtrace(1);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public function __destruct() {
|
||||
Stat::getInstance();
|
||||
new Error();
|
||||
}
|
||||
|
||||
public function test() {
|
||||
new Error();
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$bar = new Bar();
|
||||
$bar->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->message = NULL;
|
||||
$this->string = NULL;
|
||||
$this->code = array();
|
||||
$this->line = "hello";
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
$this->file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in :0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in Unknown on line %d
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64960 (Segfault in gc_zval_possible_root)
|
||||
--FILE--
|
||||
<?php
|
||||
// this makes ob_end_clean raise an error
|
||||
ob_end_flush();
|
||||
|
||||
class ExceptionHandler {
|
||||
public function __invoke (Exception $e)
|
||||
{
|
||||
// this triggers the custom error handler
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
// this must be a class, closure does not trigger segfault
|
||||
set_exception_handler(new ExceptionHandler());
|
||||
|
||||
// exception must be throwed from error handler.
|
||||
set_error_handler(function()
|
||||
{
|
||||
$e = new Exception;
|
||||
$e->_trace = debug_backtrace();
|
||||
|
||||
throw $e;
|
||||
});
|
||||
|
||||
// trigger error handler
|
||||
$a['waa'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
|
||||
#1 %sbug64960.php(9): ob_end_clean()
|
||||
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
|
||||
#3 {main}
|
||||
thrown in %sbug64960.php on line 19
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
|
||||
|
||||
function test($func) {
|
||||
$a = $func("");
|
||||
return true;
|
||||
}
|
||||
class A {
|
||||
public function b() {
|
||||
test("strlen");
|
||||
test("iterator_apply");
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->b();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
|
||||
Stack trace:
|
||||
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
|
||||
#1 %sbug64966.php(6): iterator_apply('')
|
||||
#2 %sbug64966.php(12): test('iterator_apply')
|
||||
#3 %sbug64966.php(17): A->b()
|
||||
#4 {main}
|
||||
thrown in %sbug64966.php on line 3
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64988 (Class loading order affects E_STRICT warning)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Base1 {
|
||||
public function insert(array $data){
|
||||
return array_reverse($data);
|
||||
}
|
||||
}
|
||||
|
||||
class Noisy1 extends Base1 {
|
||||
public function insert(array $data, $option1 = Null) {
|
||||
if (!empty($option1)) {
|
||||
$data['option1'] = $option1;
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
||||
class Smooth1 extends Noisy1 {
|
||||
public function insert(array $data) {
|
||||
return parent::insert($data, count($data));
|
||||
}
|
||||
}
|
||||
|
||||
$o = new Smooth1();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
|
||||
okey
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65108 (is_callable() triggers Fatal Error)
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private function f() {}
|
||||
static function __callStatic($name, $args) {}
|
||||
}
|
||||
|
||||
class B {
|
||||
public function B() {
|
||||
$isCallable = is_callable(array(new C, 'f'));
|
||||
var_dump($isCallable);
|
||||
}
|
||||
}
|
||||
|
||||
new B();
|
||||
|
||||
Class E {
|
||||
private function f() {}
|
||||
function __call($name, $args) {}
|
||||
}
|
||||
$isCallable = is_callable(array('E', 'f'));
|
||||
var_dump($isCallable);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
eval("namespace ns_test; class test {}");
|
||||
|
||||
throw new \Exception('abcd');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
\ns_test\test::go();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo 'caught';
|
||||
}
|
||||
--EXPECT--
|
||||
caught
|
||||
@@ -3,7 +3,7 @@ Closure 044: Scope/bounding combination invariants; non static closures
|
||||
--FILE--
|
||||
<?php
|
||||
/* A non-static closure has a bound instance if it has a scope
|
||||
* and doesn't have an instance if it has no scope */
|
||||
* and does't have an instance if it has no scope */
|
||||
|
||||
$nonstaticUnscoped = function () { var_dump(isset(A::$priv)); var_dump(isset($this)); };
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 007: Unreferenced array cycle
|
||||
GC 007: Unreferensed array cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 008: Unreferenced object cycle
|
||||
GC 008: Unreferensed object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
GC 009: Unreferenced array-object cycle
|
||||
GC 009: Unreferensed array-object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64070 (Inheritance with Traits failed with error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait first_trait
|
||||
{
|
||||
function first_function()
|
||||
{
|
||||
echo "From First Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait second_trait
|
||||
{
|
||||
use first_trait {
|
||||
first_trait::first_function as second_function;
|
||||
}
|
||||
|
||||
function first_function()
|
||||
{
|
||||
echo "From Second Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
class first_class
|
||||
{
|
||||
use second_trait;
|
||||
}
|
||||
|
||||
$obj = new first_class();
|
||||
$obj->first_function();
|
||||
$obj->second_function();
|
||||
?>
|
||||
--EXPECT--
|
||||
From Second Trait
|
||||
From First Trait
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method insteadof TestTrait;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235.php on line %d
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method as TestParent;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
+1
-5
@@ -350,10 +350,6 @@ struct _zval_struct {
|
||||
#define Z_UNSET_ISREF(z) Z_UNSET_ISREF_P(&(z))
|
||||
#define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref)
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
#if __GNUC__ >= 3
|
||||
#define zend_always_inline inline __attribute__((always_inline))
|
||||
@@ -362,6 +358,7 @@ struct _zval_struct {
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
#define zend_always_inline __forceinline
|
||||
#define zend_never_inline
|
||||
@@ -369,7 +366,6 @@ struct _zval_struct {
|
||||
#define zend_always_inline inline
|
||||
#define zend_never_inline
|
||||
#endif
|
||||
#endif /* ZEND_DEBUG */
|
||||
|
||||
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
|
||||
# define EXPECTED(condition) __builtin_expect(condition, 1)
|
||||
|
||||
+5
-96
@@ -1022,41 +1022,6 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int zval_update_class_constant(zval **pp, int is_static, int offset TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
|
||||
(Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) {
|
||||
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
|
||||
|
||||
if ((*scope)->parent) {
|
||||
zend_class_entry *ce = *scope;
|
||||
HashPosition pos;
|
||||
zend_property_info *prop_info;
|
||||
|
||||
do {
|
||||
for (zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
|
||||
zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop_info, &pos) == SUCCESS;
|
||||
zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
|
||||
if (is_static == ((prop_info->flags & ZEND_ACC_STATIC) != 0) &&
|
||||
offset == prop_info->offset) {
|
||||
int ret;
|
||||
zend_class_entry *old_scope = *scope;
|
||||
*scope = prop_info->ce;
|
||||
ret = zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
*scope = old_scope;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
ce = ce->parent;
|
||||
} while (ce);
|
||||
|
||||
}
|
||||
return zval_update_constant(pp, (void*)1 TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED) == 0 || (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count)) {
|
||||
@@ -1069,7 +1034,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
|
||||
for (i = 0; i < class_type->default_properties_count; i++) {
|
||||
if (class_type->default_properties_table[i]) {
|
||||
zval_update_class_constant(&class_type->default_properties_table[i], 0, i TSRMLS_CC);
|
||||
zval_update_constant(&class_type->default_properties_table[i], (void**)1 TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1110,7 +1075,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
}
|
||||
|
||||
for (i = 0; i < class_type->default_static_members_count; i++) {
|
||||
zval_update_class_constant(&CE_STATIC_MEMBERS(class_type)[i], 1, i TSRMLS_CC);
|
||||
zval_update_constant(&CE_STATIC_MEMBERS(class_type)[i], (void**)1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
*scope = old_scope;
|
||||
@@ -1143,7 +1108,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
|
||||
|
||||
/* This function requires 'properties' to contain all props declared in the
|
||||
* class and all props being public. If only a subset is given or the class
|
||||
* has protected members then you need to merge the properties separately by
|
||||
* has protected members then you need to merge the properties seperately by
|
||||
* calling zend_merge_properties(). */
|
||||
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
@@ -2779,8 +2744,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
}
|
||||
if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 &&
|
||||
(fcc->calling_scope &&
|
||||
((fcc->object_ptr && fcc->calling_scope->__call) ||
|
||||
(!fcc->object_ptr && fcc->calling_scope->__callstatic)))) {
|
||||
(fcc->calling_scope->__call ||
|
||||
fcc->calling_scope->__callstatic))) {
|
||||
if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) {
|
||||
retval = 0;
|
||||
@@ -3913,62 +3878,6 @@ ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len) /* {{{ */
|
||||
{
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f) /* {{{ */
|
||||
{
|
||||
zend_function *func;
|
||||
HashPosition iterator;
|
||||
HashTable *function_table;
|
||||
|
||||
if (f->common.type != ZEND_USER_FUNCTION ||
|
||||
*(f->op_array.refcount) < 2 ||
|
||||
!f->common.scope ||
|
||||
!f->common.scope->trait_aliases) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
|
||||
function_table = &ce->function_table;
|
||||
zend_hash_internal_pointer_reset_ex(function_table, &iterator);
|
||||
while (zend_hash_get_current_data_ex(function_table, (void **)&func, &iterator) == SUCCESS) {
|
||||
if (func == f) {
|
||||
char *name;
|
||||
uint len;
|
||||
ulong idx;
|
||||
|
||||
if (zend_hash_get_current_key_ex(function_table, &name, &len, &idx, 0, &iterator) != HASH_KEY_IS_STRING) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
--len;
|
||||
if (len == strlen(f->common.function_name) &&
|
||||
!strncasecmp(name, f->common.function_name, len)) {
|
||||
return f->common.function_name;
|
||||
}
|
||||
return zend_find_alias_name(f->common.scope, name, len);
|
||||
}
|
||||
zend_hash_move_forward_ex(function_table, &iterator);
|
||||
}
|
||||
return f->common.function_name;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+6
-9
@@ -60,7 +60,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
zval *object_ptr;
|
||||
} zend_fcall_info_cache;
|
||||
|
||||
#define ZEND_NS_NAME(ns, name) ns "\\" name
|
||||
#define ZEND_NS_NAME(ns, name) ns"\\"name
|
||||
|
||||
#define ZEND_FN(name) zif_##name
|
||||
#define ZEND_MN(name) zim_##name
|
||||
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
|
||||
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
@@ -279,9 +279,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
|
||||
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
|
||||
|
||||
#define zend_register_class_alias(name, ce) \
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
|
||||
#define zend_register_ns_class_alias(ns, name, ce) \
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
|
||||
@@ -461,7 +461,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC);
|
||||
|
||||
/** Clear arguments connected with zend_fcall_info *fci
|
||||
/** Clear argumens connected with zend_fcall_info *fci
|
||||
* If free_mem is not zero then the params array gets free'd as well
|
||||
*/
|
||||
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
|
||||
@@ -499,7 +499,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
|
||||
ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
|
||||
|
||||
/** Call a function using information created by zend_fcall_info_init()/args().
|
||||
* If args is given then those replace the argument info in fci is temporarily.
|
||||
* If args is given then those replace the arguement info in fci is temporarily.
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
|
||||
|
||||
@@ -517,9 +517,6 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_rebuild_symbol_table(TSRMLS_D);
|
||||
|
||||
ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len);
|
||||
ZEND_API const char* zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
|
||||
|
||||
#define add_method(arg, key, method) add_assoc_function((arg), (key), (method))
|
||||
|
||||
ZEND_API ZEND_FUNCTION(display_disabled_function);
|
||||
|
||||
+5
-15
@@ -672,7 +672,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
unsigned long n;
|
||||
|
||||
__asm__("bsr %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
__asm__("bsrq %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
@@ -698,12 +698,12 @@ static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
unsigned long n;
|
||||
|
||||
__asm__("bsf %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
__asm__("bsfq %1,%0\n\t" : "=r" (n) : "rm" (_size));
|
||||
return (unsigned int)n;
|
||||
#elif defined(_MSC_VER) && defined(_M_IX86)
|
||||
__asm {
|
||||
bsf eax, _size
|
||||
}
|
||||
}
|
||||
#else
|
||||
static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};
|
||||
unsigned int n;
|
||||
@@ -2461,7 +2461,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
size_t res = nmemb;
|
||||
unsigned long overflow = 0;
|
||||
|
||||
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
|
||||
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
|
||||
: "=&a"(res), "=&d" (overflow)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
@@ -2481,22 +2481,12 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
size_t res = nmemb;
|
||||
unsigned long overflow = 0;
|
||||
|
||||
#ifdef __ILP32__ /* x32 */
|
||||
# define LP_SUFF "l"
|
||||
#else /* amd64 */
|
||||
# define LP_SUFF "q"
|
||||
#endif
|
||||
|
||||
__asm__ ("mul" LP_SUFF " %3\n\t"
|
||||
"add %4,%0\n\t"
|
||||
"adc $0,%1"
|
||||
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq %1,%1"
|
||||
: "=&a"(res), "=&d" (overflow)
|
||||
: "%0"(res),
|
||||
"rm"(size),
|
||||
"rm"(offset));
|
||||
|
||||
#undef LP_SUFF
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
|
||||
@@ -1025,13 +1025,6 @@ ZEND_FUNCTION(get_object_vars)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int same_name(const char *key, const char *name, zend_uint name_len)
|
||||
{
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
int ret = memcmp(lcname, key, name_len) == 0;
|
||||
efree(lcname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* {{{ proto array get_class_methods(mixed class)
|
||||
Returns an array of method names for class or class instance. */
|
||||
@@ -1079,26 +1072,14 @@ ZEND_FUNCTION(get_class_methods)
|
||||
uint len = strlen(mptr->common.function_name);
|
||||
|
||||
/* Do not display old-style inherited constructors */
|
||||
if (zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING) {
|
||||
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
|
||||
mptr->common.scope == ce ||
|
||||
zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING ||
|
||||
zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
|
||||
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
} else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
|
||||
mptr->common.scope == ce ||
|
||||
zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
|
||||
|
||||
if (mptr->type == ZEND_USER_FUNCTION &&
|
||||
*mptr->op_array.refcount > 1 &&
|
||||
(len != key_len - 1 ||
|
||||
!same_name(key, mptr->common.function_name, len))) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, zend_find_alias_name(mptr->common.scope, key, key_len - 1), key_len - 1, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
} else {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
zend_hash_move_forward_ex(&ce->function_table, &pos);
|
||||
@@ -1659,6 +1640,7 @@ ZEND_FUNCTION(restore_exception_handler)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
zval *array = va_arg(args, zval *);
|
||||
@@ -1669,13 +1651,7 @@ static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int nu
|
||||
|
||||
if ((hash_key->nKeyLength==0 || hash_key->arKey[0]!=0)
|
||||
&& (comply_mask == (ce->ce_flags & mask))) {
|
||||
if (ce->refcount > 1 &&
|
||||
(ce->name_length != hash_key->nKeyLength - 1 ||
|
||||
!same_name(hash_key->arKey, ce->name, ce->name_length))) {
|
||||
add_next_index_stringl(array, hash_key->arKey, hash_key->nKeyLength - 1, 1);
|
||||
} else {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
@@ -2118,14 +2094,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
lineno = 0;
|
||||
}
|
||||
|
||||
function_name = (ptr->function_state.function->common.scope &&
|
||||
ptr->function_state.function->common.scope->trait_aliases) ?
|
||||
zend_resolve_method_name(
|
||||
ptr->object ?
|
||||
Z_OBJCE_P(ptr->object) :
|
||||
ptr->function_state.function->common.scope,
|
||||
ptr->function_state.function) :
|
||||
ptr->function_state.function->common.function_name;
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
if (ptr->object) {
|
||||
@@ -2306,14 +2275,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
filename = NULL;
|
||||
}
|
||||
|
||||
function_name = (ptr->function_state.function->common.scope &&
|
||||
ptr->function_state.function->common.scope->trait_aliases) ?
|
||||
zend_resolve_method_name(
|
||||
ptr->object ?
|
||||
Z_OBJCE_P(ptr->object) :
|
||||
ptr->function_state.function->common.scope,
|
||||
ptr->function_state.function) :
|
||||
ptr->function_state.function->common.function_name;
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
add_assoc_string_ex(stack_frame, "function", sizeof("function"), (char*)function_name, 1);
|
||||
|
||||
+19
-23
@@ -1798,7 +1798,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
|
||||
pass_two(CG(active_op_array) TSRMLS_CC);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
zend_check_magic_method_implementation(CG(active_class_entry), (zend_function*)CG(active_op_array), E_COMPILE_ERROR TSRMLS_CC);
|
||||
@@ -2320,14 +2320,13 @@ void zend_do_goto(const znode *label TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_release_labels(int temporary TSRMLS_DC) /* {{{ */
|
||||
void zend_release_labels(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
if (CG(context).labels) {
|
||||
zend_hash_destroy(CG(context).labels);
|
||||
FREE_HASHTABLE(CG(context).labels);
|
||||
CG(context).labels = NULL;
|
||||
}
|
||||
if (!temporary && !zend_stack_is_empty(&CG(context_stack))) {
|
||||
if (!zend_stack_is_empty(&CG(context_stack))) {
|
||||
zend_compiler_context *ctx;
|
||||
|
||||
zend_stack_top(&CG(context_stack), (void**)&ctx);
|
||||
@@ -3267,11 +3266,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
|
||||
|
||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
|
||||
}
|
||||
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
||||
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
||||
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
|
||||
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
|
||||
efree(method_prototype);
|
||||
}
|
||||
@@ -3635,7 +3634,7 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_
|
||||
zend_uint other_flags = other_fn->common.scope->ce_flags;
|
||||
|
||||
return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
|
||||
&& ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
|
||||
&& zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)
|
||||
&& ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
|
||||
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
|
||||
}
|
||||
@@ -3744,7 +3743,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
|
||||
#endif
|
||||
} else {
|
||||
/* inherited members are overridden by members inserted by traits */
|
||||
/* check whether the trait method fulfills the inheritance requirements */
|
||||
/* check whether the trait method fullfills the inheritance requirements */
|
||||
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -3787,7 +3786,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
overriden = va_arg(args, HashTable**);
|
||||
exclude_table = va_arg(args, HashTable*);
|
||||
|
||||
fnname_len = hash_key->nKeyLength - 1;
|
||||
fnname_len = strlen(fn->common.function_name);
|
||||
|
||||
/* apply aliases which are qualified with a class name, there should not be any ambiguity */
|
||||
if (ce->trait_aliases) {
|
||||
@@ -3798,7 +3797,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
if (alias->alias != NULL
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& alias->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) {
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
fn_copy = *fn;
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
@@ -3820,7 +3819,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
}
|
||||
}
|
||||
|
||||
lcname = hash_key->arKey;
|
||||
lcname = zend_str_tolower_dup(fn->common.function_name, fnname_len);
|
||||
|
||||
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
|
||||
/* is not in hashtable, thus, function is not to be excluded */
|
||||
@@ -3835,7 +3834,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
if (alias->alias == NULL && alias->modifiers != 0
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& (alias->trait_method->mname_len == fnname_len)
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, lcname, fnname_len) == 0)) {
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
|
||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
|
||||
|
||||
@@ -3852,6 +3851,8 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3860,16 +3861,12 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
|
||||
}
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->traits[i] == trait) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
|
||||
zend_error(E_COMPILE_ERROR, "Trait %s is not used", trait->name);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3911,7 +3908,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
/** With the other traits, we are more permissive.
|
||||
We do not give errors for those. This allows to be more
|
||||
defensive in such definitions.
|
||||
However, we want to make sure that the insteadof declaration
|
||||
However, we want to make sure that the insteadof declartion
|
||||
is consistent in itself.
|
||||
*/
|
||||
j = 0;
|
||||
@@ -4798,11 +4795,10 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
|
||||
/* Prefix class name with name of current namespace */
|
||||
znode tmp;
|
||||
|
||||
tmp.op_type = IS_CONST;
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
zval_copy_ctor(&tmp.u.constant);
|
||||
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
|
||||
*class_name = tmp;
|
||||
class_name = &tmp;
|
||||
efree(lcname);
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
|
||||
}
|
||||
@@ -4935,7 +4931,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
|
||||
}
|
||||
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
|
||||
&& (parent_token || (ce->num_interfaces > 0))) {
|
||||
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
|
||||
do_verify_abstract_class(TSRMLS_C);
|
||||
@@ -5479,7 +5475,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
|
||||
break;
|
||||
}
|
||||
SET_NODE(opline->op1, cmd);
|
||||
opline->op2.opline_num = 1;
|
||||
opline->op2.opline_num = 0;
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
@@ -6943,7 +6939,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/*
|
||||
* Find the first occurrence of : from the left
|
||||
* Find the first occurence of : from the left
|
||||
* move the path pointer to the position just after :
|
||||
* increment the len_adjust to the length of path till colon character(inclusive)
|
||||
* If there is no character beyond : simple return len
|
||||
|
||||
+1
-1
@@ -616,7 +616,7 @@ void zend_do_end_compilation(TSRMLS_D);
|
||||
void zend_do_label(znode *label TSRMLS_DC);
|
||||
void zend_do_goto(const znode *label TSRMLS_DC);
|
||||
void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC);
|
||||
void zend_release_labels(int temporary TSRMLS_DC);
|
||||
void zend_release_labels(TSRMLS_D);
|
||||
|
||||
ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
|
||||
@@ -817,10 +817,6 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
|
||||
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
|
||||
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
|
||||
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
|
||||
|
||||
convert_to_string(file);
|
||||
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
|
||||
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
|
||||
} else {
|
||||
file = NULL;
|
||||
line = NULL;
|
||||
@@ -832,11 +828,7 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
|
||||
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
|
||||
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
|
||||
|
||||
convert_to_string(str);
|
||||
convert_to_string(file);
|
||||
convert_to_long(line);
|
||||
|
||||
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
|
||||
zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
|
||||
} else {
|
||||
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
|
||||
}
|
||||
|
||||
+3
-4
@@ -1145,10 +1145,6 @@ convert_to_array:
|
||||
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
|
||||
}
|
||||
|
||||
if (type != BP_VAR_UNSET) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(dim) != IS_LONG) {
|
||||
|
||||
switch(Z_TYPE_P(dim)) {
|
||||
@@ -1177,6 +1173,9 @@ convert_to_array:
|
||||
convert_to_long(&tmp);
|
||||
dim = &tmp;
|
||||
}
|
||||
if (type != BP_VAR_UNSET) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
container = *container_ptr;
|
||||
result->str_offset.str = container;
|
||||
PZVAL_LOCK(container);
|
||||
|
||||
@@ -254,13 +254,15 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
|
||||
if (EG(user_error_handler)) {
|
||||
zeh = EG(user_error_handler);
|
||||
EG(user_error_handler) = NULL;
|
||||
zval_ptr_dtor(&zeh);
|
||||
zval_dtor(zeh);
|
||||
FREE_ZVAL(zeh);
|
||||
}
|
||||
|
||||
if (EG(user_exception_handler)) {
|
||||
zeh = EG(user_exception_handler);
|
||||
EG(user_exception_handler) = NULL;
|
||||
zval_ptr_dtor(&zeh);
|
||||
zval_dtor(zeh);
|
||||
FREE_ZVAL(zeh);
|
||||
}
|
||||
|
||||
zend_stack_destroy(&EG(user_error_handlers_error_reporting));
|
||||
@@ -1311,7 +1313,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
opline++;
|
||||
}
|
||||
|
||||
zend_release_labels(1 TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ typedef struct _zend_gc_globals {
|
||||
gc_root_buffer *first_unused; /* pointer to first unused buffer */
|
||||
gc_root_buffer *last_unused; /* pointer to last unused buffer */
|
||||
|
||||
zval_gc_info *zval_to_free; /* temporary list of zvals to free */
|
||||
zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */
|
||||
zval_gc_info *free_list;
|
||||
zval_gc_info *next_to_free;
|
||||
|
||||
@@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS
|
||||
GC_ZVAL_INIT(z); \
|
||||
} while (0)
|
||||
|
||||
/* The following macros override macros from zend_alloc.h */
|
||||
/* The following macroses override macroses from zend_alloc.h */
|
||||
#undef ALLOC_ZVAL
|
||||
#define ALLOC_ZVAL(z) \
|
||||
do { \
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
|
||||
|
||||
#ifndef XtOffsetOf
|
||||
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
|
||||
# if defined(CRAY) || (defined(__arm) && !defined(LINUX))
|
||||
# ifdef __STDC__
|
||||
# define XtOffset(p_type, field) _Offsetof(p_type, field)
|
||||
# else
|
||||
|
||||
@@ -452,7 +452,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
|
||||
if (result == FAILURE && !EG(exception)) {
|
||||
if (result == FAILURE) {
|
||||
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -41,19 +41,17 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 3
|
||||
|
||||
%code requires {
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
}
|
||||
|
||||
%token END 0 "end of file"
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%token T_INCLUDE "include (T_INCLUDE)"
|
||||
@@ -377,13 +375,13 @@ unticked_class_declaration_statement:
|
||||
implements_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
| interface_entry T_STRING
|
||||
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
|
||||
interface_extends_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
+345
-348
File diff suppressed because it is too large.
Load diff
@@ -256,7 +256,6 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
|
||||
CG(heredoc) = NULL;
|
||||
CG(heredoc_len) = 0;
|
||||
}
|
||||
RESET_DOC_COMMENT();
|
||||
}
|
||||
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
|
||||
@@ -540,7 +539,6 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
CG(zend_lineno) = 1;
|
||||
}
|
||||
|
||||
RESET_DOC_COMMENT();
|
||||
CG(increment_lineno) = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -585,7 +583,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
compiler_result = zendparse(TSRMLS_C);
|
||||
zend_do_return(&retval_znode, 0 TSRMLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result != 0) { /* parser error */
|
||||
if (compiler_result==1) { /* parser error */
|
||||
zend_bailout();
|
||||
}
|
||||
compilation_successful=1;
|
||||
@@ -595,7 +593,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
} else {
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
@@ -691,7 +689,6 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
|
||||
zend_set_compiled_filename(filename TSRMLS_CC);
|
||||
CG(zend_lineno) = 1;
|
||||
CG(increment_lineno) = 0;
|
||||
RESET_DOC_COMMENT();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -761,7 +758,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
SCNG(script_filtered) = NULL;
|
||||
}
|
||||
|
||||
if (compiler_result != 0) {
|
||||
if (compiler_result==1) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
@@ -771,7 +768,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
zend_release_labels(TSRMLS_C);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Jun 16 14:52:22 2013 */
|
||||
/* Generated by re2c 0.13.5 on Wed Nov 14 17:46:56 2012 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
long __tmpvar; \
|
||||
__asm__ ("imul %3,%0\n" \
|
||||
"adc $0,%1" \
|
||||
__asm__ ("imulq %3,%0\n" \
|
||||
"adcq $0,%1" \
|
||||
: "=r"(__tmpvar),"=r"(usedval) \
|
||||
: "0"(a), "r"(b), "1"(0)); \
|
||||
if (usedval) (dval) = (double) (a) * (double) (b); \
|
||||
|
||||
@@ -35,17 +35,6 @@
|
||||
#define Z_OBJ_P(zval_p) \
|
||||
((zend_object*)(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].bucket.obj.object))
|
||||
|
||||
#define Z_OBJ_PROTECT_RECURSION(zval_p) \
|
||||
do { \
|
||||
if (EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count++ >= 3) { \
|
||||
zend_error(E_ERROR, "Nesting level too deep - recursive dependency?"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define Z_OBJ_UNPROTECT_RECURSION(zval_p) \
|
||||
EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count--
|
||||
|
||||
/*
|
||||
__X accessors explanation:
|
||||
|
||||
@@ -393,16 +382,6 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper
|
||||
info.name = Z_STRVAL_P(member);
|
||||
info.name_length = Z_STRLEN_P(member);
|
||||
info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
|
||||
} else if(property_info->name[0] == '\0'){
|
||||
const char *class_name = NULL, *prop_name = NULL;
|
||||
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
|
||||
if(class_name) {
|
||||
/* use unmangled name for protected properties */
|
||||
info.name = prop_name;
|
||||
info.name_length = strlen(prop_name);
|
||||
info.h = zend_get_hash_value(info.name, info.name_length+1);
|
||||
property_info = &info;
|
||||
}
|
||||
}
|
||||
if (!zobj->guards) {
|
||||
ALLOC_HASHTABLE(zobj->guards);
|
||||
@@ -445,7 +424,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const zend_li
|
||||
#endif
|
||||
|
||||
/* make zend_get_property_info silent if we have getter - we may want to use it */
|
||||
property_info = zend_get_property_info_quick(zobj->ce, member, silent || (zobj->ce->__get != NULL), key TSRMLS_CC);
|
||||
property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(!property_info) ||
|
||||
((EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
|
||||
@@ -1278,14 +1257,6 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
|
||||
}
|
||||
}
|
||||
|
||||
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) ||
|
||||
UNEXPECTED(CE_STATIC_MEMBERS(ce)[property_info->offset] == NULL)) {
|
||||
if (!silent) {
|
||||
zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &CE_STATIC_MEMBERS(ce)[property_info->offset];
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1348,43 +1319,28 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
if (!zobj1->properties && !zobj2->properties) {
|
||||
int i;
|
||||
|
||||
Z_OBJ_PROTECT_RECURSION(o1);
|
||||
Z_OBJ_PROTECT_RECURSION(o2);
|
||||
for (i = 0; i < zobj1->ce->default_properties_count; i++) {
|
||||
if (zobj1->properties_table[i]) {
|
||||
if (zobj2->properties_table[i]) {
|
||||
zval result;
|
||||
|
||||
if (compare_function(&result, zobj1->properties_table[i], zobj2->properties_table[i] TSRMLS_CC)==FAILURE) {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 1;
|
||||
}
|
||||
if (Z_LVAL(result) != 0) {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return Z_LVAL(result);
|
||||
}
|
||||
} else {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if (zobj2->properties_table[i]) {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 1;
|
||||
} else {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 0;
|
||||
} else {
|
||||
if (!zobj1->properties) {
|
||||
|
||||
@@ -117,7 +117,6 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
EG(objects_store).object_buckets[handle].destructor_called = 0;
|
||||
EG(objects_store).object_buckets[handle].valid = 1;
|
||||
EG(objects_store).object_buckets[handle].apply_count = 0;
|
||||
|
||||
obj->refcount = 1;
|
||||
GC_OBJ_INIT(obj);
|
||||
|
||||
@@ -31,7 +31,6 @@ typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSR
|
||||
typedef struct _zend_object_store_bucket {
|
||||
zend_bool destructor_called;
|
||||
zend_bool valid;
|
||||
zend_uchar apply_count;
|
||||
union _store_bucket {
|
||||
struct _store_object {
|
||||
void *object;
|
||||
|
||||
+1
-2
@@ -162,9 +162,8 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
|
||||
|
||||
for (i = 0; i < ce->default_static_members_count; i++) {
|
||||
if (ce->static_members_table[i]) {
|
||||
zval *p = ce->static_members_table[i];
|
||||
zval_ptr_dtor(&ce->static_members_table[i]);
|
||||
ce->static_members_table[i] = NULL;
|
||||
zval_ptr_dtor(&p);
|
||||
}
|
||||
}
|
||||
ce->static_members_table = NULL;
|
||||
|
||||
@@ -1475,7 +1475,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
|
||||
/* If both are objects sharing the same comparision handler then use is */
|
||||
if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) {
|
||||
if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
|
||||
/* object handles are identical, apparently this is the same object */
|
||||
/* object handles are identical, apprently this is the same object */
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -79,8 +79,7 @@ static zend_always_inline long zend_dval_to_lval(double d)
|
||||
#else
|
||||
static zend_always_inline long zend_dval_to_lval(double d)
|
||||
{
|
||||
/* >= as (double)LONG_MAX is outside signed range */
|
||||
if (d >= LONG_MAX) {
|
||||
if (d > LONG_MAX) {
|
||||
return (long)(unsigned long) d;
|
||||
}
|
||||
return (long) d;
|
||||
|
||||
+42
-42
@@ -974,15 +974,27 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
if (OP1_TYPE != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (OP1_TYPE == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
FREE_OP1();
|
||||
CHECK_EXCEPTION();
|
||||
@@ -2229,11 +2241,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -2416,11 +2426,9 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -2661,6 +2669,11 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (fbc->common.arg_info) {
|
||||
zend_uint i=0;
|
||||
zval **p = (zval**)EX(function_state).arguments;
|
||||
@@ -2672,24 +2685,15 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
}
|
||||
}
|
||||
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
} else if (RETURN_VALUE_USED(opline)) {
|
||||
EX_T(opline->result.var).var.ptr = NULL;
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
@@ -3146,9 +3150,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
@@ -3242,7 +3244,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
|
||||
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
|
||||
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
|
||||
zval_ptr_dtor(var_ptr);
|
||||
Z_DELREF_PP(var_ptr);
|
||||
*var_ptr = assignment_value;
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -3272,6 +3274,7 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
|
||||
}
|
||||
|
||||
@@ -3283,6 +3286,7 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
FREE_OP2();
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
|
||||
}
|
||||
|
||||
@@ -3502,11 +3506,9 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -3893,17 +3895,15 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (OP1_TYPE != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -4935,7 +4935,7 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, iface);
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
|
||||
|
||||
+149
-165
@@ -621,6 +621,11 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
|
||||
temp_variable *ret = &EX_T(opline->result.var);
|
||||
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
|
||||
if (fbc->common.arg_info) {
|
||||
zend_uint i=0;
|
||||
zval **p = (zval**)EX(function_state).arguments;
|
||||
@@ -632,24 +637,15 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
}
|
||||
}
|
||||
|
||||
if (EXPECTED(EG(exception) == NULL)) {
|
||||
MAKE_STD_ZVAL(ret->var.ptr);
|
||||
ZVAL_NULL(ret->var.ptr);
|
||||
ret->var.ptr_ptr = &ret->var.ptr;
|
||||
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!zend_execute_internal) {
|
||||
/* saves one function call if zend_execute_internal is not used */
|
||||
fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
} else {
|
||||
zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
} else if (RETURN_VALUE_USED(opline)) {
|
||||
EX_T(opline->result.var).var.ptr = NULL;
|
||||
if (!RETURN_VALUE_USED(opline)) {
|
||||
zval_ptr_dtor(&ret->var.ptr);
|
||||
}
|
||||
} else if (fbc->type == ZEND_USER_FUNCTION) {
|
||||
EX(original_return_value) = EG(return_value_ptr_ptr);
|
||||
@@ -1274,11 +1270,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -1378,7 +1372,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
|
||||
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
|
||||
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
|
||||
zval_ptr_dtor(var_ptr);
|
||||
Z_DELREF_PP(var_ptr);
|
||||
*var_ptr = assignment_value;
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
@@ -1393,6 +1387,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
|
||||
}
|
||||
|
||||
@@ -1404,6 +1399,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
SAVE_OPLINE();
|
||||
el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
|
||||
EX(op_array), EX_Ts() TSRMLS_CC);
|
||||
|
||||
ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
|
||||
}
|
||||
|
||||
@@ -1449,7 +1445,7 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, iface);
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
|
||||
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
|
||||
@@ -1580,11 +1576,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -1750,11 +1744,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -1953,11 +1945,9 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
@@ -2034,15 +2024,27 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = opline->op1.zv;
|
||||
|
||||
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
if (IS_CONST != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_CONST == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
@@ -3427,11 +3429,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -3598,11 +3598,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -3784,17 +3782,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_CONST != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -4235,11 +4231,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -4911,11 +4905,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -5175,17 +5167,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_CONST != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -5474,11 +5464,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -5720,17 +5708,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_CONST != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -6149,11 +6135,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -6459,15 +6443,27 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
if (IS_TMP_VAR != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_TMP_VAR == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
zval_dtor(free_op1.var);
|
||||
CHECK_EXCEPTION();
|
||||
@@ -8160,17 +8156,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
zval_dtor(free_op1.var);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -9507,17 +9501,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
zval_dtor(free_op1.var);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -9934,17 +9926,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
zval_dtor(free_op1.var);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -10771,15 +10761,27 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
if (IS_VAR != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_VAR == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
@@ -11203,9 +11205,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -13524,11 +13524,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -13695,11 +13693,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -13881,17 +13877,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -15700,11 +15694,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -17839,11 +17831,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -18103,17 +18093,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -19119,11 +19107,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -19365,17 +19351,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_VAR != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -20960,11 +20944,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -22464,11 +22446,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
|
||||
ce = CACHED_PTR(opline->op1.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op1.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -26761,15 +26741,27 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
if (IS_CV != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_CV == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
@@ -27177,9 +27169,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
|
||||
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
|
||||
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -29476,17 +29466,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_CV != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -33435,17 +33423,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_CV != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
@@ -34573,17 +34559,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND
|
||||
ce = CACHED_PTR(opline->op2.literal->cache_slot);
|
||||
} else {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
if (IS_CV != IS_CONST && varname == &tmp) {
|
||||
zval_dtor(&tmp);
|
||||
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
|
||||
zval_ptr_dtor(&varname);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv));
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
CACHE_PTR(opline->op2.literal->cache_slot, ce);
|
||||
}
|
||||
|
||||
@@ -1417,7 +1417,7 @@ for ($i = 1; $i < $argc; $i++) {
|
||||
// Disabling code for old-style executor
|
||||
define("ZEND_VM_OLD_EXECUTOR", 1);
|
||||
} else if ($argv[$i] == "--with-lines") {
|
||||
// Enabling debugging using original zend_vm_def.h
|
||||
// Enabling debuging using original zend_vm_def.h
|
||||
define("ZEND_VM_LINES", 1);
|
||||
} else if ($argv[$i] == "--help") {
|
||||
usage();
|
||||
|
||||
+5
-7
@@ -66,10 +66,10 @@ AC_DEFUN([PHP_EXPAND_PATH],[
|
||||
$2=$1
|
||||
else
|
||||
changequote({,})
|
||||
ep_dir=`echo $1|$SED 's%/*[^/][^/]*/*$%%'`
|
||||
ep_dir="`echo $1|$SED 's%/*[^/][^/]*/*$%%'`"
|
||||
changequote([,])
|
||||
ep_realdir=`(cd "$ep_dir" && pwd)`
|
||||
$2="$ep_realdir"/`basename "$1"`
|
||||
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
|
||||
$2="$ep_realdir/`basename \"$1\"`"
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([
|
||||
])
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl Library/function existence and build sanity checks
|
||||
dnl Library/function existance and build sanity checks
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
dnl
|
||||
@@ -2342,10 +2342,8 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
fi
|
||||
|
||||
if test -n "$OPENSSL_LIBS"; then
|
||||
if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
|
||||
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
|
||||
fi
|
||||
if test -n "$OPENSSL_INCS"; then
|
||||
PHP_EVAL_INCLINE($OPENSSL_INCS)
|
||||
fi
|
||||
fi
|
||||
|
||||
Vendored
+1
-1
@@ -1230,7 +1230,7 @@ if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
|
||||
test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
|
||||
test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
|
||||
|
||||
# We can hardcode non-existent directories.
|
||||
# We can hardcode non-existant directories.
|
||||
if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
|
||||
# If the only mechanism to avoid hardcoding is shlibpath_var, we
|
||||
# have to relink, otherwise we might link with an installed library
|
||||
|
||||
+2
-2
@@ -376,11 +376,11 @@ while [ $# -gt 0 ]; do
|
||||
eval "opt_${opt_OPT}=yes"
|
||||
;;
|
||||
':' )
|
||||
# option with argument (multiple occurrences override)
|
||||
# option with argument (multiple occurances override)
|
||||
eval "opt_${opt_OPT}=\"\$opt_ARG\""
|
||||
;;
|
||||
'+' )
|
||||
# option with argument (multiple occurrences append)
|
||||
# option with argument (multiple occurances append)
|
||||
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
|
||||
;;
|
||||
* )
|
||||
|
||||
Vendored
+1
-1
@@ -897,7 +897,7 @@ case $basic_machine in
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
|
||||
+3
-3
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=19
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_RELEASE_VERSION=11
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -784,7 +784,7 @@ if test "$PHP_GCOV" = "yes"; then
|
||||
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
||||
fi
|
||||
|
||||
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
|
||||
ltp_version_list="1.5 1.6 1.7"
|
||||
|
||||
AC_CHECK_PROG(LTP, lcov, lcov)
|
||||
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
||||
|
||||
+1
-1
@@ -518,7 +518,7 @@ static PHP_FUNCTION(bzcompress)
|
||||
efree(dest);
|
||||
RETURN_LONG(error);
|
||||
} else {
|
||||
/* Copy the buffer, we have perhaps allocate a lot more than we need,
|
||||
/* Copy the buffer, we have perhaps allocate alot more than we need,
|
||||
so we erealloc() the buffer to the proper size */
|
||||
dest = erealloc(dest, dest_len + 1);
|
||||
dest[dest_len] = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@ Bug #51997 (SEEK_CUR with 0 value, returns a warning)
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "bug51997.bz2";
|
||||
$filename = "testfile.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
|
||||
@@ -7,7 +7,7 @@ BZ2 with files
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "with_files.bz2";
|
||||
$filename = "testfile.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
|
||||
@@ -272,7 +272,6 @@
|
||||
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
|
||||
|
||||
#define JEWISH_SDN_OFFSET 347997
|
||||
#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */
|
||||
#define NEW_MOON_OF_CREATION 31524
|
||||
|
||||
#define SUNDAY 0
|
||||
@@ -520,7 +519,7 @@ void SdnToJewish(
|
||||
int tishri1After;
|
||||
int yearLength;
|
||||
|
||||
if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) {
|
||||
if (sdn <= JEWISH_SDN_OFFSET) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64895: Integer overflow in SndToJewish
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die("skip this test is for 64bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(38245310, 324542846, 324542847, 9223372036854743639);
|
||||
|
||||
foreach ($a as $x) var_dump(jdtojewish($x));
|
||||
--EXPECTF--
|
||||
string(11) "2/22/103759"
|
||||
string(12) "12/13/887605"
|
||||
string(5) "0/0/0"
|
||||
string(5) "0/0/0"
|
||||
@@ -102,9 +102,8 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
php_com_dotnet_object *obj;
|
||||
zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z));
|
||||
|
||||
switch (ztype) {
|
||||
switch (Z_TYPE_P(z)) {
|
||||
case IS_NULL:
|
||||
V_VT(v) = VT_NULL;
|
||||
break;
|
||||
@@ -430,7 +429,7 @@ PHP_FUNCTION(com_variant_create_instance)
|
||||
/* If already an array and VT_ARRAY is passed then:
|
||||
- if only VT_ARRAY passed then do not perform a conversion
|
||||
- if VT_ARRAY plus other type passed then perform conversion
|
||||
but will probably fail (original behavior)
|
||||
but will probably fail (origional behavior)
|
||||
*/
|
||||
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
|
||||
long orig_vt = vt;
|
||||
|
||||
@@ -38,4 +38,4 @@ curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
== Testing curl_error with a fake URL ==
|
||||
string(%d) "%sfakeURL%S"
|
||||
string(%d) "%sfakeURL%s"
|
||||
+820
-992
File diff suppressed because it is too large.
Load diff
+38
-354
@@ -39,20 +39,6 @@ static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i
|
||||
static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define DATE_I64_BUF_LEN 65
|
||||
# define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10)
|
||||
# define DATE_A64I(i, s) i = _atoi64(s)
|
||||
#else
|
||||
#define DATE_I64_BUF_LEN 65
|
||||
# define DATE_I64A(i, s, len) \
|
||||
do { \
|
||||
int st = snprintf(s, len, "%lld", i); \
|
||||
s[st] = '\0'; \
|
||||
} while (0);
|
||||
# define DATE_A64I(i, s) i = atoll(s)
|
||||
#endif
|
||||
|
||||
/* {{{ arginfo */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, format)
|
||||
@@ -486,8 +472,6 @@ const zend_function_entry date_funcs_interval[] = {
|
||||
|
||||
const zend_function_entry date_funcs_period[] = {
|
||||
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, __wakeup, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
@@ -511,11 +495,9 @@ int php_date_global_timezone_db_enabled;
|
||||
/* on 90'35; common sunrise declaration (sun body disappeared) */
|
||||
#define DATE_SUNRISE_ZENITH "90.583333"
|
||||
|
||||
static PHP_INI_MH(OnUpdate_date_timezone);
|
||||
|
||||
/* {{{ INI Settings */
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdate_date_timezone, default_timezone, zend_date_globals, date_globals)
|
||||
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString, default_timezone, zend_date_globals, date_globals)
|
||||
PHP_INI_ENTRY("date.default_latitude", DATE_DEFAULT_LATITUDE, PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("date.default_longitude", DATE_DEFAULT_LONGITUDE, PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("date.sunset_zenith", DATE_SUNSET_ZENITH, PHP_INI_ALL, NULL)
|
||||
@@ -585,13 +567,9 @@ static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_
|
||||
static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
|
||||
static HashTable *date_object_get_gc_interval(zval *object, zval ***table, int *n TSRMLS_DC);
|
||||
static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
|
||||
static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC);
|
||||
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
|
||||
|
||||
zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
|
||||
void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
|
||||
static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
|
||||
|
||||
/* {{{ Module struct */
|
||||
zend_module_entry date_module_entry = {
|
||||
@@ -621,7 +599,6 @@ static PHP_GINIT_FUNCTION(date)
|
||||
date_globals->default_timezone = NULL;
|
||||
date_globals->timezone = NULL;
|
||||
date_globals->tzcache = NULL;
|
||||
date_globals->timezone_valid = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -867,54 +844,25 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* Callback to check the date.timezone only when changed increases performance */
|
||||
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
|
||||
static PHP_INI_MH(OnUpdate_date_timezone)
|
||||
{
|
||||
if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
DATEG(timezone_valid) = 0;
|
||||
if (stage == PHP_INI_STAGE_RUNTIME) {
|
||||
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), DATE_TIMEZONEDB)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG);
|
||||
} else {
|
||||
DATEG(timezone_valid) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ Helper functions */
|
||||
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
|
||||
{
|
||||
/* Checking configure timezone */
|
||||
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
|
||||
if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) {
|
||||
return DATEG(timezone);
|
||||
}
|
||||
/* Check config setting for default timezone */
|
||||
if (!DATEG(default_timezone)) {
|
||||
/* Special case: ext/date wasn't initialized yet */
|
||||
zval ztz;
|
||||
|
||||
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz)
|
||||
&& Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
|
||||
|
||||
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz) &&
|
||||
Z_TYPE(ztz) == IS_STRING &&
|
||||
Z_STRLEN(ztz) > 0 &&
|
||||
timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
|
||||
return Z_STRVAL(ztz);
|
||||
}
|
||||
} else if (*DATEG(default_timezone)) {
|
||||
if (DATEG(timezone_valid) == 1) {
|
||||
return DATEG(default_timezone);
|
||||
}
|
||||
|
||||
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
|
||||
return "UTC";
|
||||
}
|
||||
|
||||
DATEG(timezone_valid) = 1;
|
||||
} else if (*DATEG(default_timezone) && timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
|
||||
return DATEG(default_timezone);
|
||||
}
|
||||
/* Fallback to UTC */
|
||||
@@ -2002,11 +1950,6 @@ static void date_register_classes(TSRMLS_D)
|
||||
zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
|
||||
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
date_object_handlers_period.clone_obj = date_object_clone_period;
|
||||
date_object_handlers_period.get_properties = date_object_get_properties_period;
|
||||
date_object_handlers_period.get_property_ptr_ptr = NULL;
|
||||
date_object_handlers_period.get_gc = date_object_get_gc_period;
|
||||
date_object_handlers_period.read_property = date_period_read_property;
|
||||
date_object_handlers_period.write_property = date_period_write_property;
|
||||
|
||||
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
|
||||
zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
|
||||
@@ -2070,11 +2013,7 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
|
||||
instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) {
|
||||
php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC);
|
||||
php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC);
|
||||
|
||||
if (!o1->time || !o2->time) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!o1->time->sse_uptodate) {
|
||||
timelib_update_ts(o1->time, o1->time->tz_info);
|
||||
}
|
||||
@@ -2106,7 +2045,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
|
||||
props = zend_std_get_properties(object TSRMLS_CC);
|
||||
|
||||
if (!dateobj->time || GC_G(gc_active)) {
|
||||
if (!dateobj->time) {
|
||||
return props;
|
||||
}
|
||||
|
||||
@@ -2254,6 +2193,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
zval *zv;
|
||||
php_interval_obj *intervalobj;
|
||||
|
||||
|
||||
intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
props = zend_std_get_properties(object TSRMLS_CC);
|
||||
@@ -2264,7 +2204,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
|
||||
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
|
||||
MAKE_STD_ZVAL(zv); \
|
||||
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
|
||||
ZVAL_LONG(zv, intervalobj->diff->f); \
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
|
||||
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
|
||||
@@ -2273,9 +2213,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("h", h);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("i", i);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("s", s);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday", weekday);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday_behavior", weekday_behavior);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert);
|
||||
if (intervalobj->diff->days != -99999) {
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("days", days);
|
||||
@@ -2284,10 +2221,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
ZVAL_FALSE(zv);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
|
||||
}
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative);
|
||||
|
||||
return props;
|
||||
}
|
||||
@@ -2389,7 +2322,6 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
|
||||
object_init_ex(object, pce);
|
||||
Z_SET_REFCOUNT_P(object, 1);
|
||||
Z_UNSET_ISREF_P(object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -2564,15 +2496,13 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
case TIMELIB_ZONETYPE_OFFSET:
|
||||
case TIMELIB_ZONETYPE_ABBR: {
|
||||
char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
|
||||
int ret;
|
||||
snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
|
||||
ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
|
||||
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
|
||||
efree(tmp);
|
||||
return 1 == ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
case TIMELIB_ZONETYPE_ID: {
|
||||
int ret;
|
||||
case TIMELIB_ZONETYPE_ID:
|
||||
convert_to_string(*z_timezone);
|
||||
|
||||
tzi = php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
|
||||
@@ -2583,10 +2513,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
|
||||
tzobj->tzi.tz = tzi;
|
||||
tzobj->initialized = 1;
|
||||
|
||||
ret = php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
|
||||
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
|
||||
zval_ptr_dtor(&tmp_obj);
|
||||
return 1 == ret;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2610,9 +2539,7 @@ PHP_METHOD(DateTime, __set_state)
|
||||
|
||||
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTime object");
|
||||
}
|
||||
php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2628,9 +2555,7 @@ PHP_METHOD(DateTime, __wakeup)
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DateTime object");
|
||||
}
|
||||
php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3661,48 +3586,30 @@ PHP_METHOD(DateInterval, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size)
|
||||
{
|
||||
zval **z_arg = NULL;
|
||||
|
||||
if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) {
|
||||
convert_to_long(*z_arg);
|
||||
return Z_LVAL_PP(z_arg);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
(*intobj)->diff = timelib_rel_time_ctor();
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
|
||||
do { \
|
||||
zval **z_arg = NULL; \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
|
||||
convert_to_long(*z_arg); \
|
||||
(*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = (itype)def; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \
|
||||
do { \
|
||||
zval **z_arg = NULL; \
|
||||
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
|
||||
convert_to_string(*z_arg); \
|
||||
DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = -1LL; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("y", y, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("m", m, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("d", d, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("have_special_relative", have_special_relative, unsigned int, 0);
|
||||
(*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1);
|
||||
(*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1);
|
||||
(*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1);
|
||||
(*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1);
|
||||
(*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1);
|
||||
(*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1);
|
||||
(*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6);
|
||||
(*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4);
|
||||
(*intobj)->initialized = 1;
|
||||
|
||||
return 0;
|
||||
@@ -4306,229 +4213,6 @@ PHP_FUNCTION(date_sun_info)
|
||||
timelib_time_dtor(t2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC)
|
||||
{
|
||||
*table = NULL;
|
||||
*n = 0;
|
||||
return zend_std_get_properties(object TSRMLS_CC);
|
||||
}
|
||||
|
||||
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC)
|
||||
{
|
||||
HashTable *props;
|
||||
zval *zv;
|
||||
php_period_obj *period_obj;
|
||||
|
||||
period_obj = zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
props = zend_std_get_properties(object TSRMLS_CC);
|
||||
|
||||
if (!period_obj->start || GC_G(gc_active)) {
|
||||
return props;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->start) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(zv, date_ce_date);
|
||||
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
date_obj->time = timelib_time_clone(period_obj->start);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "start", sizeof("start"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->current) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(zv, date_ce_date);
|
||||
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
date_obj->time = timelib_time_clone(period_obj->current);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "current", sizeof("current"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->end) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(zv, date_ce_date);
|
||||
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
date_obj->time = timelib_time_clone(period_obj->end);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "end", sizeof("end"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
if (period_obj->interval) {
|
||||
php_interval_obj *interval_obj;
|
||||
object_init_ex(zv, date_ce_interval);
|
||||
interval_obj = zend_object_store_get_object(zv TSRMLS_CC);
|
||||
interval_obj->diff = timelib_rel_time_clone(period_obj->interval);
|
||||
interval_obj->initialized = 1;
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
}
|
||||
zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL);
|
||||
|
||||
/* converted to larger type (int->long); must check when unserializing */
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_LONG(zv, (long) period_obj->recurrences);
|
||||
zend_hash_update(props, "recurrences", sizeof("recurrences"), &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_BOOL(zv, period_obj->include_start_date);
|
||||
zend_hash_update(props, "include_start_date", sizeof("include_start_date"), &zv, sizeof(zv), NULL);
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
zval **ht_entry;
|
||||
|
||||
/* this function does no rollback on error */
|
||||
|
||||
if (zend_hash_find(myht, "start", sizeof("start"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->start = timelib_time_clone(date_obj->time);
|
||||
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "end", sizeof("end"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->end = timelib_time_clone(date_obj->time);
|
||||
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "current", sizeof("current"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->current = timelib_time_clone(date_obj->time);
|
||||
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "interval", sizeof("interval"), (void**) &ht_entry) == SUCCESS) {
|
||||
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_interval) {
|
||||
php_interval_obj *interval_obj;
|
||||
interval_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
|
||||
period_obj->interval = timelib_rel_time_clone(interval_obj->diff);
|
||||
} else { /* interval is required */
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "recurrences", sizeof("recurrences"), (void**) &ht_entry) == SUCCESS &&
|
||||
Z_TYPE_PP(ht_entry) == IS_LONG && Z_LVAL_PP(ht_entry) >= 0 && Z_LVAL_PP(ht_entry) <= INT_MAX) {
|
||||
period_obj->recurrences = Z_LVAL_PP(ht_entry);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (zend_hash_find(myht, "include_start_date", sizeof("include_start_date"), (void**) &ht_entry) == SUCCESS &&
|
||||
Z_TYPE_PP(ht_entry) == IS_BOOL) {
|
||||
period_obj->include_start_date = Z_BVAL_PP(ht_entry);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
period_obj->initialized = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* {{{ proto DatePeriod::__set_state()
|
||||
*/
|
||||
PHP_METHOD(DatePeriod, __set_state)
|
||||
{
|
||||
php_period_obj *period_obj;
|
||||
zval *array;
|
||||
HashTable *myht;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
myht = Z_ARRVAL_P(array);
|
||||
|
||||
object_init_ex(return_value, date_ce_period);
|
||||
period_obj = zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto DatePeriod::__wakeup()
|
||||
*/
|
||||
PHP_METHOD(DatePeriod, __wakeup)
|
||||
{
|
||||
zval *object = getThis();
|
||||
php_period_obj *period_obj;
|
||||
HashTable *myht;
|
||||
|
||||
period_obj = zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
|
||||
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_read_property */
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC)
|
||||
{
|
||||
zval *zv;
|
||||
if (type != BP_VAR_IS && type != BP_VAR_R) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
|
||||
}
|
||||
|
||||
Z_OBJPROP_P(object); /* build properties hash table */
|
||||
|
||||
zv = std_object_handlers.read_property(object, member, type, key TSRMLS_CC);
|
||||
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
|
||||
/* defensive copy */
|
||||
zend_object_value zov = Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC);
|
||||
MAKE_STD_ZVAL(zv);
|
||||
Z_TYPE_P(zv) = IS_OBJECT;
|
||||
Z_OBJVAL_P(zv) = zov;
|
||||
}
|
||||
|
||||
return zv;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ date_period_write_property */
|
||||
static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC)
|
||||
{
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+3
-6
@@ -88,8 +88,6 @@ PHP_FUNCTION(date_interval_format);
|
||||
PHP_FUNCTION(date_interval_create_from_date_string);
|
||||
|
||||
PHP_METHOD(DatePeriod, __construct);
|
||||
PHP_METHOD(DatePeriod, __wakeup);
|
||||
PHP_METHOD(DatePeriod, __set_state);
|
||||
|
||||
/* Options and Configuration */
|
||||
PHP_FUNCTION(date_default_timezone_set);
|
||||
@@ -152,11 +150,10 @@ struct _php_period_obj {
|
||||
};
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(date)
|
||||
char *default_timezone;
|
||||
char *timezone;
|
||||
HashTable *tzcache;
|
||||
char *default_timezone;
|
||||
char *timezone;
|
||||
HashTable *tzcache;
|
||||
timelib_error_container *last_errors;
|
||||
int timezone_valid;
|
||||
ZEND_END_MODULE_GLOBALS(date)
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
@@ -11,8 +11,8 @@ $other = new DateTime("31-July-2008");
|
||||
$diff = date_diff($date, $other);
|
||||
|
||||
var_dump($diff);
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
--EXPECT--
|
||||
object(DateInterval)#3 (8) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -25,22 +25,8 @@ object(DateInterval)#%d (15) {
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(3)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -15,15 +15,8 @@ DateInterval Object
|
||||
[h] => 12
|
||||
[i] => 30
|
||||
[s] => 5
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] =>
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
[days] =>%s
|
||||
)
|
||||
DateInterval Object
|
||||
(
|
||||
@@ -33,13 +26,6 @@ DateInterval Object
|
||||
[h] => 12
|
||||
[i] => 30
|
||||
[s] => 5
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] => 0
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
[days] =>%s
|
||||
)
|
||||
@@ -17,13 +17,6 @@ DateInterval Object
|
||||
[h] => 4
|
||||
[i] => 0
|
||||
[s] => 0
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] => 30
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
)
|
||||
@@ -8,7 +8,7 @@ echo $i->format("%d"), "\n";
|
||||
echo $i->format("%a"), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
object(DateInterval)#1 (15) {
|
||||
object(DateInterval)#1 (8) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -21,24 +21,10 @@ object(DateInterval)#1 (15) {
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
7
|
||||
(unknown)
|
||||
@@ -4,6 +4,8 @@ Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimest
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 8) die('skip 32-bit only');
|
||||
?>
|
||||
--XFAIL--
|
||||
Waiting for resolution of the 32-bit case.
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
|
||||
@@ -32,7 +32,7 @@ var_dump($unser, $p);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(DateInterval)#3 (15) {
|
||||
object(DateInterval)#3 (8) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -45,26 +45,12 @@ object(DateInterval)#3 (15) {
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
|
||||
string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}"
|
||||
DateInterval::__set_state(array(
|
||||
'y' => 0,
|
||||
'm' => 0,
|
||||
@@ -72,16 +58,9 @@ DateInterval::__set_state(array(
|
||||
'h' => 4,
|
||||
'i' => 0,
|
||||
's' => 0,
|
||||
'weekday' => 0,
|
||||
'weekday_behavior' => 0,
|
||||
'first_last_day_of' => 0,
|
||||
'invert' => 0,
|
||||
'days' => 0,
|
||||
'special_type' => 0,
|
||||
'special_amount' => 0,
|
||||
'have_weekday_relative' => 0,
|
||||
'have_special_relative' => 0,
|
||||
))object(DateInterval)#5 (15) {
|
||||
))object(DateInterval)#5 (8) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -94,78 +73,14 @@ DateInterval::__set_state(array(
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DatePeriod)#6 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#4 (3) {
|
||||
["date"]=>
|
||||
string(19) "2003-01-02 08:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
NULL
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#7 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(4)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
object(DatePeriod)#6 (0) {
|
||||
}
|
||||
object(DateInterval)#8 (15) {
|
||||
object(DateInterval)#4 (8) {
|
||||
["y"]=>
|
||||
int(7)
|
||||
["m"]=>
|
||||
@@ -178,74 +93,10 @@ object(DateInterval)#8 (15) {
|
||||
int(3)
|
||||
["s"]=>
|
||||
int(2)
|
||||
["weekday"]=>
|
||||
int(-1)
|
||||
["weekday_behavior"]=>
|
||||
int(-1)
|
||||
["first_last_day_of"]=>
|
||||
int(-1)
|
||||
["invert"]=>
|
||||
int(1)
|
||||
["days"]=>
|
||||
int(2400)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DatePeriod)#9 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#6 (3) {
|
||||
["date"]=>
|
||||
string(19) "2003-01-02 08:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
NULL
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#7 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(4)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
object(DatePeriod)#7 (0) {
|
||||
}
|
||||
@@ -27,13 +27,6 @@ di Object
|
||||
[h] => 0
|
||||
[i] => 0
|
||||
[s] => 0
|
||||
[weekday] => 0
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] =>
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
[have_special_relative] => 0
|
||||
)
|
||||
@@ -25,7 +25,7 @@ foreach($intervals as $iv) {
|
||||
echo "==DONE==\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (15) {
|
||||
object(DateInterval)#%d (8) {
|
||||
["y"]=>
|
||||
int(1)
|
||||
["m"]=>
|
||||
@@ -38,26 +38,12 @@ object(DateInterval)#%d (15) {
|
||||
int(30)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(1)
|
||||
["days"]=>
|
||||
int(437)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DateInterval)#%d (15) {
|
||||
object(DateInterval)#%d (8) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -70,26 +56,12 @@ object(DateInterval)#%d (15) {
|
||||
int(30)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(294)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
object(DateInterval)#%d (15) {
|
||||
object(DateInterval)#%d (8) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
@@ -102,24 +74,10 @@ object(DateInterval)#%d (15) {
|
||||
int(30)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(294)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z/)
|
||||
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 1
|
||||
Bug #53437 (Crash when using unserialized DatePeriod instance)
|
||||
--XFAIL--
|
||||
Bug #53437 Not fixed yet
|
||||
--FILE--
|
||||
<?php
|
||||
$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2);
|
||||
@@ -18,137 +20,9 @@ $dpu = unserialize($ser); // $dpu has invalid values???
|
||||
var_dump($dpu);
|
||||
|
||||
echo "Unserialized:\r\n";
|
||||
// ???which leads to CRASH:
|
||||
foreach($dpu as $dt) {
|
||||
echo $dt->format('Y-m-d H:i:s')."\r\n";
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
Original:
|
||||
2010-01-01 00:00:00
|
||||
2010-01-02 00:00:00
|
||||
2010-01-03 00:00:00
|
||||
|
||||
object(DatePeriod)#1 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#2 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-01 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
object(DateTime)#4 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-04 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#5 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(1)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
}
|
||||
object(DatePeriod)#5 (6) {
|
||||
["start"]=>
|
||||
object(DateTime)#10 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-01 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["current"]=>
|
||||
object(DateTime)#7 (3) {
|
||||
["date"]=>
|
||||
string(19) "2010-01-04 00:00:00"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(3) "UTC"
|
||||
}
|
||||
["end"]=>
|
||||
NULL
|
||||
["interval"]=>
|
||||
object(DateInterval)#8 (15) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(1)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
["recurrences"]=>
|
||||
int(3)
|
||||
["include_start_date"]=>
|
||||
bool(true)
|
||||
}
|
||||
Unserialized:
|
||||
2010-01-01 00:00:00
|
||||
2010-01-02 00:00:00
|
||||
2010-01-03 00:00:00
|
||||
==DONE==
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 2
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:10:"DatePeriod":0:{}';
|
||||
|
||||
$dp = unserialize($s);
|
||||
|
||||
var_dump($dp);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d
|
||||
Loaded 100 of 831 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user