diff options
Diffstat (limited to 'Zend/tests')
531 files changed, 3488 insertions, 419 deletions
diff --git a/Zend/tests/007.phpt b/Zend/tests/007.phpt index f22b044bb5..6120181269 100644 --- a/Zend/tests/007.phpt +++ b/Zend/tests/007.phpt @@ -25,6 +25,8 @@ echo "Done\n"; Warning: each() expects exactly 1 parameter, 0 given in %s on line %d NULL +Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d + Warning: Variable passed to each() is not an array or object in %s on line %d NULL diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt index 76ca486cd8..82cfabee49 100644 --- a/Zend/tests/009.phpt +++ b/Zend/tests/009.phpt @@ -7,6 +7,10 @@ class foo { function bar () { var_dump(get_class()); } + function testNull () + { + var_dump(get_class(null)); + } } class foo2 extends foo { @@ -27,6 +31,8 @@ var_dump(get_class("qwerty")); var_dump(get_class($f1)); var_dump(get_class($f2)); +$f1->testNull(); + echo "Done\n"; ?> --EXPECTF-- @@ -45,4 +51,7 @@ Warning: get_class() expects parameter 1 to be object, string given in %s on lin bool(false) string(3) "foo" string(4) "foo2" + +Warning: get_class() expects parameter 1 to be object, null given in %s on line %d +bool(false) Done diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt index f89c49e613..34dac0f1e3 100644 --- a/Zend/tests/024.phpt +++ b/Zend/tests/024.phpt @@ -37,15 +37,15 @@ NULL Notice: Undefined variable: b in %s on line %d int(1) -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property '1' of non-object in %s on line %d NULL -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property '1' of non-object in %s on line %d NULL Notice: Undefined variable: c in %s on line %d -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property '1' of non-object in %s on line %d -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property '' of non-object in %s on line %d NULL diff --git a/Zend/tests/026.phpt b/Zend/tests/026.phpt index 5fa0e1677c..b3088e8473 100644 --- a/Zend/tests/026.phpt +++ b/Zend/tests/026.phpt @@ -18,7 +18,7 @@ print "ok\n"; ?> --EXPECTF-- -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property 'a' of non-object in %s on line %d ok Warning: Creating default object from empty value in %s on line %d diff --git a/Zend/tests/033.phpt b/Zend/tests/033.phpt index aa2804343a..b506f9172e 100644 --- a/Zend/tests/033.phpt +++ b/Zend/tests/033.phpt @@ -17,13 +17,14 @@ $arr[][]->bar = 2; ?> --EXPECTF-- + Notice: Undefined variable: arr in %s on line %d Notice: Undefined variable: arr in %s on line %d Notice: Undefined variable: arr in %s on line %d -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property 'foo' of non-object in %s on line %d Warning: Creating default object from empty value in %s on line %d diff --git a/Zend/tests/ErrorException_getSeverity.phpt b/Zend/tests/ErrorException_getSeverity.phpt new file mode 100644 index 0000000000..873ea68f6f --- /dev/null +++ b/Zend/tests/ErrorException_getSeverity.phpt @@ -0,0 +1,1261 @@ +--TEST-- +final public int ErrorException::getSeverity ( void ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--INI-- +error_reporting = E_ALL +--FILE-- +<?php + +const EXCEPTION_CODE_ERROR = 0; +const EXCEPTION_SEVERITY_ERROR_MSG = "This exception severity is: "; +const EXCEPTION_PARAM_MSG = "string message param"; +const EXCEPTION_TRACE_AS_STRING_MSG = "#0 {main}"; + +try { + throw new ErrorException(); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === ""); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_ERROR); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_WARNING); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_PARSE); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_PARSE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_NOTICE); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_ERROR); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_ERROR); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_WARNING); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_ERROR); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_WARNING); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_NOTICE); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_STRICT); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_RECOVERABLE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_DEPRECATED); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_DEPRECATED); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_ERROR, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_WARNING, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_PARSE, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_PARSE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_NOTICE, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_ERROR, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_ERROR, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_WARNING, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_ERROR, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_WARNING, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_NOTICE, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_STRICT); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_RECOVERABLE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_DEPRECATED, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_DEPRECATED, __FILE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_ERROR, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_WARNING, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_PARSE, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_PARSE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_NOTICE, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_ERROR, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_ERROR, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_WARNING, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_ERROR, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_WARNING, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_NOTICE, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_STRICT); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_RECOVERABLE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_DEPRECATED, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_DEPRECATED, __FILE__, __LINE__); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_DEPRECATED, __FILE__, __LINE__, NULL); +} catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_ERROR, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_ERROR, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_WARNING, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_WARNING, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_PARSE, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_PARSE, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_PARSE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_NOTICE, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_NOTICE, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_ERROR, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_ERROR, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_CORE_WARNING, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_CORE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_ERROR, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_ERROR, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_WARNING, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_COMPILE_WARNING, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_COMPILE_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_ERROR, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_ERROR, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_WARNING, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_WARNING, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_WARNING); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_NOTICE, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_NOTICE, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_NOTICE); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_STRICT); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_RECOVERABLE_ERROR); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_DEPRECATED, __FILE__, __LINE__, NULL); +} catch(Exception $exceptionErr) { + try { + throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_USER_DEPRECATED, __FILE__, __LINE__, $exceptionErr->getPrevious()); + } catch(ErrorException $e) { + echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity(); + var_dump($e->getSeverity() === E_USER_DEPRECATED); + var_dump($e->getMessage() === EXCEPTION_PARAM_MSG); + var_dump($e->getCode() === 0); + var_dump($e->getPrevious() === NULL); + var_dump($e->getFile() === __FILE__); + var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG); + } +} + +?> +--EXPECTF-- +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 64bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 128bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 256bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 512bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1024bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2048bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4096bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8192bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16384bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 64bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 128bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 256bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 512bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1024bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2048bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4096bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8192bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16384bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 64bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 128bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 256bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 512bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1024bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2048bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4096bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8192bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16384bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16384bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 8bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 32bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 64bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 128bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 256bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 512bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 1024bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 2048bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 4096bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +This exception severity is: 16384bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) diff --git a/Zend/tests/abstract-static.phpt b/Zend/tests/abstract-static.phpt index 997661e71f..bf7ed391ed 100644 --- a/Zend/tests/abstract-static.phpt +++ b/Zend/tests/abstract-static.phpt @@ -9,4 +9,5 @@ abstract class TestClass ?> ===DONE=== --EXPECTF-- + ===DONE=== diff --git a/Zend/tests/abstract_inheritance_001.phpt b/Zend/tests/abstract_inheritance_001.phpt new file mode 100644 index 0000000000..2bef85f8b3 --- /dev/null +++ b/Zend/tests/abstract_inheritance_001.phpt @@ -0,0 +1,12 @@ +--TEST-- +Allow abstract function override +--FILE-- +<?php + +abstract class A { abstract function bar($x); } +abstract class B extends A { abstract function bar($x); } + +echo "DONE"; +?> +--EXPECT-- +DONE diff --git a/Zend/tests/abstract_inheritance_002.phpt b/Zend/tests/abstract_inheritance_002.phpt new file mode 100644 index 0000000000..916dbb3e32 --- /dev/null +++ b/Zend/tests/abstract_inheritance_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +Allow abstract function override +--FILE-- +<?php + +abstract class A { abstract function bar($x); } +abstract class B extends A { abstract function bar($x, $y = 0); } + +echo "DONE"; +?> +--EXPECT-- +DONE diff --git a/Zend/tests/abstract_inheritance_003.phpt b/Zend/tests/abstract_inheritance_003.phpt new file mode 100644 index 0000000000..6af55b7d86 --- /dev/null +++ b/Zend/tests/abstract_inheritance_003.phpt @@ -0,0 +1,12 @@ +--TEST-- +Allow abstract function override +--FILE-- +<?php + +abstract class A { abstract function bar($x, $y = 0); } +abstract class B extends A { abstract function bar($x); } + +echo "DONE"; +?> +--EXPECTF-- +Fatal error: Declaration of B::bar($x) must be compatible with A::bar($x, $y = 0) in %s diff --git a/Zend/tests/add_006.phpt b/Zend/tests/add_006.phpt index 2e7f76b4ee..c1124e026c 100644 --- a/Zend/tests/add_006.phpt +++ b/Zend/tests/add_006.phpt @@ -38,6 +38,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- + Warning: A non-numeric value encountered in %s on line %d int(75636) diff --git a/Zend/tests/add_007.phpt b/Zend/tests/add_007.phpt index 3b24a1c99c..6d9af8a9f5 100644 --- a/Zend/tests/add_007.phpt +++ b/Zend/tests/add_007.phpt @@ -19,6 +19,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- + Warning: A non-numeric value encountered in %s on line %d Exception: Unsupported operand types diff --git a/Zend/tests/anon/001.phpt b/Zend/tests/anon/001.phpt index 65ba15148b..75589550a8 100644 --- a/Zend/tests/anon/001.phpt +++ b/Zend/tests/anon/001.phpt @@ -6,3 +6,5 @@ var_dump(new class{}); --EXPECTF-- object(class@%s)#%d (0) { } + + diff --git a/Zend/tests/anon/002.phpt b/Zend/tests/anon/002.phpt index cbd2ac6d89..1cbaf81a9f 100644 --- a/Zend/tests/anon/002.phpt +++ b/Zend/tests/anon/002.phpt @@ -18,3 +18,4 @@ var_dump($a instanceof A, $a instanceof B); --EXPECTF-- bool(true) bool(true) + diff --git a/Zend/tests/anon/003.phpt b/Zend/tests/anon/003.phpt index 7c95e86632..ac023f43a5 100644 --- a/Zend/tests/anon/003.phpt +++ b/Zend/tests/anon/003.phpt @@ -51,3 +51,4 @@ object(class@%s)#1 (1) { ["i"]=> int(10) } + diff --git a/Zend/tests/anon/006.phpt b/Zend/tests/anon/006.phpt index 0be1c33317..2b8888c497 100644 --- a/Zend/tests/anon/006.phpt +++ b/Zend/tests/anon/006.phpt @@ -12,3 +12,4 @@ namespace { --EXPECTF-- object(class@%s)#1 (0) { } + diff --git a/Zend/tests/anon/007.phpt b/Zend/tests/anon/007.phpt index dbc86c593e..59d2441760 100644 --- a/Zend/tests/anon/007.phpt +++ b/Zend/tests/anon/007.phpt @@ -20,3 +20,4 @@ namespace lone { --EXPECTF-- object(class@%s)#2 (0) { } + diff --git a/Zend/tests/anonymous_func_001.phpt b/Zend/tests/anonymous_func_001.phpt index 974e90ed5d..97b91b6544 100644 --- a/Zend/tests/anonymous_func_001.phpt +++ b/Zend/tests/anonymous_func_001.phpt @@ -12,24 +12,43 @@ for ($i = 0; $i < 10; $i++) { } ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function create_function() is deprecated in %s on line %d int(0) int(0) + +Deprecated: Function create_function() is deprecated in %s on line %d int(1) int(1) + +Deprecated: Function create_function() is deprecated in %s on line %d int(2) int(2) + +Deprecated: Function create_function() is deprecated in %s on line %d int(3) int(3) + +Deprecated: Function create_function() is deprecated in %s on line %d int(4) int(4) + +Deprecated: Function create_function() is deprecated in %s on line %d int(5) int(5) + +Deprecated: Function create_function() is deprecated in %s on line %d int(6) int(6) + +Deprecated: Function create_function() is deprecated in %s on line %d int(7) int(7) + +Deprecated: Function create_function() is deprecated in %s on line %d int(8) int(8) + +Deprecated: Function create_function() is deprecated in %s on line %d int(9) int(9) diff --git a/Zend/tests/anonymous_func_002.phpt b/Zend/tests/anonymous_func_002.phpt index 350c9ec395..28adc357da 100644 --- a/Zend/tests/anonymous_func_002.phpt +++ b/Zend/tests/anonymous_func_002.phpt @@ -11,6 +11,9 @@ var_dump($arr[$test(1)]); var_dump($arr[$test(0)]() == $arr); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function create_function() is deprecated in %s on line %d + +Deprecated: Function create_function() is deprecated in %s on line %d int(2) bool(true) diff --git a/Zend/tests/anonymous_func_003.phpt b/Zend/tests/anonymous_func_003.phpt index bef302899d..d2610310f7 100644 --- a/Zend/tests/anonymous_func_003.phpt +++ b/Zend/tests/anonymous_func_003.phpt @@ -11,5 +11,6 @@ try { } ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function create_function() is deprecated in %s on line %d bool(true) diff --git a/Zend/tests/assert/bug70208.phpt b/Zend/tests/assert/bug70208.phpt index ec9325334c..6b7dfaeb33 100644 --- a/Zend/tests/assert/bug70208.phpt +++ b/Zend/tests/assert/bug70208.phpt @@ -19,5 +19,6 @@ class test { new test; ?> ---EXPECT-- +--EXPECTF-- +Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d int(1) diff --git a/Zend/tests/assert/expect_013.phpt b/Zend/tests/assert/expect_013.phpt index b5d037fea6..cf8fa1cd02 100644 --- a/Zend/tests/assert/expect_013.phpt +++ b/Zend/tests/assert/expect_013.phpt @@ -8,4 +8,4 @@ assert.exception=1 var_dump(assert(false)); ?> --EXPECT-- -bool(true) +bool(true)
\ No newline at end of file diff --git a/Zend/tests/assert/expect_014.phpt b/Zend/tests/assert/expect_014.phpt index def99402ec..7cf4fb1931 100644 --- a/Zend/tests/assert/expect_014.phpt +++ b/Zend/tests/assert/expect_014.phpt @@ -9,4 +9,4 @@ assert(false); var_dump(true); ?> --EXPECT-- -bool(true) +bool(true)
\ No newline at end of file diff --git a/Zend/tests/assert/indirect_var_access_misoptimization.phpt b/Zend/tests/assert/indirect_var_access_misoptimization.phpt index 61c193ab60..6c05a8c607 100644 --- a/Zend/tests/assert/indirect_var_access_misoptimization.phpt +++ b/Zend/tests/assert/indirect_var_access_misoptimization.phpt @@ -15,5 +15,7 @@ test(); ?> --EXPECTF-- +Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d + Notice: Object of class stdClass could not be converted to int in %s on line %d int(2) diff --git a/Zend/tests/assign_dim_obj_null_return.phpt b/Zend/tests/assign_dim_obj_null_return.phpt index e833ef3591..cff877fd8f 100644 --- a/Zend/tests/assign_dim_obj_null_return.phpt +++ b/Zend/tests/assign_dim_obj_null_return.phpt @@ -49,8 +49,8 @@ NULL Warning: Cannot use a scalar value as an array in %s on line %d NULL -Warning: Attempt to assign property of non-object in %s on line %d +Warning: Attempt to assign property 'foo' of non-object in %s on line %d NULL -Warning: Attempt to assign property of non-object in %s on line %d +Warning: Attempt to assign property 'foo' of non-object in %s on line %d NULL diff --git a/Zend/tests/bug19859.phpt b/Zend/tests/bug19859.phpt index d961b75a78..6eb1701e7b 100644 --- a/Zend/tests/bug19859.phpt +++ b/Zend/tests/bug19859.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #19859 (__call() does not catch call_user_func_array() calls) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --FILE-- <?php class test diff --git a/Zend/tests/bug20240.phpt b/Zend/tests/bug20240.phpt index 53bb050576..9e2f23ba66 100644 --- a/Zend/tests/bug20240.phpt +++ b/Zend/tests/bug20240.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #20240 (order of destructor calls) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --FILE-- <?php diff --git a/Zend/tests/bug21478.phpt b/Zend/tests/bug21478.phpt index 0603a55af5..3e868ccaf9 100644 --- a/Zend/tests/bug21478.phpt +++ b/Zend/tests/bug21478.phpt @@ -2,7 +2,6 @@ Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault) --SKIPIF-- <?php - if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); if (!function_exists('stream_filter_register')) die('skip stream_filter_register() not available'); ?> --FILE-- diff --git a/Zend/tests/bug21888.phpt b/Zend/tests/bug21888.phpt index 582dbdc85c..b79db58e14 100644 --- a/Zend/tests/bug21888.phpt +++ b/Zend/tests/bug21888.phpt @@ -1,9 +1,5 @@ --TEST-- Bug #21888 (protected property and protected method of the same name) ---SKIPIF-- -<?php - if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); -?> --FILE-- <?php class mom { diff --git a/Zend/tests/bug22725.phpt b/Zend/tests/bug22725.phpt index 5f3c258b14..e5dc49d8f6 100644 --- a/Zend/tests/bug22725.phpt +++ b/Zend/tests/bug22725.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #22725 (A derived class can call a parent's protected method that calls a private method) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> --FILE-- <?php class Foo { diff --git a/Zend/tests/bug22836.phpt b/Zend/tests/bug22836.phpt index 06a5c3242c..205fd1c696 100644 --- a/Zend/tests/bug22836.phpt +++ b/Zend/tests/bug22836.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #22836 (returning references to NULL) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --FILE-- <?php function &f() diff --git a/Zend/tests/bug24436.phpt b/Zend/tests/bug24436.phpt index 0c261b668e..11b8702cdc 100644 --- a/Zend/tests/bug24436.phpt +++ b/Zend/tests/bug24436.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #24436 (isset()/empty() produce errors with non-existent variables in classes) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --INI-- error_reporting=2047 --FILE-- diff --git a/Zend/tests/bug24635.phpt b/Zend/tests/bug24635.phpt index 9574483923..7235859d3a 100644 --- a/Zend/tests/bug24635.phpt +++ b/Zend/tests/bug24635.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #24635 (crash on dtor calling other functions) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --FILE-- <?php class SiteClass { diff --git a/Zend/tests/bug24699.phpt b/Zend/tests/bug24699.phpt index 81ca4f5091..0958a6e673 100644 --- a/Zend/tests/bug24699.phpt +++ b/Zend/tests/bug24699.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #24699 (Memory Leak with per-class constants) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --FILE-- <?php class TEST { const FOO = SEEK_CUR; }; diff --git a/Zend/tests/bug24884.phpt b/Zend/tests/bug24884.phpt index 457acd00d5..3788479cb0 100644 --- a/Zend/tests/bug24884.phpt +++ b/Zend/tests/bug24884.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #24884 (calling $this->__clone(); crashes php) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> --FILE-- <?php class Test { diff --git a/Zend/tests/bug26010.phpt b/Zend/tests/bug26010.phpt index 9761700bb8..a3c41faefc 100644 --- a/Zend/tests/bug26010.phpt +++ b/Zend/tests/bug26010.phpt @@ -16,3 +16,4 @@ array(1) { ["public"]=> string(6) "public" } + diff --git a/Zend/tests/bug26696.phpt b/Zend/tests/bug26696.phpt index 14083dfb9f..62ceacda58 100644 --- a/Zend/tests/bug26696.phpt +++ b/Zend/tests/bug26696.phpt @@ -19,4 +19,4 @@ for ($i = 0; $i < $len; $i++) { ===DONE=== --EXPECT-- a-s-d-d-/-?+ -===DONE=== +===DONE===
\ No newline at end of file diff --git a/Zend/tests/bug26697.phpt b/Zend/tests/bug26697.phpt index 8266a23e34..8dda17028a 100644 --- a/Zend/tests/bug26697.phpt +++ b/Zend/tests/bug26697.phpt @@ -1,24 +1,21 @@ --TEST-- Bug #26697 (calling class_exists on a nonexistent class in __autoload results in segfault) ---SKIPIF-- -<?php if (function_exists('__autoload')) die('skip __autoload() declared in auto_prepend_file');?> --FILE-- <?php -function __autoload($name) -{ +spl_autoload_register(function ($name) { echo __METHOD__ . "($name)\n"; var_dump(class_exists('NotExistingClass')); echo __METHOD__ . "($name), done\n"; -} +}); var_dump(class_exists('NotExistingClass')); ?> ===DONE=== --EXPECTF-- -__autoload(NotExistingClass) +{closure}(NotExistingClass) bool(false) -__autoload(NotExistingClass), done +{closure}(NotExistingClass), done bool(false) ===DONE=== diff --git a/Zend/tests/bug26698.phpt b/Zend/tests/bug26698.phpt index aecc708a0d..a4d6ad13f8 100644 --- a/Zend/tests/bug26698.phpt +++ b/Zend/tests/bug26698.phpt @@ -5,7 +5,7 @@ Bug #26698 (Thrown exceptions while evaluting argument to pass as parameter cras ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine -class Object +class ObjectOne { function getNone() { @@ -23,7 +23,7 @@ class Proxy { try { - $res = new Object(); + $res = new ObjectOne(); $this->three($res->getNone()); } catch(Exception $e) @@ -36,7 +36,7 @@ class Proxy { try { - $res = new Object(); + $res = new ObjectOne(); $this->three(1, $res->getNone()); } catch(Exception $e) @@ -49,7 +49,7 @@ class Proxy { try { - $res = new Object(); + $res = new ObjectOne(); $this->three(1, 2, $res->getNone()); } catch(Exception $e) diff --git a/Zend/tests/bug28444.phpt b/Zend/tests/bug28444.phpt index 78c08d2fc6..b7e863da92 100644 --- a/Zend/tests/bug28444.phpt +++ b/Zend/tests/bug28444.phpt @@ -9,7 +9,7 @@ function my_error_handler($errno, $errstr, $errfile, $errline) { set_error_handler('my_error_handler'); -class Object +class ObjectOne { public $x; @@ -26,7 +26,7 @@ class Overloaded function __construct($x) { - $this->x = new Object($x); + $this->x = new ObjectOne($x); } function __get($prop) @@ -47,7 +47,7 @@ var_dump($y->x->x); var_dump($y->x->x = 3); var_dump($y->y = 3); var_dump($y->y); -var_dump($y->z = new Object(4)); +var_dump($y->z = new ObjectOne(4)); var_dump($y->z->x); $t = $y->z; var_dump($t->x = 5); @@ -56,7 +56,7 @@ var_dump($y->z->x = 6); ?> ===DONE=== --EXPECTF-- -object(Object)#%d (1) { +object(ObjectOne)#%d (1) { ["x"]=> int(2) } @@ -66,9 +66,9 @@ Overloaded::__set(y,3) int(3) Overloaded::__get(y) int(3) -string(55) "Object of class Object could not be converted to string" +string(58) "Object of class ObjectOne could not be converted to string" Overloaded::__set(z,) -object(Object)#%d (1) { +object(ObjectOne)#%d (1) { ["x"]=> int(4) } diff --git a/Zend/tests/bug29896.phpt b/Zend/tests/bug29896.phpt index 35a92d459c..1e2eb0b067 100644 --- a/Zend/tests/bug29896.phpt +++ b/Zend/tests/bug29896.phpt @@ -25,3 +25,4 @@ GenerateError2("Test2"); #0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11] #1 GenerateError1(Test1) called at [%sbug29896.php:16] #2 GenerateError2(Test2) called at [%sbug29896.php:19] + diff --git a/Zend/tests/bug29944.phpt b/Zend/tests/bug29944.phpt index 41a8159d52..6c0cf1ec7a 100644 --- a/Zend/tests/bug29944.phpt +++ b/Zend/tests/bug29944.phpt @@ -13,3 +13,4 @@ switch ($a) { ?> --EXPECT-- ok + diff --git a/Zend/tests/bug30162.phpt b/Zend/tests/bug30162.phpt index 55d26a3e3a..9cd3e9d524 100644 --- a/Zend/tests/bug30162.phpt +++ b/Zend/tests/bug30162.phpt @@ -51,4 +51,4 @@ object(hariCow)#%d (2) { ["y"]=> string(1) "y" } -===DONE=== +===DONE===
\ No newline at end of file diff --git a/Zend/tests/bug30519.phpt b/Zend/tests/bug30519.phpt index f633d11445..7d70cba071 100644 --- a/Zend/tests/bug30519.phpt +++ b/Zend/tests/bug30519.phpt @@ -7,3 +7,4 @@ class test implements a { ?> --EXPECTF-- Fatal error: Interface 'a' not found in %sbug30519.php on line 2 + diff --git a/Zend/tests/bug31098.phpt b/Zend/tests/bug31098.phpt index c542b5bbca..1849528231 100644 --- a/Zend/tests/bug31098.phpt +++ b/Zend/tests/bug31098.phpt @@ -44,7 +44,7 @@ ok ok ok -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property 'wrong' of non-object in %s on line %d ok Warning: Illegal string offset 'wrong' in %s on line %d diff --git a/Zend/tests/bug31102.phpt b/Zend/tests/bug31102.phpt index 5de01f7282..fd6da0f7c2 100644 --- a/Zend/tests/bug31102.phpt +++ b/Zend/tests/bug31102.phpt @@ -5,8 +5,7 @@ Bug #31102 (Exception not handled when thrown inside __autoload()) $test = 0; -function __autoload($class) -{ +spl_autoload_register(function ($class) { global $test; echo __METHOD__ . "($class,$test)\n"; @@ -22,7 +21,7 @@ function __autoload($class) case 3: return; } -} +}); while($test++ < 5) { @@ -39,11 +38,11 @@ while($test++ < 5) ===DONE=== <?php exit(0); ?> --EXPECTF-- -__autoload(Test1,1) +{closure}(Test1,1) Caught: Test1::__construct -__autoload(Test2,2) -Caught: __autoload -__autoload(Test3,3) +{closure}(Test2,2) +Caught: {closure} +{closure}(Test3,3) Fatal error: Uncaught Error: Class 'Test3' not found in %sbug31102.php(%d) : eval()'d code:1 Stack trace: diff --git a/Zend/tests/bug32596.phpt b/Zend/tests/bug32596.phpt index 40bd70382b..287495d150 100644 --- a/Zend/tests/bug32596.phpt +++ b/Zend/tests/bug32596.phpt @@ -24,3 +24,4 @@ echo "this is still executed\n"; BUG please fix this thing, it wasted a nice part of my life! this is still executed + diff --git a/Zend/tests/bug33116.phpt b/Zend/tests/bug33116.phpt index aa714a1f85..13aae6611e 100644 --- a/Zend/tests/bug33116.phpt +++ b/Zend/tests/bug33116.phpt @@ -2,11 +2,10 @@ Bug #33116 (crash when assigning class name to global variable in __autoload) --FILE-- <?php -function __autoload($class) -{ +spl_autoload_register(function ($class) { $GLOBALS['include'][] = $class; eval("class DefClass{}"); -} +}); $a = new DefClass; print_r($a); diff --git a/Zend/tests/bug33318.phpt b/Zend/tests/bug33318.phpt index 3b79588757..74ac9552bc 100644 --- a/Zend/tests/bug33318.phpt +++ b/Zend/tests/bug33318.phpt @@ -8,4 +8,4 @@ throw 1; Fatal error: Uncaught Error: Can only throw objects in %sbug33318.php:2 Stack trace: #0 {main} - thrown in %sbug33318.php on line 2 + thrown in %sbug33318.php on line 2
\ No newline at end of file diff --git a/Zend/tests/bug33558.phpt b/Zend/tests/bug33558.phpt index 5c00ad7ca6..9c87fc6017 100644 --- a/Zend/tests/bug33558.phpt +++ b/Zend/tests/bug33558.phpt @@ -18,3 +18,4 @@ echo "$a\n"; ?> --EXPECT-- ok + diff --git a/Zend/tests/bug34062.phpt b/Zend/tests/bug34062.phpt index f1c0e477a9..bcb4ad8c64 100644 --- a/Zend/tests/bug34062.phpt +++ b/Zend/tests/bug34062.phpt @@ -21,3 +21,4 @@ try { ((( here ))) + diff --git a/Zend/tests/bug34064.phpt b/Zend/tests/bug34064.phpt index 83c6902803..1b61f34775 100644 --- a/Zend/tests/bug34064.phpt +++ b/Zend/tests/bug34064.phpt @@ -36,3 +36,4 @@ Stack trace: #0 %s(%d): XmlTest->run() #1 {main} thrown in %sbug34064.php on line 18 + diff --git a/Zend/tests/bug34199.phpt b/Zend/tests/bug34199.phpt index d9b8e43c39..3012d808fa 100644 --- a/Zend/tests/bug34199.phpt +++ b/Zend/tests/bug34199.phpt @@ -15,3 +15,4 @@ if(!$kids) echo "ok\n"; else echo "bug\n"; bool(false) ok ok + diff --git a/Zend/tests/bug34879.phpt b/Zend/tests/bug34879.phpt index 6c422ca268..606142bde7 100644 --- a/Zend/tests/bug34879.phpt +++ b/Zend/tests/bug34879.phpt @@ -8,4 +8,4 @@ print_r(str_replace('a', 'b', array(-1 =>-1))); Array ( [-1] => -1 -) +)
\ No newline at end of file diff --git a/Zend/tests/bug35470.phpt b/Zend/tests/bug35470.phpt index 5a854552bb..01d045744a 100644 --- a/Zend/tests/bug35470.phpt +++ b/Zend/tests/bug35470.phpt @@ -5,7 +5,7 @@ Bug #35470 (Assigning global using variable name from array doesn't function) $x = array("test", "55"); global ${$x[0]}; ${$x[0]} = $x[1]; -echo "Test: $test\n";; +echo "Test: $test\n"; ?> --EXPECT-- Test: 55 diff --git a/Zend/tests/bug36071.phpt b/Zend/tests/bug36071.phpt index 945118fef3..31179ea3f9 100644 --- a/Zend/tests/bug36071.phpt +++ b/Zend/tests/bug36071.phpt @@ -11,4 +11,4 @@ $a[0]->b = 0; Fatal error: Uncaught Error: __clone method called on non-object in %sbug36071.php:2 Stack trace: #0 {main} - thrown in %sbug36071.php on line 2 + thrown in %sbug36071.php on line 2
\ No newline at end of file diff --git a/Zend/tests/bug36303.phpt b/Zend/tests/bug36303.phpt index 0f92323834..3ea036a838 100644 --- a/Zend/tests/bug36303.phpt +++ b/Zend/tests/bug36303.phpt @@ -8,7 +8,7 @@ foreach($x->a->b as &$v) { echo "ok\n"; ?> --EXPECTF-- -Warning: Attempt to modify property of non-object in %sbug36303.php on line 3 +Warning: Attempt to modify property 'a' of non-object in %sbug36303.php on line 3 Warning: Invalid argument supplied for foreach() in %sbug36303.php on line 3 ok diff --git a/Zend/tests/bug37138.phpt b/Zend/tests/bug37138.phpt index c81b167467..e39ad199a1 100644 --- a/Zend/tests/bug37138.phpt +++ b/Zend/tests/bug37138.phpt @@ -2,7 +2,7 @@ Bug #37138 (__autoload tries to load callback'ed self and parent) --FILE-- <?php -function __autoload ($CN) {var_dump ($CN);} +spl_autoload_register(function ($CN) { var_dump ($CN); }); class st { public static function e () {echo ("EHLO\n");} public static function e2 () {call_user_func (array ('self', 'e'));} @@ -18,3 +18,4 @@ stch::g (); EHLO EHLO EHLO + diff --git a/Zend/tests/bug37707.phpt b/Zend/tests/bug37707.phpt index ac2dfb8777..1964958526 100644 --- a/Zend/tests/bug37707.phpt +++ b/Zend/tests/bug37707.phpt @@ -13,3 +13,4 @@ echo "NO LEAK\n"; --EXPECT-- clonned NO LEAK + diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt index f224f9b311..299018363d 100644 --- a/Zend/tests/bug37811.phpt +++ b/Zend/tests/bug37811.phpt @@ -23,6 +23,6 @@ string(3) "Foo" Warning: Constants may only evaluate to scalar values or arrays in %sbug37811.php on line %d -Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d +Warning: Use of undefined constant Baz - assumed 'Baz' (this will throw an Error in a future version of PHP) in %sbug37811.php on line %d string(3) "Baz" ===DONE=== diff --git a/Zend/tests/bug38808.phpt b/Zend/tests/bug38808.phpt index 487a569b6d..0fc4bfecdc 100644 --- a/Zend/tests/bug38808.phpt +++ b/Zend/tests/bug38808.phpt @@ -14,4 +14,4 @@ echo $current($a)."\n"; ?> --EXPECT-- one -two +two
\ No newline at end of file diff --git a/Zend/tests/bug39003.phpt b/Zend/tests/bug39003.phpt index a4e0f6c6eb..dc1c69e8c7 100644 --- a/Zend/tests/bug39003.phpt +++ b/Zend/tests/bug39003.phpt @@ -10,10 +10,9 @@ class ClassName function test (OtherClassName $object) { } -function __autoload($class) -{ +spl_autoload_register(function ($class) { var_dump("__autload($class)"); -} +}); $obj = new ClassName; test($obj); diff --git a/Zend/tests/bug39304.phpt b/Zend/tests/bug39304.phpt index 9cc15de527..4394cae1d4 100644 --- a/Zend/tests/bug39304.phpt +++ b/Zend/tests/bug39304.phpt @@ -4,8 +4,9 @@ Bug #39304 (Segmentation fault with list unpacking of string offset) <?php $s = ""; list($a, $b) = $s[0]; -echo "I am alive"; + var_dump($a,$b); ?> --EXPECTF-- Notice: Uninitialized string offset: 0 in %sbug39304.php on line %d -I am alive +NULL +NULL diff --git a/Zend/tests/bug39304_2_4.phpt b/Zend/tests/bug39304_2_4.phpt deleted file mode 100644 index da94183f61..0000000000 --- a/Zend/tests/bug39304_2_4.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #39304 (Segmentation fault with list unpacking of string offset) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?> ---FILE-- -<?php - $s = ""; - list($a, $b) = $s[0]; - var_dump($a,$b); -?> ---EXPECTF-- -Notice: Uninitialized string offset: 0 in %sbug39304_2_4.php on line %d -NULL -NULL diff --git a/Zend/tests/bug39542.phpt b/Zend/tests/bug39542.phpt index 13ddc0a91f..2008fe140a 100644 --- a/Zend/tests/bug39542.phpt +++ b/Zend/tests/bug39542.phpt @@ -10,11 +10,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { set_include_path(dirname(__FILE__).'/bug39542:.'); } -function __autoload($class) { +spl_autoload_register(function ($class) { if (!require_once($class.'.php')) { error_log('Error: Autoload class: '.$class.' not found!'); } -} +}); new bug39542(); diff --git a/Zend/tests/bug41401.phpt b/Zend/tests/bug41401.phpt index 096091e439..50d2109cac 100644 --- a/Zend/tests/bug41401.phpt +++ b/Zend/tests/bug41401.phpt @@ -7,4 +7,4 @@ echo "\n"; echo 6/+2*-3; --EXPECT-- -2.5 --9 +-9
\ No newline at end of file diff --git a/Zend/tests/bug42143.phpt b/Zend/tests/bug42143.phpt index 87c48f0859..8a73d41bf8 100644 --- a/Zend/tests/bug42143.phpt +++ b/Zend/tests/bug42143.phpt @@ -35,3 +35,4 @@ bool(false) bool(true) bool(true) bool(false) + diff --git a/Zend/tests/bug42798.phpt b/Zend/tests/bug42798.phpt index 1c45867722..1141a30503 100644 --- a/Zend/tests/bug42798.phpt +++ b/Zend/tests/bug42798.phpt @@ -2,10 +2,10 @@ Bug #42798 (_autoload() not triggered for classes used in method signature) --FILE-- <?php -function __autoload($className) { +spl_autoload_register(function ($className) { print "$className\n"; exit(); -} +}); function foo($c = ok::constant) { } diff --git a/Zend/tests/bug42818.phpt b/Zend/tests/bug42818.phpt index b37ce13fd1..4ebe9cc35d 100644 --- a/Zend/tests/bug42818.phpt +++ b/Zend/tests/bug42818.phpt @@ -9,3 +9,4 @@ Fatal error: Uncaught Error: __clone method called on non-object in %sbug42818.p Stack trace: #0 {main} thrown in %sbug42818.php on line 2 + diff --git a/Zend/tests/bug42819.phpt b/Zend/tests/bug42819.phpt index a8cff5f451..4630dc29b5 100644 --- a/Zend/tests/bug42819.phpt +++ b/Zend/tests/bug42819.phpt @@ -303,4 +303,4 @@ Fatal error: Uncaught Error: Undefined constant 'foo\foo\unknown' in %sbug42819. Stack trace: #0 %s(%d): foo\oops() #1 {main} - thrown in %sbug42819.php on line %d + thrown in %sbug42819.php on line %d
\ No newline at end of file diff --git a/Zend/tests/bug42820.phpt b/Zend/tests/bug42820.phpt index a53ed1af68..921f0090a9 100644 --- a/Zend/tests/bug42820.phpt +++ b/Zend/tests/bug42820.phpt @@ -28,3 +28,4 @@ bool(true) bool(false) bool(false) bool(false) + diff --git a/Zend/tests/bug43183.phpt b/Zend/tests/bug43183.phpt index 88641e862a..a8ca698e9f 100644 --- a/Zend/tests/bug43183.phpt +++ b/Zend/tests/bug43183.phpt @@ -9,4 +9,4 @@ class Bar {} use Test\Bar; echo "ok\n"; --EXPECT-- -ok +ok
\ No newline at end of file diff --git a/Zend/tests/bug43200.phpt b/Zend/tests/bug43200.phpt index 35b96b1ba1..7a995aab3e 100644 --- a/Zend/tests/bug43200.phpt +++ b/Zend/tests/bug43200.phpt @@ -48,3 +48,4 @@ Class [ <user> class x extends c implements a, b ] { } } } + diff --git a/Zend/tests/bug43344_1.phpt b/Zend/tests/bug43344_1.phpt index 59129d75cf..4635240699 100644 --- a/Zend/tests/bug43344_1.phpt +++ b/Zend/tests/bug43344_1.phpt @@ -19,14 +19,14 @@ echo f2()."\n"; echo f3()."\n"; ?> --EXPECTF-- -Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 13 +Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 13 bar -Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 3 +Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 3 bar -Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 6 +Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 6 bar -Notice: Use of undefined constant bar - assumed 'bar' in %sbug43344_1.php on line 9 +Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in %sbug43344_1.php on line 9 bar diff --git a/Zend/tests/bug43450.phpt b/Zend/tests/bug43450.phpt index f01cfc592e..fc1db11087 100644 --- a/Zend/tests/bug43450.phpt +++ b/Zend/tests/bug43450.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #43450 (Memory leak on some functions with implicit object __toString() call) --SKIPIF-- -<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?> +<?php if (!function_exists('memory_get_usage')) die('skip memory_get_usage() not installed'); ?> --INI-- opcache.enable_cli=0 --FILE-- diff --git a/Zend/tests/bug44660.phpt b/Zend/tests/bug44660.phpt index 1027377d34..002744ce64 100644 --- a/Zend/tests/bug44660.phpt +++ b/Zend/tests/bug44660.phpt @@ -28,22 +28,22 @@ var_dump($a); ?> --EXPECTF-- --> read access: -Notice: Trying to get property of non-object in %sbug44660.php on line 6 +Notice: Trying to get property 'p' of non-object in %sbug44660.php on line 6 --> direct assignment: -Warning: Attempt to assign property of non-object in %sbug44660.php on line 9 +Warning: Attempt to assign property 'p' of non-object in %sbug44660.php on line 9 --> increment: -Warning: Attempt to increment/decrement property of non-object in %sbug44660.php on line 12 +Warning: Attempt to increment/decrement property 'p' of non-object in %sbug44660.php on line 12 --> reference assignment: -Warning: Attempt to modify property of non-object in %sbug44660.php on line 15 +Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 15 --> reference assignment: -Warning: Attempt to modify property of non-object in %sbug44660.php on line 18 +Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 18 --> indexed assignment: -Warning: Attempt to modify property of non-object in %sbug44660.php on line 21 +Warning: Attempt to modify property 'p' of non-object in %sbug44660.php on line 21 --> Confirm assignments have had no impact: bool(true) diff --git a/Zend/tests/bug45180.phpt b/Zend/tests/bug45180.phpt index 285543aaf0..f1ca434272 100644 --- a/Zend/tests/bug45180.phpt +++ b/Zend/tests/bug45180.phpt @@ -58,4 +58,4 @@ string(1) "C" __callstatic: string(3) "FOO" __callstatic: -string(3) "FOO" +string(3) "FOO"
\ No newline at end of file diff --git a/Zend/tests/bug45862.phpt b/Zend/tests/bug45862.phpt index 734a498eba..f70c14234c 100644 --- a/Zend/tests/bug45862.phpt +++ b/Zend/tests/bug45862.phpt @@ -28,6 +28,7 @@ $child->test(); ?> --EXPECT-- + From parent scope array(1) { ["prot"]=> diff --git a/Zend/tests/bug46665.phpt b/Zend/tests/bug46665.phpt index 1f82454387..954dbfaefb 100644 --- a/Zend/tests/bug46665.phpt +++ b/Zend/tests/bug46665.phpt @@ -3,12 +3,13 @@ Bug #46665 (Triggering autoload with a variable classname causes truncated autol --FILE-- <?php -$baz = '\\Foo\\Bar\\Baz'; -new $baz(); -function __autoload($class) { +spl_autoload_register(function ($class) { var_dump($class); require __DIR__ .'/bug46665_autoload.inc'; -} +}); + +$baz = '\\Foo\\Bar\\Baz'; +new $baz(); ?> --EXPECTF-- diff --git a/Zend/tests/bug46811.phpt b/Zend/tests/bug46811.phpt index 7954d99f2b..fe41bffff6 100644 --- a/Zend/tests/bug46811.phpt +++ b/Zend/tests/bug46811.phpt @@ -9,4 +9,5 @@ var_dump(ini_get("arg_separator.output")); ?> --EXPECTF-- bool(false) -%unicode|string%(1) "&" +string(1) "&" + diff --git a/Zend/tests/bug47109.phpt b/Zend/tests/bug47109.phpt index a95379c8ab..4d157345b2 100644 --- a/Zend/tests/bug47109.phpt +++ b/Zend/tests/bug47109.phpt @@ -7,4 +7,5 @@ $a->{"a"."b"}; --EXPECTF-- Notice: Undefined variable: a in %sbug47109.php on line 2 -Notice: Trying to get property of non-object in %sbug47109.php on line 2 +Notice: Trying to get property 'ab' of non-object in %sbug47109.php on line 2 + diff --git a/Zend/tests/bug47572.phpt b/Zend/tests/bug47572.phpt index 695cc3a7f9..67bb3ec111 100644 --- a/Zend/tests/bug47572.phpt +++ b/Zend/tests/bug47572.phpt @@ -14,4 +14,4 @@ $foo = new Foo(); ?> --EXPECTF-- -Notice: Use of undefined constant FOO - assumed 'FOO' in %s on line %d +Warning: Use of undefined constant FOO - assumed 'FOO' (this will throw an Error in a future version of PHP) in %s on line %d diff --git a/Zend/tests/bug47714.phpt b/Zend/tests/bug47714.phpt index e8ef8c330f..546da44a86 100644 --- a/Zend/tests/bug47714.phpt +++ b/Zend/tests/bug47714.phpt @@ -10,11 +10,7 @@ function au($class) { }'); } -function __autoload($class) { - au($class); -} - -//spl_autoload_register('au'); +spl_autoload_register('au'); set_exception_handler(function($exception) { $h = new handler(); diff --git a/Zend/tests/bug48228.phpt b/Zend/tests/bug48228.phpt index d91ded28be..9be02aa4d8 100644 --- a/Zend/tests/bug48228.phpt +++ b/Zend/tests/bug48228.phpt @@ -23,6 +23,7 @@ $l_aa=new aa(); $l_aa->dosome(); ?> --EXPECTF-- + Fatal error: Uncaught Exception in %s Stack trace: #0 %s(%d): do_throw() diff --git a/Zend/tests/bug48408.phpt b/Zend/tests/bug48408.phpt index 3315f40962..7ae32a5d48 100644 --- a/Zend/tests/bug48408.phpt +++ b/Zend/tests/bug48408.phpt @@ -22,6 +22,7 @@ catch(Exception $e){ } ?> --EXPECTF-- + Fatal error: Uncaught Exception in %s Stack trace: #0 %s(%d): C->generate(0) diff --git a/Zend/tests/bug48533.phpt b/Zend/tests/bug48533.phpt index 8b8996243a..4fa49a2f22 100644 --- a/Zend/tests/bug48533.phpt +++ b/Zend/tests/bug48533.phpt @@ -31,11 +31,11 @@ $x::c(); ?> --EXPECTF-- -%unicode|string%(9) "__call::a" +string(9) "__call::a" int(2) -%unicode|string%(9) "__call::c" -%unicode|string%(15) "__callStatic::a" +string(9) "__call::c" +string(15) "__callStatic::a" Deprecated: Non-static method foo::b() should not be called statically in %s on line %d int(2) -%unicode|string%(15) "__callStatic::c" +string(15) "__callStatic::c" diff --git a/Zend/tests/bug48693.phpt b/Zend/tests/bug48693.phpt index 41e0d82274..f916b6407b 100644 --- a/Zend/tests/bug48693.phpt +++ b/Zend/tests/bug48693.phpt @@ -31,15 +31,22 @@ var_dump( ?> --EXPECTF-- +Deprecated: Function create_function() is deprecated in %s on line %d ParseError: syntax error, unexpected '}', expecting end of file in %sbug48693.php(4) : runtime-created function:1 Stack trace: #0 %sbug48693.php(4): create_function('', 'return 1; }') #1 {main} + +Deprecated: Function create_function() is deprecated in %s on line %d + +Deprecated: Function create_function() is deprecated in %s on line %d ParseError: syntax error, unexpected end of file in %sbug48693.php(14) : runtime-created function:1 Stack trace: #0 %sbug48693.php(14): create_function('', '{') #1 {main} + +Deprecated: Function create_function() is deprecated in %s on line %d int(2) int(3) diff --git a/Zend/tests/bug48770.phpt b/Zend/tests/bug48770.phpt index 349e1581c4..59b66641e0 100644 --- a/Zend/tests/bug48770.phpt +++ b/Zend/tests/bug48770.phpt @@ -50,4 +50,4 @@ $c->func('This should work!'); ?> --EXPECTF-- -%unicode|string%(26) "A::func: This should work!" +string(26) "A::func: This should work!" diff --git a/Zend/tests/bug48770_2.phpt b/Zend/tests/bug48770_2.phpt index 5b3f68d705..d7984eac4f 100644 --- a/Zend/tests/bug48770_2.phpt +++ b/Zend/tests/bug48770_2.phpt @@ -46,8 +46,8 @@ $c->func('This should work!'); ?> --EXPECTF-- -%unicode|string%(27) "A::func2: This should work!" -%unicode|string%(27) "A::func3: This should work!" +string(27) "A::func2: This should work!" +string(27) "A::func3: This should work!" Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d diff --git a/Zend/tests/bug48770_3.phpt b/Zend/tests/bug48770_3.phpt index d4b9a30cef..5c6eacb470 100644 --- a/Zend/tests/bug48770_3.phpt +++ b/Zend/tests/bug48770_3.phpt @@ -45,7 +45,7 @@ $c->func('This should work!'); ?> --EXPECTF-- -%unicode|string%(27) "B::func2: This should work!" -%unicode|string%(27) "B::func3: This should work!" +string(27) "B::func2: This should work!" +string(27) "B::func3: This should work!" Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in %s on line %d diff --git a/Zend/tests/bug49893.phpt b/Zend/tests/bug49893.phpt index b340f7bdfd..addf447073 100644 --- a/Zend/tests/bug49893.phpt +++ b/Zend/tests/bug49893.phpt @@ -20,7 +20,7 @@ class B { try { $b = new B(); } catch(Exception $e) { - echo $e->getMessage() . "\n";; + echo $e->getMessage() . "\n"; } ?> --EXPECT-- diff --git a/Zend/tests/bug49908.phpt b/Zend/tests/bug49908.phpt index 99b1a40e3d..2f33080258 100644 --- a/Zend/tests/bug49908.phpt +++ b/Zend/tests/bug49908.phpt @@ -3,7 +3,7 @@ Bug #49908 (throwing exception in __autoload crashes when interface is not defin --FILE-- <?php -function __autoload($className) { +spl_autoload_register(function ($className) { var_dump($className); if ($className == 'Foo') { @@ -11,18 +11,20 @@ function __autoload($className) { } else { throw new Exception($className); } -} +}); new Foo; ?> --EXPECTF-- -%unicode|string%(3) "Foo" -%unicode|string%(3) "Bar" +string(3) "Foo" +string(3) "Bar" Fatal error: Uncaught Exception: Bar in %s:%d Stack trace: -#0 %s(7): __autoload('Bar') -#1 %s(13): __autoload('Foo') -#2 {main} +#0 [internal function]: {closure}('Bar') +#1 %s(%d): spl_autoload_call('Bar') +#2 [internal function]: {closure}('Foo') +#3 %s(%d): spl_autoload_call('Foo') +#4 {main} thrown in %s on line %d diff --git a/Zend/tests/bug50394.phpt b/Zend/tests/bug50394.phpt index 60b9d34582..4e6c9761dd 100644 --- a/Zend/tests/bug50394.phpt +++ b/Zend/tests/bug50394.phpt @@ -21,3 +21,4 @@ var_dump($arg); bar called! bar called! int(3) + diff --git a/Zend/tests/bug51176.phpt b/Zend/tests/bug51176.phpt index c5185cc5fa..272ba1286f 100644 --- a/Zend/tests/bug51176.phpt +++ b/Zend/tests/bug51176.phpt @@ -29,4 +29,4 @@ $foo->start(); --EXPECT-- instance instance -instance +instance
\ No newline at end of file diff --git a/Zend/tests/bug52237.phpt b/Zend/tests/bug52237.phpt index a466a8ce02..47d39f8e9d 100644 --- a/Zend/tests/bug52237.phpt +++ b/Zend/tests/bug52237.phpt @@ -7,5 +7,6 @@ preg_match('//', '', $data->info); var_dump($data); ?> --EXPECTF-- -Warning: Attempt to modify property of non-object in %sbug52237.php on line 3 + +Warning: Attempt to modify property 'info' of non-object in %sbug52237.php on line 3 string(4) "test" diff --git a/Zend/tests/bug52361.phpt b/Zend/tests/bug52361.phpt index 74ed8a8d17..4159ac0b8c 100644 --- a/Zend/tests/bug52361.phpt +++ b/Zend/tests/bug52361.phpt @@ -32,3 +32,4 @@ Stack trace: Stack trace: #0 %sbug52361.php(16): bbb() #1 {main} + diff --git a/Zend/tests/bug53971.phpt b/Zend/tests/bug53971.phpt index 60e9c3d81f..a1e66cc51e 100644 --- a/Zend/tests/bug53971.phpt +++ b/Zend/tests/bug53971.phpt @@ -7,3 +7,5 @@ var_dump(isset($s[0][0])); ?> --EXPECT-- bool(false) + + diff --git a/Zend/tests/bug54262.phpt b/Zend/tests/bug54262.phpt index 17a6ea6381..16933ca300 100644 --- a/Zend/tests/bug54262.phpt +++ b/Zend/tests/bug54262.phpt @@ -11,7 +11,7 @@ echo "ok\n"; --EXPECTF-- bool(false) -Warning: Attempt to modify property of non-object in %sbug54262.php on line 4 +Warning: Attempt to modify property 'a' of non-object in %sbug54262.php on line 4 Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5 ok diff --git a/Zend/tests/bug54265.phpt b/Zend/tests/bug54265.phpt index 417e1b5564..43db028a2a 100644 --- a/Zend/tests/bug54265.phpt +++ b/Zend/tests/bug54265.phpt @@ -14,3 +14,4 @@ echo "ok\n"; --EXPECT-- EROOR: Creating default object from empty value ok + diff --git a/Zend/tests/bug54585.phpt b/Zend/tests/bug54585.phpt index 2ca11f3e6a..deabe55af8 100644 --- a/Zend/tests/bug54585.phpt +++ b/Zend/tests/bug54585.phpt @@ -5,11 +5,13 @@ track_errors=On --FILE-- <?php function testing($source) { - unset($source[$cos]); + unset($source[$cos]); } testing($_GET); echo "ok\n"; ?> --EXPECTF-- +Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 + Notice: Undefined variable: cos in %sbug54585.php on line 3 ok diff --git a/Zend/tests/bug55007.phpt b/Zend/tests/bug55007.phpt index 71616b14dd..fe8dfb3dcb 100644 --- a/Zend/tests/bug55007.phpt +++ b/Zend/tests/bug55007.phpt @@ -3,10 +3,10 @@ Bug #55007 (compiler fail after previous fail) --FILE-- <?php -function __autoload($classname) { +spl_autoload_register(function ($classname) { if ('CompileErrorClass'==$classname) eval('class CompileErrorClass { function foo() { $a[]; } }'); if ('MyErrorHandler'==$classname) eval('class MyErrorHandler { function __construct() { print "My error handler runs.\n"; } }'); -} +}); function shutdown() { new MyErrorHandler(); diff --git a/Zend/tests/bug60536_001.phpt b/Zend/tests/bug60536_001.phpt index 0847b81d40..37a5a6d813 100644 --- a/Zend/tests/bug60536_001.phpt +++ b/Zend/tests/bug60536_001.phpt @@ -22,5 +22,6 @@ $a->__construct(); echo "DONE"; ?> --EXPECTF-- + Notice: Undefined property: Z::$x in %s on line 14 DONE diff --git a/Zend/tests/bug60598.phpt b/Zend/tests/bug60598.phpt index eeee75a19d..143ac79504 100644 --- a/Zend/tests/bug60598.phpt +++ b/Zend/tests/bug60598.phpt @@ -6,7 +6,7 @@ define('OBJECT_COUNT', 10000); $containers = array(); -class Object { +class ObjectOne { protected $_guid = 0; public function __construct() { global $containers; @@ -20,7 +20,7 @@ class Object { } for ($i = 0; $i < OBJECT_COUNT; ++$i) { - new Object(); + new ObjectOne(); } // You probably won't see this because of the "zend_mm_heap corrupted" diff --git a/Zend/tests/bug60738_variation.phpt b/Zend/tests/bug60738_variation.phpt index cf2ea607a0..f9e2e73458 100644 --- a/Zend/tests/bug60738_variation.phpt +++ b/Zend/tests/bug60738_variation.phpt @@ -20,3 +20,4 @@ Fatal error: Uncaught Exception: Exception! in %s:%d Stack trace: #0 {main} thrown in %s on line %d + diff --git a/Zend/tests/bug60833.phpt b/Zend/tests/bug60833.phpt index fee6d01362..deb6c0f691 100644 --- a/Zend/tests/bug60833.phpt +++ b/Zend/tests/bug60833.phpt @@ -37,3 +37,4 @@ object(B)#%d (4) { ["v4"]=> string(1) "B" } + diff --git a/Zend/tests/bug61011.phpt b/Zend/tests/bug61011.phpt index 599017860b..dc0aca64f8 100644 --- a/Zend/tests/bug61011.phpt +++ b/Zend/tests/bug61011.phpt @@ -2,9 +2,10 @@ Bug #61011 (Crash when an exception is thrown by __autoload accessing a static property) --FILE-- <?php -function __autoload($name) { +spl_autoload_register(function ($name) { throw new Exception($name); -} +}); + try { echo AAA::$a; //zend_fetch_var_address_helper } catch (Exception $e) { diff --git a/Zend/tests/bug61970.phpt b/Zend/tests/bug61970.phpt new file mode 100644 index 0000000000..9cdb87a01a --- /dev/null +++ b/Zend/tests/bug61970.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #61970 (Restraining __construct() access level in subclass gives a fatal error) +--FILE-- +<?php + +class Foo { + public function __construct(){} +} + +class Bar extends Foo { + protected function __construct(){} +} + +echo 'DONE'; +--EXPECT-- +DONE diff --git a/Zend/tests/bug61970_1.phpt b/Zend/tests/bug61970_1.phpt new file mode 100644 index 0000000000..978884adba --- /dev/null +++ b/Zend/tests/bug61970_1.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #61970 (Restraining __construct() access level in subclass gives a fatal error - stays when implementing abstract) +--FILE-- +<?php + +abstract class Foo { + abstract public function __construct(); +} + +class Bar extends Foo { + protected function __construct(){} +} + +--EXPECTF-- +Fatal error: Access level to Bar::__construct() must be public (as in class Foo) in %s diff --git a/Zend/tests/bug61970_2.phpt b/Zend/tests/bug61970_2.phpt new file mode 100644 index 0000000000..56203f7685 --- /dev/null +++ b/Zend/tests/bug61970_2.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #61970 (Restraining __construct() access level in subclass gives a fatal error - stays when inheriting implemented abstract) +--FILE-- +<?php + +abstract class Foo { + abstract public function __construct(); +} + +class Bar extends Foo { + public function __construct(){} +} + +class Baz extends Bar { + protected function __construct(){} +} + +--EXPECTF-- +Fatal error: Access level to Baz::__construct() must be public (as in class Bar) in %s diff --git a/Zend/tests/bug62358.phpt b/Zend/tests/bug62358.phpt index 62c6d88ad8..97381c3403 100644 --- a/Zend/tests/bug62358.phpt +++ b/Zend/tests/bug62358.phpt @@ -23,4 +23,4 @@ class B extends A { } ?> --EXPECTF-- -Fatal error: Declaration of B::foo($var) must be compatible with I::foo() in %sbug62358.php on line 17 +Fatal error: Declaration of B::foo($var) must be compatible with A::foo() in %sbug62358.php on line 17 diff --git a/Zend/tests/bug62441.phpt b/Zend/tests/bug62441.phpt index 581c0dad68..fba76cb290 100644 --- a/Zend/tests/bug62441.phpt +++ b/Zend/tests/bug62441.phpt @@ -17,3 +17,4 @@ namespace ns { ?> --EXPECTF-- Fatal error: Declaration of ns\Foo::method(ns\stdClass $o) must be compatible with Iface::method(stdClass $o) in %s on line %d + diff --git a/Zend/tests/bug62907.phpt b/Zend/tests/bug62907.phpt index 946482d204..81aa5b225c 100644 --- a/Zend/tests/bug62907.phpt +++ b/Zend/tests/bug62907.phpt @@ -2,7 +2,7 @@ Bug #62907 (Double free when use traits) --FILE-- <?php -function __autoload($name) { +spl_autoload_register(function ($name) { if ($name == "B") { eval ("abstract class B extends A { }"); } else if ($name == "A") { @@ -11,7 +11,7 @@ function __autoload($name) { eval ("trait T { public function __construct() { } }"); } return TRUE; -} +}); class C extends B { public function __construct() { diff --git a/Zend/tests/bug63111.phpt b/Zend/tests/bug63111.phpt index 077e350bc2..3ac4618aea 100644 --- a/Zend/tests/bug63111.phpt +++ b/Zend/tests/bug63111.phpt @@ -35,3 +35,4 @@ Fatal error: Uncaught Error: Cannot call abstract method Foo::bar() in %sbug6311 Stack trace: #0 {main} thrown in %sbug63111.php on line 20 + diff --git a/Zend/tests/bug63305.phpt b/Zend/tests/bug63305.phpt index 4bd3a4dbeb..bd18ccbb1c 100644 --- a/Zend/tests/bug63305.phpt +++ b/Zend/tests/bug63305.phpt @@ -2,9 +2,8 @@ Bug #63305 (zend_mm_heap corrupted with traits) --FILE-- <?php -new Attachment(""); -function __autoload($class) { +spl_autoload_register(function ($class) { switch ($class) { case "Attachment": eval(<<<'PHP' @@ -36,7 +35,9 @@ PHP break; } return TRUE; -} +}); + +new Attachment(""); echo "okey"; ?> --EXPECT-- diff --git a/Zend/tests/bug63462.phpt b/Zend/tests/bug63462.phpt index 45c9507bba..6e60d12d43 100644 --- a/Zend/tests/bug63462.phpt +++ b/Zend/tests/bug63462.phpt @@ -49,6 +49,7 @@ $test->protectedProperty = 'value'; $test->privateProperty = 'value'; ?> + --EXPECTF-- __get nonExisting @@ -70,3 +71,4 @@ __set nonExisting __set publicProperty __set protectedProperty __set privateProperty + diff --git a/Zend/tests/bug63468.phpt b/Zend/tests/bug63468.phpt index 02c3c06c17..00b5a41c90 100644 --- a/Zend/tests/bug63468.phpt +++ b/Zend/tests/bug63468.phpt @@ -27,3 +27,4 @@ $x = new Bar; var_dump($x->run()); --EXPECT-- string(3) "Bar" + diff --git a/Zend/tests/bug63762.phpt b/Zend/tests/bug63762.phpt index d848b74f55..8de177dcf8 100644 --- a/Zend/tests/bug63762.phpt +++ b/Zend/tests/bug63762.phpt @@ -50,3 +50,4 @@ Warning: Value for function is no string in %s on line %d Warning: args element is no array in %s on line %d string(60) "#0 [unknown function][unknown][unknown][unknown]() #1 {main}" + diff --git a/Zend/tests/bug64417.phpt b/Zend/tests/bug64417.phpt index 9b192f31b5..f3ef740b43 100644 --- a/Zend/tests/bug64417.phpt +++ b/Zend/tests/bug64417.phpt @@ -36,3 +36,4 @@ $o['x'] = 1; echo $o['x'], "\n"; --EXPECT-- 2 + diff --git a/Zend/tests/bug64660.phpt b/Zend/tests/bug64660.phpt index f8611ae9d9..e2b89da1cd 100644 --- a/Zend/tests/bug64660.phpt +++ b/Zend/tests/bug64660.phpt @@ -7,4 +7,5 @@ function a() { } echo "Done\n"; --EXPECTF-- + Parse error: memory exhausted in %s on line %d diff --git a/Zend/tests/bug64720.phpt b/Zend/tests/bug64720.phpt index 638687ff20..cbc5f3b01f 100644 --- a/Zend/tests/bug64720.phpt +++ b/Zend/tests/bug64720.phpt @@ -44,9 +44,6 @@ $foo = new Foo(); $bar = new Bar(); $bar->test(); ?> ---EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: Stat::$requests in %sbug64720.php:12 -Stack trace: -#0 [internal function]: Stat->__destruct() -#1 {main} - thrown in %sbug64720.php on line 12 +OK +--EXPECT-- +OK diff --git a/Zend/tests/bug65254.phpt b/Zend/tests/bug65254.phpt index d2ebba4d97..d58759bfd4 100644 --- a/Zend/tests/bug65254.phpt +++ b/Zend/tests/bug65254.phpt @@ -2,12 +2,11 @@ Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace) --FILE-- <?php -function __autoload($class) -{ +spl_autoload_register(function ($class) { eval("namespace ns_test; class test {}"); throw new \Exception('abcd'); -} +}); try { diff --git a/Zend/tests/bug65419.phpt b/Zend/tests/bug65419.phpt index 553bb5d939..677b2750f2 100644 --- a/Zend/tests/bug65419.phpt +++ b/Zend/tests/bug65419.phpt @@ -20,4 +20,4 @@ ghi::def(); ?> --EXPECTF-- ghi -ghi +ghi
\ No newline at end of file diff --git a/Zend/tests/bug67436/bug67436.phpt b/Zend/tests/bug67436/bug67436.phpt index 7f35bfe7a3..8a6b3f8027 100644 --- a/Zend/tests/bug67436/bug67436.phpt +++ b/Zend/tests/bug67436/bug67436.phpt @@ -1,7 +1,9 @@ --TEST-- bug67436: Autoloader isn't called if user defined error handler is present + --INI-- error_reporting=-1 + --FILE-- <?php @@ -18,6 +20,7 @@ a::staticTest(); $b = new b(); $b->test(); + --EXPECT-- b::test() a::test(c::TESTCONSTANT) diff --git a/Zend/tests/bug67436/bug67436_nohandler.phpt b/Zend/tests/bug67436/bug67436_nohandler.phpt index d7cd823b0d..482fd87ec5 100644 --- a/Zend/tests/bug67436/bug67436_nohandler.phpt +++ b/Zend/tests/bug67436/bug67436_nohandler.phpt @@ -1,7 +1,9 @@ --TEST-- bug67436: E_STRICT instead of custom error handler + --INI-- error_reporting=-1 + --FILE-- <?php @@ -15,6 +17,7 @@ a::staticTest(); $b = new b(); $b->test(); + --EXPECTF-- Warning: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d b::test() diff --git a/Zend/tests/bug67858.phpt b/Zend/tests/bug67858.phpt index f0cfc74b0a..1186cd6a6f 100644 --- a/Zend/tests/bug67858.phpt +++ b/Zend/tests/bug67858.phpt @@ -15,5 +15,7 @@ f(); ?> --EXPECTF-- +Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 + Notice: Undefined variable: var in %s on line %d string(23) "Undefined variable: var" diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt index 9648966691..994699e5de 100644 --- a/Zend/tests/bug68446.phpt +++ b/Zend/tests/bug68446.phpt @@ -37,3 +37,4 @@ Stack trace: #0 %s(%d): a(NULL) #1 {main} thrown in %s on line %d + diff --git a/Zend/tests/bug68652.phpt b/Zend/tests/bug68652.phpt index d88a0ddd56..de450b102a 100644 --- a/Zend/tests/bug68652.phpt +++ b/Zend/tests/bug68652.phpt @@ -36,10 +36,6 @@ class Bar { $foo = new Foo(); ?> ---EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: Bar::$instance in %sbug68652.php:%d -Stack trace: -#0 %s(%d): Bar::getInstance() -#1 [internal function]: Foo->__destruct() -#2 {main} - thrown in %sbug68652.php on line %d +OK +--EXPECT-- +OK diff --git a/Zend/tests/bug69092.2.phpt b/Zend/tests/bug69092.2.phpt index d19116c598..b3f4bff175 100644 --- a/Zend/tests/bug69092.2.phpt +++ b/Zend/tests/bug69092.2.phpt @@ -15,4 +15,4 @@ echo "Bye" --EXPECTF-- Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in %s on line %d -Fatal error: Encoding declaration pragma must be the very first statement in the script in %s on line %d +Fatal error: Encoding declaration pragma must be the very first statement in the script in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/bug69092.phpt b/Zend/tests/bug69092.phpt index d80954b16f..1963d7be02 100644 --- a/Zend/tests/bug69092.phpt +++ b/Zend/tests/bug69092.phpt @@ -19,4 +19,4 @@ function foo() { echo "Bye" ?> --EXPECTF-- -Fatal error: Encoding declaration pragma must be the very first statement in the script in %s on line %d +Fatal error: Encoding declaration pragma must be the very first statement in the script in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/bug69315.phpt b/Zend/tests/bug69315.phpt index 296e3bb9c6..71dac4298f 100644 --- a/Zend/tests/bug69315.phpt +++ b/Zend/tests/bug69315.phpt @@ -12,6 +12,7 @@ var_dump(defined("PHP_VERSION")); var_dump(constant("PHP_VERSION")); var_dump(call_user_func("strlen")); var_dump(is_string("xxx")); + --EXPECTF-- bool(false) bool(true) diff --git a/Zend/tests/bug69537.phpt b/Zend/tests/bug69537.phpt index e2c79b9afe..3151c35081 100644 --- a/Zend/tests/bug69537.phpt +++ b/Zend/tests/bug69537.phpt @@ -16,3 +16,4 @@ object(Foo)#%d (%d) { [""]=> int(1) } + diff --git a/Zend/tests/bug69732.phpt b/Zend/tests/bug69732.phpt index f5571627fe..06dd5389dd 100644 --- a/Zend/tests/bug69732.phpt +++ b/Zend/tests/bug69732.phpt @@ -28,3 +28,4 @@ Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in Stack trace: #0 {main} thrown in %s on line %d + diff --git a/Zend/tests/bug69755.phpt b/Zend/tests/bug69755.phpt index 67c0ed3383..08432808e2 100644 --- a/Zend/tests/bug69755.phpt +++ b/Zend/tests/bug69755.phpt @@ -5,4 +5,4 @@ Bug #69755: segfault in ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDLER c . 10; ?> --EXPECTF-- -Notice: Use of undefined constant c - assumed 'c' in %sbug69755.php on line 2 +Warning: Use of undefined constant c - assumed 'c' (this will throw an Error in a future version of PHP) in %sbug69755.php on line 2 diff --git a/Zend/tests/bug69788.phpt b/Zend/tests/bug69788.phpt index 63dd42d451..326328ccfa 100644 --- a/Zend/tests/bug69788.phpt +++ b/Zend/tests/bug69788.phpt @@ -5,4 +5,4 @@ Bug #69788: Malformed script causes Uncaught Error in php-cgi, valgrind SIGILL --EXPECTF-- Notice: Array to string conversion in %s on line %d -Notice: Use of undefined constant t - assumed 't' in %s on line %d +Warning: Use of undefined constant t - assumed 't' (this will throw an Error in a future version of PHP) in %s on line %d diff --git a/Zend/tests/bug69825.phpt b/Zend/tests/bug69825.phpt index 18bd9cc5d7..1349dee5ae 100644 --- a/Zend/tests/bug69825.phpt +++ b/Zend/tests/bug69825.phpt @@ -27,3 +27,4 @@ bool(true) bool(false) bool(true) bool(true) + diff --git a/Zend/tests/bug69832.phpt b/Zend/tests/bug69832.phpt index 5ad88d94bc..2617c7b24d 100644 --- a/Zend/tests/bug69832.phpt +++ b/Zend/tests/bug69832.phpt @@ -29,3 +29,4 @@ string(4) "Test" bool(true) int(1) string(4) "Test" + diff --git a/Zend/tests/bug69889.phpt b/Zend/tests/bug69889.phpt index dd555ab407..8aae7c16f7 100644 --- a/Zend/tests/bug69889.phpt +++ b/Zend/tests/bug69889.phpt @@ -19,3 +19,4 @@ string(7) "default" string(7) "default" string(7) "default" string(7) "default" + diff --git a/Zend/tests/bug69957.phpt b/Zend/tests/bug69957.phpt index 01b024e778..d578f9c8d2 100644 --- a/Zend/tests/bug69957.phpt +++ b/Zend/tests/bug69957.phpt @@ -81,3 +81,4 @@ float(INF) Double mod Type: DivisionByZeroError Message: Modulo by zero + diff --git a/Zend/tests/bug70083.phpt b/Zend/tests/bug70083.phpt index 6b20eabb39..0391ea2327 100644 --- a/Zend/tests/bug70083.phpt +++ b/Zend/tests/bug70083.phpt @@ -18,7 +18,9 @@ var_dump($foo); ?> --EXPECTF-- + Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d Stack trace: #0 {main} thrown in %s on line %d + diff --git a/Zend/tests/bug70805.phpt b/Zend/tests/bug70805.phpt index 7ade0f4299..1177233184 100644 --- a/Zend/tests/bug70805.phpt +++ b/Zend/tests/bug70805.phpt @@ -27,7 +27,7 @@ $c = new A; $array = array($c); //This is used to leave a room for $GLOBALS["a"] unset($c); -while ($i++ < 9997) { +while ($i++ < 9998) { $t = []; $t[] = &$t; unset($t); diff --git a/Zend/tests/bug70805_1.phpt b/Zend/tests/bug70805_1.phpt index 7afef94f1e..035ec6884f 100644 --- a/Zend/tests/bug70805_1.phpt +++ b/Zend/tests/bug70805_1.phpt @@ -29,7 +29,7 @@ $c = new A; $array = array($c); unset($c); -while ($i++ < 9997) { +while ($i++ < 9998) { $t = []; $t[] = &$t; unset($t); diff --git a/Zend/tests/bug70805_2.phpt b/Zend/tests/bug70805_2.phpt index c878c83bbc..a4d01aa626 100644 --- a/Zend/tests/bug70805_2.phpt +++ b/Zend/tests/bug70805_2.phpt @@ -24,7 +24,7 @@ $a->b->a = $a; $i = 0; -while ($i++ < 9998) { +while ($i++ < 9999) { $t = []; $t[] = &$t; unset($t); diff --git a/Zend/tests/bug71163.phpt b/Zend/tests/bug71163.phpt index ad2af2d24c..f87b951480 100644 --- a/Zend/tests/bug71163.phpt +++ b/Zend/tests/bug71163.phpt @@ -2,10 +2,10 @@ Bug #71163 (Segmentation Fault (cleanup_unfinished_calls)) --FILE-- <?php -function __autoload($name) { +spl_autoload_register(function ($name) { eval ("class $name extends Exception { public static function foo() {}}"); throw new Exception("boom"); -} +}); function test2() { try { diff --git a/Zend/tests/bug71428.1.phpt b/Zend/tests/bug71428.1.phpt index 2e9a52d3d0..e4d3a22f67 100644 --- a/Zend/tests/bug71428.1.phpt +++ b/Zend/tests/bug71428.1.phpt @@ -10,3 +10,4 @@ class B extends A { } --EXPECTF-- Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(?array $a = NULL) in %sbug71428.1.php on line 7 + diff --git a/Zend/tests/bug71428.2.phpt b/Zend/tests/bug71428.2.phpt index 9fc15fc8c5..9a98ba7760 100644 --- a/Zend/tests/bug71428.2.phpt +++ b/Zend/tests/bug71428.2.phpt @@ -20,3 +20,4 @@ echo "ok"; ?> --EXPECT-- ok + diff --git a/Zend/tests/bug71428.3.phpt b/Zend/tests/bug71428.3.phpt index 78fff6e70d..558e87c56e 100644 --- a/Zend/tests/bug71428.3.phpt +++ b/Zend/tests/bug71428.3.phpt @@ -8,3 +8,4 @@ class C extends B { public function m(A $a , $n) { echo "C.m";} }; ?> --EXPECTF-- Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(?A $a, $n) in %sbug71428.3.php on line 4 + diff --git a/Zend/tests/bug71539_6.phpt b/Zend/tests/bug71539_6.phpt index d690538595..2bf4f6b1e0 100644 --- a/Zend/tests/bug71539_6.phpt +++ b/Zend/tests/bug71539_6.phpt @@ -12,4 +12,4 @@ for ($i = 0; $i < 100000; $i++) { ?> OK --EXPECT-- -OK +OK
\ No newline at end of file diff --git a/Zend/tests/bug71572.phpt b/Zend/tests/bug71572.phpt index 4eb16246a1..4a823ec72f 100644 --- a/Zend/tests/bug71572.phpt +++ b/Zend/tests/bug71572.phpt @@ -24,4 +24,4 @@ NULL Warning: Cannot assign an empty string to a string offset in %s on line %d NULL string(3) "abc" -==DONE== +==DONE==
\ No newline at end of file diff --git a/Zend/tests/bug72038.phpt b/Zend/tests/bug72038.phpt index 9ce82268c1..1e32af4c18 100644 --- a/Zend/tests/bug72038.phpt +++ b/Zend/tests/bug72038.phpt @@ -16,6 +16,7 @@ function test(&$param) { ?> --EXPECTF-- + Notice: Only variables should be passed by reference in %s on line %d object(stdClass)#1 (0) { } @@ -23,3 +24,4 @@ object(stdClass)#1 (0) { Notice: Only variables should be passed by reference in %s on line %d int(2) int(1) + diff --git a/Zend/tests/bug72057.phpt b/Zend/tests/bug72057.phpt index 406efe3efc..e1a129bbc2 100644 --- a/Zend/tests/bug72057.phpt +++ b/Zend/tests/bug72057.phpt @@ -10,7 +10,9 @@ set_error_handler( ); (function (int $i) { bar(); })("7as"); + --EXPECTF-- + Fatal error: Uncaught Exception: My custom error in %s:%d Stack trace: #0 %s(%d): {closure}(8, 'A non well form...', '%s', %d, Array) diff --git a/Zend/tests/bug72119.phpt b/Zend/tests/bug72119.phpt index 7afac3cd5b..064381ada0 100644 --- a/Zend/tests/bug72119.phpt +++ b/Zend/tests/bug72119.phpt @@ -16,3 +16,4 @@ echo "OK\n"; ?> --EXPECTF-- Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(?array $baz = NULL) in %s on line %d + diff --git a/Zend/tests/bug72911.phpt b/Zend/tests/bug72911.phpt index 098261cadf..84f04eff1e 100644 --- a/Zend/tests/bug72911.phpt +++ b/Zend/tests/bug72911.phpt @@ -11,7 +11,7 @@ var_dump($b); ?> --EXPECTF-- -Warning: Attempt to modify property of non-object in %sbug72911.php on line %d +Warning: Attempt to modify property 'b' of non-object in %sbug72911.php on line %d -Warning: Attempt to assign property of non-object in %sbug72911.php on line %d +Warning: Attempt to assign property 'i' of non-object in %sbug72911.php on line %d NULL diff --git a/Zend/tests/bug72944.phpt b/Zend/tests/bug72944.phpt index 541730a22a..5f494beb40 100644 --- a/Zend/tests/bug72944.phpt +++ b/Zend/tests/bug72944.phpt @@ -6,7 +6,7 @@ Bug #72944 (Null pointer deref in zval_delref_p). echo "OK\n"; ?> --EXPECTF-- -Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2 +Warning: Use of undefined constant e - assumed 'e' (this will throw an Error in a future version of PHP) in %sbug72944.php on line 2 Notice: Undefined variable: A in %sbug72944.php on line 2 OK diff --git a/Zend/tests/bug73163.phpt b/Zend/tests/bug73163.phpt index 448d7f5959..5c0560458d 100644 --- a/Zend/tests/bug73163.phpt +++ b/Zend/tests/bug73163.phpt @@ -14,7 +14,7 @@ doSomething(); ?> --EXPECTF-- -Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d +Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' (this will throw an Error in a future version of PHP) in %s:%d Stack trace: #0 %s(%d): {closure}(%s) #1 %s(%d): doSomething() diff --git a/Zend/tests/bug73181.phpt b/Zend/tests/bug73181.phpt index 2994e99b9f..3ab93ebf5b 100644 --- a/Zend/tests/bug73181.phpt +++ b/Zend/tests/bug73181.phpt @@ -11,7 +11,8 @@ function x() { x(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d array(2) { [1]=> string(0) "" diff --git a/Zend/tests/bug73987.phpt b/Zend/tests/bug73987.phpt new file mode 100644 index 0000000000..610b594a64 --- /dev/null +++ b/Zend/tests/bug73987.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #73987 (Method compatibility check looks to original definition and not parent - nullability interface) +--FILE-- +<?php + +interface I { + public function example($a, $b, $c); +} +class A implements I { + public function example($a, $b = null, $c = null) { } // compatible with I::example +} +class B extends A { + public function example($a, $b, $c = null) { } // compatible with I::example +} + +?> +--EXPECTF-- +Fatal error: Declaration of B::example($a, $b, $c = NULL) must be compatible with A::example($a, $b = NULL, $c = NULL) in %s diff --git a/Zend/tests/bug73987_1.phpt b/Zend/tests/bug73987_1.phpt new file mode 100644 index 0000000000..010987ea5f --- /dev/null +++ b/Zend/tests/bug73987_1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #73987 (Method compatibility check looks to original definition and not parent - return types interface) +--FILE-- +<?php + +interface I { + public function example(); +} +class A implements I { + public function example(): int { } // compatible with I::example +} +class B extends A { + public function example(): string { } // compatible with I::example +} + +?> +--EXPECTF-- +Fatal error: Declaration of B::example(): string must be compatible with A::example(): int in %s diff --git a/Zend/tests/bug73987_2.phpt b/Zend/tests/bug73987_2.phpt new file mode 100644 index 0000000000..a70f1455e8 --- /dev/null +++ b/Zend/tests/bug73987_2.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #73987 (Method compatibility check looks to original definition and not parent - nullabilty abstract) +--FILE-- +<?php + +abstract class A { + abstract function example($a, $b, $c); +} + +class B extends A { + function example($a, $b = null, $c = null) { } +} + +class C extends B { + function example($a, $b, $c = null) { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of C::example($a, $b, $c = NULL) must be compatible with B::example($a, $b = NULL, $c = NULL) in %s diff --git a/Zend/tests/bug73987_3.phpt b/Zend/tests/bug73987_3.phpt new file mode 100644 index 0000000000..89e4686ed6 --- /dev/null +++ b/Zend/tests/bug73987_3.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #73987 (Method compatibility check looks to original definition and not parent - return types abstract) +--FILE-- +<?php + +abstract class A { + abstract function example(); +} + +class B extends A { + function example(): int { } +} + +class C extends B { + function example(): string { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of C::example(): string must be compatible with B::example(): int in %s diff --git a/Zend/tests/bug73998.phpt b/Zend/tests/bug73998.phpt index 72d1e59924..41813269d1 100644 --- a/Zend/tests/bug73998.phpt +++ b/Zend/tests/bug73998.phpt @@ -16,3 +16,4 @@ echo "Value: {$properties[1234]}\n"; --EXPECT-- bool(true) Value: Numeric + diff --git a/Zend/tests/bug74053.phpt b/Zend/tests/bug74053.phpt new file mode 100644 index 0000000000..b1936a58e9 --- /dev/null +++ b/Zend/tests/bug74053.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #74053 (Corrupted class entries on shutdown when a destructor spawns another object) +--FILE-- +<?php +class b { + function __destruct() { + echo "b::destruct\n"; + } +} +class a { + static $b; + static $new; + static $max = 10; + function __destruct() { + if (self::$max-- <= 0) return; + echo "a::destruct\n"; + self::$b = new b; + self::$new[] = new a; + } +} +new a; +?> +--EXPECT-- +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct +a::destruct +b::destruct diff --git a/Zend/tests/bug74188.phpt b/Zend/tests/bug74188.phpt deleted file mode 100644 index 3eb4facdd9..0000000000 --- a/Zend/tests/bug74188.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Fixes bug 74188 (undeclared static variables emit a warning with ?? operator) ---FILE-- -<?php -abstract class Test -{ - public static function get() - { - static::$a ?? true; - } -} -Test::get(); -?> ---EXPECT-- diff --git a/Zend/tests/bug74269.phpt b/Zend/tests/bug74269.phpt new file mode 100644 index 0000000000..53ef570fb6 --- /dev/null +++ b/Zend/tests/bug74269.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #74269: It's possible to override trait property with different loosely-equal value +--FILE-- +<?php +trait PropertiesTrait +{ + public $same = true; +} + +class PropertiesExample +{ + use PropertiesTrait; + public $same = 2; +} +?> +--EXPECTF-- +Fatal error: PropertiesExample and PropertiesTrait define the same property ($same) in the composition of PropertiesExample. However, the definition differs and is considered incompatible. Class was composed in %s diff --git a/Zend/tests/bug74657.phpt b/Zend/tests/bug74657.phpt index 4c84bde7bd..41e28ce58b 100644 --- a/Zend/tests/bug74657.phpt +++ b/Zend/tests/bug74657.phpt @@ -23,3 +23,4 @@ Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php Stack trace: #0 {main} thrown in %sbug74657.php on line %d + diff --git a/Zend/tests/bug74810.phpt b/Zend/tests/bug74810.phpt new file mode 100644 index 0000000000..6c24e4bce8 --- /dev/null +++ b/Zend/tests/bug74810.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #74810: Something odd about ordering of func_get_args() result in 7.2 +--FILE-- +<?php + +function test_slice1() { + var_dump(array_slice(func_get_args(), 1)); +} +function test_slice5() { + var_dump(array_slice(func_get_args(), 5)); +} + +test_slice1(1, 2, 3); +test_slice5(1, 2, 3); + +?> +--EXPECT-- +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} +array(0) { +} diff --git a/Zend/tests/bug74836.phpt b/Zend/tests/bug74836.phpt new file mode 100644 index 0000000000..7281a07e0e --- /dev/null +++ b/Zend/tests/bug74836.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #74836 (isset on zero-prefixed numeric indexes in array broken) +--FILE-- +<?php +$s = "1234567890a"; +$a[10] = "42"; +$i = "010"; + +var_dump($s["10"], isset($s["10"])); +var_dump($s["010"], isset($s["010"])); +var_dump($s[$i], isset($s[$i])); + +var_dump($a["10"], isset($a["10"])); +var_dump($a["010"], isset($a["010"])); +var_dump($a[$i], isset($a[$i])); +?> +--EXPECTF-- +string(1) "a" +bool(true) +string(1) "a" +bool(true) +string(1) "a" +bool(true) +string(2) "42" +bool(true) + +Notice: Undefined index: 010 in %s on line %d +NULL +bool(false) + +Notice: Undefined index: 010 in %s on line %d +NULL +bool(false) diff --git a/Zend/tests/bug75290.phpt b/Zend/tests/bug75290.phpt index 3b28e621d2..416af065c6 100644 --- a/Zend/tests/bug75290.phpt +++ b/Zend/tests/bug75290.phpt @@ -23,3 +23,4 @@ object(Closure)#2 (1) { string(10) "<required>" } } + diff --git a/Zend/tests/bug75420.2.phpt b/Zend/tests/bug75420.2.phpt index 994327d195..3e7a63ffed 100644 --- a/Zend/tests/bug75420.2.phpt +++ b/Zend/tests/bug75420.2.phpt @@ -17,3 +17,4 @@ var_dump($name); string(6) "foofoo" int(42) int(24) + diff --git a/Zend/tests/bug76337.phpt b/Zend/tests/bug76337.phpt new file mode 100644 index 0000000000..07608e2660 --- /dev/null +++ b/Zend/tests/bug76337.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug 76337: segmentation fault when an extension use zend_register_class_alias() and opcache enabled +--SKIPIF-- +<?php if (!class_exists('_ZendTestClass') || !extension_loaded('Zend OPcache')) die('skip'); +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--FILE-- +<?php +var_dump(class_exists('_ZendTestClassAlias')); +--EXPECT-- +bool(true) diff --git a/Zend/tests/bug76800.phpt b/Zend/tests/bug76800.phpt new file mode 100644 index 0000000000..d7f6d8070b --- /dev/null +++ b/Zend/tests/bug76800.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #76800 (foreach inconsistent if array modified during loop) +--FILE-- +<?php +$arr = [1 => 1, 3 => 3]; // [1 => 1, 2 => 3] will print both keys +foreach($arr as $key => &$val) { // without & will print both keys + echo "See key {$key}\n"; + $arr[0] = 0; // without this line will print both keys + unset($arr[0]); +} +--EXPECT-- +See key 1 +See key 3 diff --git a/Zend/tests/call_static.phpt b/Zend/tests/call_static.phpt index 355a1570f3..c37bc72230 100644 --- a/Zend/tests/call_static.phpt +++ b/Zend/tests/call_static.phpt @@ -13,6 +13,7 @@ class Test call_user_func("Test::Two", 'A', 'B'); call_user_func(array("Test", "Three"), NULL, 0, false); Test::Four(5, 6, 7, 8); + --EXPECT-- Two() called with 2 arguments Three() called with 3 arguments diff --git a/Zend/tests/call_user_func_002.phpt b/Zend/tests/call_user_func_002.phpt index e79dd1a759..454c6fda96 100644 --- a/Zend/tests/call_user_func_002.phpt +++ b/Zend/tests/call_user_func_002.phpt @@ -3,9 +3,9 @@ Testing call_user_func() with autoload and passing invalid params --FILE-- <?php -function __autoload($class) { +spl_autoload_register(function ($class) { var_dump($class); -} +}); call_user_func(array('foo', 'bar')); call_user_func(array('', 'bar')); @@ -14,7 +14,7 @@ call_user_func(array($foo, '')); ?> --EXPECTF-- -%unicode|string%(3) "foo" +string(3) "foo" Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d diff --git a/Zend/tests/call_user_func_003.phpt b/Zend/tests/call_user_func_003.phpt index 6b6d494393..1aad22fba7 100644 --- a/Zend/tests/call_user_func_003.phpt +++ b/Zend/tests/call_user_func_003.phpt @@ -20,11 +20,11 @@ var_dump(call_user_func(function() use (&$foo) { return $foo; }, '__invoke')); ?> --EXPECTF-- -%unicode|string%(3) "OK!" +string(3) "OK!" object(Closure)#%d (1) { - [%u|b%"static"]=> + ["static"]=> array(1) { - [%u|b%"instance"]=> + ["instance"]=> object(Closure)#%d (0) { } } diff --git a/Zend/tests/cast_to_object.phpt b/Zend/tests/cast_to_object.phpt Binary files differindex 9e3d66a4bc..b7e5f219f6 100644 --- a/Zend/tests/cast_to_object.phpt +++ b/Zend/tests/cast_to_object.phpt diff --git a/Zend/tests/catch.phpt b/Zend/tests/catch.phpt index 0ec5cf7590..a83dd75baf 100644 --- a/Zend/tests/catch.phpt +++ b/Zend/tests/catch.phpt @@ -2,11 +2,11 @@ catch shouldn't call __autoload --FILE-- <?php -function __autoload($name) { + +spl_autoload_register(function ($name) { echo("AUTOLOAD '$name'\n"); eval("class $name {}"); -} - +}); try { } catch (A $e) { diff --git a/Zend/tests/class_alias_004.phpt b/Zend/tests/class_alias_004.phpt index ea3501ed57..f99152c96a 100644 --- a/Zend/tests/class_alias_004.phpt +++ b/Zend/tests/class_alias_004.phpt @@ -12,4 +12,4 @@ class_alias('foo', 'test'); ?> --EXPECTF-- -Warning: Cannot declare class test, because the name is already in use in %s on line %d +Warning: Cannot declare class test, because the name is already in use in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/class_alias_007.phpt b/Zend/tests/class_alias_007.phpt index 247398e2ed..edcc096ade 100644 --- a/Zend/tests/class_alias_007.phpt +++ b/Zend/tests/class_alias_007.phpt @@ -3,9 +3,9 @@ Testing class_alias() using autoload --FILE-- <?php -function __autoload($a) { +spl_autoload_register(function ($a) { class foo { } -} +}); class_alias('foo', 'bar', 1); diff --git a/Zend/tests/closure_012.phpt b/Zend/tests/closure_012.phpt index bae8f56878..7e1b7a2793 100644 --- a/Zend/tests/closure_012.phpt +++ b/Zend/tests/closure_012.phpt @@ -21,3 +21,4 @@ Notice: Undefined variable: i in %sclosure_012.php on line 2 Notice: Undefined variable: i in %sclosure_012.php on line 7 NULL int(2) + diff --git a/Zend/tests/closure_022.phpt b/Zend/tests/closure_022.phpt index 8977e963df..b1ffebc0b4 100644 --- a/Zend/tests/closure_022.phpt +++ b/Zend/tests/closure_022.phpt @@ -12,3 +12,4 @@ Fatal error: Uncaught Error: Closure object cannot have properties in %sclosure_ Stack trace: #0 {main} thrown in %sclosure_022.php on line 5 + diff --git a/Zend/tests/closure_023.phpt b/Zend/tests/closure_023.phpt index a91d357c06..634fb6dd50 100644 --- a/Zend/tests/closure_023.phpt +++ b/Zend/tests/closure_023.phpt @@ -11,3 +11,4 @@ class foo { foo::bar(); --EXPECT-- Done + diff --git a/Zend/tests/closure_024.phpt b/Zend/tests/closure_024.phpt index fcaa1e9b41..74083f73bc 100644 --- a/Zend/tests/closure_024.phpt +++ b/Zend/tests/closure_024.phpt @@ -23,4 +23,4 @@ echo "Done.\n"; 11 12 12 -Done. +Done.
\ No newline at end of file diff --git a/Zend/tests/closure_025.phpt b/Zend/tests/closure_025.phpt index 8ee187e1c8..b3d03a7ad9 100644 --- a/Zend/tests/closure_025.phpt +++ b/Zend/tests/closure_025.phpt @@ -8,5 +8,6 @@ $a = create_function('$x', 'return function($y) use ($x) { return $x * $y; };'); var_dump($a(2)->__invoke(4)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function create_function() is deprecated in %s on line %d int(8) diff --git a/Zend/tests/closure_031.phpt b/Zend/tests/closure_031.phpt index 042bf8c145..241ddb42cd 100644 --- a/Zend/tests/closure_031.phpt +++ b/Zend/tests/closure_031.phpt @@ -16,3 +16,4 @@ try { ?> --EXPECT-- Error: Closure object cannot have properties + diff --git a/Zend/tests/closure_032.phpt b/Zend/tests/closure_032.phpt index 601db15989..412a923a38 100644 --- a/Zend/tests/closure_032.phpt +++ b/Zend/tests/closure_032.phpt @@ -67,3 +67,4 @@ Array ) #0 {closure}(23) called at [%s:%d] #1 test(Closure Object ()) called at [%s:%d] + diff --git a/Zend/tests/closure_036.phpt b/Zend/tests/closure_036.phpt index 55e3f47cde..8dd403fd56 100644 --- a/Zend/tests/closure_036.phpt +++ b/Zend/tests/closure_036.phpt @@ -30,4 +30,4 @@ var_dump($cb2()); --EXPECTF-- int(1) int(11) -int(12) +int(12)
\ No newline at end of file diff --git a/Zend/tests/closure_037.phpt b/Zend/tests/closure_037.phpt index 9da88c9ebb..4b24c85d16 100644 --- a/Zend/tests/closure_037.phpt +++ b/Zend/tests/closure_037.phpt @@ -44,4 +44,4 @@ Done. 1 42 forty two -Done. +Done.
\ No newline at end of file diff --git a/Zend/tests/closure_041.phpt b/Zend/tests/closure_041.phpt index 33cf03b14c..a7e9eab482 100644 --- a/Zend/tests/closure_041.phpt +++ b/Zend/tests/closure_041.phpt @@ -63,6 +63,7 @@ $d = $nonstaticUnscoped->bindTo(new B); $d(); echo " (should be scoped to dummy $d = $nonstaticScoped->bindTo(new B); $d(); echo "\n"; echo "Done.\n"; + --EXPECTF-- Before binding scoped to A: bool(false) diff --git a/Zend/tests/closure_042.phpt b/Zend/tests/closure_042.phpt index 7ab49d562d..8969765bcd 100644 --- a/Zend/tests/closure_042.phpt +++ b/Zend/tests/closure_042.phpt @@ -18,6 +18,7 @@ $rm = new ReflectionFunction($d); var_dump($rm->getClosureScopeClass()->name); //dummy sope is Closure echo "Done.\n"; + --EXPECTF-- object(stdClass)#%d (0) { } diff --git a/Zend/tests/closure_043.phpt b/Zend/tests/closure_043.phpt index 2390aa153b..92b96575b5 100644 --- a/Zend/tests/closure_043.phpt +++ b/Zend/tests/closure_043.phpt @@ -38,6 +38,7 @@ $d = $staticUnscoped->bindTo(new A, 'A'); $d = $staticScoped->bindTo(new A, 'A'); echo "Done.\n"; + --EXPECTF-- Before binding bool(false) diff --git a/Zend/tests/closure_044.phpt b/Zend/tests/closure_044.phpt index 31a1e063dc..8fdef135dc 100644 --- a/Zend/tests/closure_044.phpt +++ b/Zend/tests/closure_044.phpt @@ -38,6 +38,7 @@ $d = $nonstaticUnscoped->bindTo(new A, 'A'); $d(); echo "\n"; $d = $nonstaticScoped->bindTo(new A, 'A'); $d(); echo "\n"; echo "Done.\n"; + --EXPECTF-- Before binding bool(false) diff --git a/Zend/tests/closure_045.phpt b/Zend/tests/closure_045.phpt index 3a9720eaf5..c6276be47b 100644 --- a/Zend/tests/closure_045.phpt +++ b/Zend/tests/closure_045.phpt @@ -13,5 +13,6 @@ $a = A::foo(); $a->bindTo(new A); echo "Done.\n"; + --EXPECTF-- Done. diff --git a/Zend/tests/closure_046.phpt b/Zend/tests/closure_046.phpt index b711ed7788..2985e6a8db 100644 --- a/Zend/tests/closure_046.phpt +++ b/Zend/tests/closure_046.phpt @@ -38,6 +38,7 @@ echo "After binding, with different instance for the bound one", "\n"; $d = $nonstaticScoped->bindTo(new B, "static"); $d(); echo "\n"; echo "Done.\n"; + --EXPECTF-- Before binding bool(false) diff --git a/Zend/tests/closure_049.phpt b/Zend/tests/closure_049.phpt index c5ed917f16..684b33d564 100644 --- a/Zend/tests/closure_049.phpt +++ b/Zend/tests/closure_049.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 049: static::class in static closure in non-static method. + --FILE-- <?php diff --git a/Zend/tests/closure_050.phpt b/Zend/tests/closure_050.phpt index 1ab0c3fa58..d43f325ef1 100644 --- a/Zend/tests/closure_050.phpt +++ b/Zend/tests/closure_050.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 050: static::class in non-static closure in non-static method. + --FILE-- <?php @@ -16,5 +17,6 @@ class B extends A {} $b = new B; var_dump($b->foo()); + --EXPECT-- string(1) "B" diff --git a/Zend/tests/closure_051.phpt b/Zend/tests/closure_051.phpt index ab514123c0..78b28d74a3 100644 --- a/Zend/tests/closure_051.phpt +++ b/Zend/tests/closure_051.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 051: static::class in static closure in static method. + --FILE-- <?php @@ -15,5 +16,6 @@ class A { class B extends A {} var_dump(B::foo()); + --EXPECT-- string(1) "B" diff --git a/Zend/tests/closure_052.phpt b/Zend/tests/closure_052.phpt index 5550cc92dc..f878515a82 100644 --- a/Zend/tests/closure_052.phpt +++ b/Zend/tests/closure_052.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 052: static::class in non-static closure in static method. + --FILE-- <?php @@ -15,5 +16,6 @@ class A { class B extends A {} var_dump(B::foo()); + --EXPECT-- string(1) "B" diff --git a/Zend/tests/closure_053.phpt b/Zend/tests/closure_053.phpt index 65c65ae08a..b1d76a2561 100644 --- a/Zend/tests/closure_053.phpt +++ b/Zend/tests/closure_053.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 053: self::class in static closure in non-static method. + --FILE-- <?php @@ -16,5 +17,6 @@ class B extends A {} $b = new B; var_dump($b->foo()); + --EXPECT-- string(1) "A" diff --git a/Zend/tests/closure_054.phpt b/Zend/tests/closure_054.phpt index 87c46d7a19..b2f87d1d61 100644 --- a/Zend/tests/closure_054.phpt +++ b/Zend/tests/closure_054.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 054: self::class in non-static closure in non-static method. + --FILE-- <?php @@ -16,5 +17,6 @@ class B extends A {} $b = new B; var_dump($b->foo()); + --EXPECT-- string(1) "A" diff --git a/Zend/tests/closure_055.phpt b/Zend/tests/closure_055.phpt index 2dc1d47103..047d72a89b 100644 --- a/Zend/tests/closure_055.phpt +++ b/Zend/tests/closure_055.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 055: self::class in static closure in static method. + --FILE-- <?php @@ -15,5 +16,6 @@ class A { class B extends A {} var_dump(B::foo()); + --EXPECT-- string(1) "A" diff --git a/Zend/tests/closure_056.phpt b/Zend/tests/closure_056.phpt index d1fa848ee6..566de10d83 100644 --- a/Zend/tests/closure_056.phpt +++ b/Zend/tests/closure_056.phpt @@ -1,5 +1,6 @@ --TEST-- Closure 056: self::class in non-static closure in static method. + --FILE-- <?php @@ -15,5 +16,6 @@ class A { class B extends A {} var_dump(B::foo()); + --EXPECT-- string(1) "A" diff --git a/Zend/tests/closure_bug66622.phpt b/Zend/tests/closure_bug66622.phpt index 44bbcbaa8d..1c9577d688 100644 --- a/Zend/tests/closure_bug66622.phpt +++ b/Zend/tests/closure_bug66622.phpt @@ -1,5 +1,6 @@ --TEST-- Bug 66622: Closures do not correctly capture the late bound class (static::) in some cases + --FILE-- <?php class A { @@ -28,6 +29,7 @@ function test() { B::baz(); } test(); + --EXPECT-- B vs B B vs B diff --git a/Zend/tests/closures/closure_from_callable_basic.phpt b/Zend/tests/closures/closure_from_callable_basic.phpt index 0aacaf2ff5..2561bbfaa6 100644 --- a/Zend/tests/closures/closure_from_callable_basic.phpt +++ b/Zend/tests/closures/closure_from_callable_basic.phpt @@ -98,6 +98,7 @@ echo $fn(" OK".PHP_EOL); ?> ===DONE=== --EXPECT-- + Access public static function OK Access public static function with different case OK Access public static function with colon scheme OK diff --git a/Zend/tests/closures/closure_from_callable_error.phpt b/Zend/tests/closures/closure_from_callable_error.phpt index c6e4a7e0bb..d9db90bcad 100644 --- a/Zend/tests/closures/closure_from_callable_error.phpt +++ b/Zend/tests/closures/closure_from_callable_error.phpt @@ -195,6 +195,7 @@ echo "OK\n"; ?> ===DONE=== --EXPECT-- + Cannot access privateInstance method statically Cannot access privateInstance method statically with colon scheme Cannot access privateInstance method diff --git a/Zend/tests/concat_001.phpt b/Zend/tests/concat_001.phpt index 1e657954a9..805478a0cf 100644 --- a/Zend/tests/concat_001.phpt +++ b/Zend/tests/concat_001.phpt @@ -50,6 +50,7 @@ var_dump($d.$d); echo "Done\n"; ?> --EXPECTF-- + Notice: Array to string conversion in %sconcat_001.php on line %d string(24) "Arraythis is test object" diff --git a/Zend/tests/concat_002.phpt b/Zend/tests/concat_002.phpt index c9f749518d..4ec4f1fb32 100644 --- a/Zend/tests/concat_002.phpt +++ b/Zend/tests/concat_002.phpt @@ -21,3 +21,4 @@ echo "Done\n"; --EXPECT-- int(33554432) Done + diff --git a/Zend/tests/const_dereference_002.phpt b/Zend/tests/const_dereference_002.phpt index 1320029baa..ff89519755 100644 --- a/Zend/tests/const_dereference_002.phpt +++ b/Zend/tests/const_dereference_002.phpt @@ -7,6 +7,7 @@ error_reporting(E_ALL); var_dump("foobar"[3]); var_dump("foobar"[2][0]); var_dump("foobar"["foo"]["bar"]); + --EXPECTF-- string(1) "b" string(1) "o" diff --git a/Zend/tests/constant_arrays.phpt b/Zend/tests/constant_arrays.phpt index 6c0d791650..46a0f9252e 100644 --- a/Zend/tests/constant_arrays.phpt +++ b/Zend/tests/constant_arrays.phpt @@ -30,6 +30,7 @@ var_dump(define('ELEPHPANT', [new StdClass])); $recursive = []; $recursive[0] = &$recursive; var_dump(define('RECURSION', $recursive)); + --EXPECTF-- array(4) { [0]=> diff --git a/Zend/tests/constant_expressions_coalesce_empty_dim.phpt b/Zend/tests/constant_expressions_coalesce_empty_dim.phpt index b69637c98d..56ee43b789 100644 --- a/Zend/tests/constant_expressions_coalesce_empty_dim.phpt +++ b/Zend/tests/constant_expressions_coalesce_empty_dim.phpt @@ -8,3 +8,4 @@ const A = [][] ?? 1; ?> --EXPECTF-- Fatal error: Cannot use [] for reading in %s.php on line %d + diff --git a/Zend/tests/constant_expressions_dynamic.phpt b/Zend/tests/constant_expressions_dynamic.phpt index 79f8c772e3..686dcc1d11 100644 --- a/Zend/tests/constant_expressions_dynamic.phpt +++ b/Zend/tests/constant_expressions_dynamic.phpt @@ -45,6 +45,7 @@ var_dump( ?> --EXPECTF-- + Warning: A non-numeric value encountered in %s on line %d int(3) string(4) "1foo" diff --git a/Zend/tests/constant_expressions_self_referencing_array.phpt b/Zend/tests/constant_expressions_self_referencing_array.phpt index daa7250641..c584b5d503 100644 --- a/Zend/tests/constant_expressions_self_referencing_array.phpt +++ b/Zend/tests/constant_expressions_self_referencing_array.phpt @@ -13,3 +13,4 @@ Fatal error: Uncaught Error: Cannot declare self-referencing constant 'self::BAR Stack trace: #0 {main} thrown in %s on line %d + diff --git a/Zend/tests/constants_002.phpt b/Zend/tests/constants_002.phpt index d590bf44b9..832da1564d 100644 --- a/Zend/tests/constants_002.phpt +++ b/Zend/tests/constants_002.phpt @@ -13,6 +13,6 @@ var_dump(foo); --EXPECTF-- Warning: Constants may only evaluate to scalar values or arrays in %s on line %d -Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d +Warning: Use of undefined constant foo - assumed 'foo' (this will throw an Error in a future version of PHP) in %s on line %d string(%d) "foo" resource(%d) of type (stream) diff --git a/Zend/tests/constants_005.phpt b/Zend/tests/constants_005.phpt index d2a205b784..b5a3a6bd38 100644 --- a/Zend/tests/constants_005.phpt +++ b/Zend/tests/constants_005.phpt @@ -7,6 +7,6 @@ define("ZEND_THREAD_safe", 123); var_dump(ZEND_THREAD_safe); ?> --EXPECTF-- -Notice: Use of undefined constant ZEND_THREAD_safe - assumed 'ZEND_THREAD_safe' in %s on line %d +Warning: Use of undefined constant ZEND_THREAD_safe - assumed 'ZEND_THREAD_safe' (this will throw an Error in a future version of PHP) in %s on line %d string(16) "ZEND_THREAD_safe" int(123) diff --git a/Zend/tests/debug_backtrace_with_include_and_this.phpt b/Zend/tests/debug_backtrace_with_include_and_this.phpt index 5d58279eb5..7cc868105a 100644 --- a/Zend/tests/debug_backtrace_with_include_and_this.phpt +++ b/Zend/tests/debug_backtrace_with_include_and_this.phpt @@ -36,3 +36,4 @@ Stack trace: #0 %s(%d): CL->load('class://non.exi...') #1 {main} thrown in %s on line %d + diff --git a/Zend/tests/declare_006.phpt b/Zend/tests/declare_006.phpt index 6d41c0d7d6..af86c5b165 100644 --- a/Zend/tests/declare_006.phpt +++ b/Zend/tests/declare_006.phpt @@ -6,4 +6,5 @@ declare(ticks = UNKNOWN_CONST) { echo 'Done'; } --EXPECTF-- + Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2 diff --git a/Zend/tests/dereference_014.phpt b/Zend/tests/dereference_014.phpt index 4d3574a1af..f8910dd016 100644 --- a/Zend/tests/dereference_014.phpt +++ b/Zend/tests/dereference_014.phpt @@ -27,8 +27,8 @@ var_dump($h); ?> --EXPECTF-- -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property 'a' of non-object in %s on line %d NULL -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property 'b' of non-object in %s on line %d NULL diff --git a/Zend/tests/dtor_scope.phpt b/Zend/tests/dtor_scope.phpt index ab991cf949..80f42cacb5 100644 --- a/Zend/tests/dtor_scope.phpt +++ b/Zend/tests/dtor_scope.phpt @@ -1,7 +1,5 @@ --TEST-- Scoping in destructor call ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> --FILE-- <?php class T diff --git a/Zend/tests/each_001.phpt b/Zend/tests/each_001.phpt index 06ab52a9c8..f2cae3d875 100644 --- a/Zend/tests/each_001.phpt +++ b/Zend/tests/each_001.phpt @@ -7,4 +7,6 @@ each($foo); ?> --EXPECTF-- +Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d + Warning: Variable passed to each() is not an array or object in %s on line %d diff --git a/Zend/tests/each_002.phpt b/Zend/tests/each_002.phpt index 31b749e5fd..5454f5ce0f 100644 --- a/Zend/tests/each_002.phpt +++ b/Zend/tests/each_002.phpt @@ -16,6 +16,7 @@ var_dump(each($a)); ?> --EXPECTF-- +Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d bool(false) bool(false) array(4) { diff --git a/Zend/tests/each_003.phpt b/Zend/tests/each_003.phpt index fbd54550fc..d0038c0561 100644 --- a/Zend/tests/each_003.phpt +++ b/Zend/tests/each_003.phpt @@ -12,6 +12,7 @@ var_dump(each($a[1])); ?> --EXPECTF-- +Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d array(4) { [1]=> array(0) { diff --git a/Zend/tests/errmsg_018.phpt b/Zend/tests/errmsg_018.phpt index fd34c8031e..b803499e50 100644 --- a/Zend/tests/errmsg_018.phpt +++ b/Zend/tests/errmsg_018.phpt @@ -10,4 +10,5 @@ class test { echo "Done\n"; ?> --EXPECTF-- + Fatal error: Class test contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::foo) in %s on line %d diff --git a/Zend/tests/exception_003.phpt b/Zend/tests/exception_003.phpt index b8efa94be0..813246c5dd 100644 --- a/Zend/tests/exception_003.phpt +++ b/Zend/tests/exception_003.phpt @@ -7,6 +7,7 @@ throw new Exception(1); ?> --EXPECTF-- + Fatal error: Uncaught Exception: 1 in %s:%d Stack trace: #0 {main} diff --git a/Zend/tests/exception_012.phpt b/Zend/tests/exception_012.phpt index bf8c05d516..4a1070330a 100644 --- a/Zend/tests/exception_012.phpt +++ b/Zend/tests/exception_012.phpt @@ -13,6 +13,8 @@ $func(); --EXPECTHEADERS-- Content-type: text/html; charset=UTF-8 --EXPECTF-- +Deprecated: Function create_function() is deprecated in %s on line %d + Fatal error: Uncaught AssertionError: assert(false) in %sexception_012.php(%d) : runtime-created function:%d Stack trace: #0 %sexception_012.php(%d) : runtime-created function(%d): assert(false, 'assert(false)') diff --git a/Zend/tests/fe_fetch_dtor_exception.phpt b/Zend/tests/fe_fetch_dtor_exception.phpt new file mode 100644 index 0000000000..840544b8ec --- /dev/null +++ b/Zend/tests/fe_fetch_dtor_exception.phpt @@ -0,0 +1,22 @@ +--TEST-- +Dtor may throw exception furing FE_FETCH assignment +--FILE-- +<?php + +$v = new class { + function __destruct() { + throw new Exception("foo"); + } +}; + +try { + foreach ([1, 2] as $v) { + var_dump($v); + } +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +foo diff --git a/Zend/tests/foreach_012.phpt b/Zend/tests/foreach_012.phpt index 517e0ac943..5e5538cd4d 100644 --- a/Zend/tests/foreach_012.phpt +++ b/Zend/tests/foreach_012.phpt @@ -15,4 +15,4 @@ foreach($a as &$v) { 2 3 14 -15 +15
\ No newline at end of file diff --git a/Zend/tests/foreach_015.phpt b/Zend/tests/foreach_015.phpt index b7482b66a0..adc8085f34 100644 --- a/Zend/tests/foreach_015.phpt +++ b/Zend/tests/foreach_015.phpt @@ -15,4 +15,4 @@ var_dump($a); 3 4 array(0) { -} +}
\ No newline at end of file diff --git a/Zend/tests/foreach_018.phpt b/Zend/tests/foreach_018.phpt new file mode 100644 index 0000000000..3c0be7be19 --- /dev/null +++ b/Zend/tests/foreach_018.phpt @@ -0,0 +1,20 @@ +--TEST-- +Foreach on stdClass with properties looking like mangled properties +--FILE-- +<?php + +$obj = (object)[ + "\0A\0b" => 42, + "\0*\0c" => 24, +]; + +foreach ($obj as $k => $v) { + var_dump($k, $v); +} + +?> +--EXPECT-- +string(1) "b" +int(42) +string(1) "c" +int(24) diff --git a/Zend/tests/foreach_empty_loop_leak.phpt b/Zend/tests/foreach_empty_loop_leak.phpt new file mode 100644 index 0000000000..70b391181b --- /dev/null +++ b/Zend/tests/foreach_empty_loop_leak.phpt @@ -0,0 +1,23 @@ +--TEST-- +Empty foreach loops with exception must not leak +--FILE-- +<?php + +class Foo implements IteratorAggregate { + public function getIterator() { + return new ArrayIterator([]); + } + public function __destruct() { + throw new Exception; + } +} + +try { + foreach (new Foo as $x); +} catch (Exception $e) { + echo "Exception caught\n"; +} + +?> +--EXPECT-- +Exception caught diff --git a/Zend/tests/function_arguments/argument_count_correct.phpt b/Zend/tests/function_arguments/argument_count_correct.phpt index 9c73b93520..44a87b8ba8 100644 --- a/Zend/tests/function_arguments/argument_count_correct.phpt +++ b/Zend/tests/function_arguments/argument_count_correct.phpt @@ -17,4 +17,4 @@ fclose($fp); echo "done"; --EXPECT-- -done +done
\ No newline at end of file diff --git a/Zend/tests/function_arguments/argument_count_correct_strict.phpt b/Zend/tests/function_arguments/argument_count_correct_strict.phpt index feed8b5964..bfce61f0c9 100644 --- a/Zend/tests/function_arguments/argument_count_correct_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_correct_strict.phpt @@ -17,4 +17,4 @@ fclose($fp); echo "done"; --EXPECT-- -done +done
\ No newline at end of file diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt index a8ba71c0bf..9d8d8bb7db 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt @@ -7,4 +7,4 @@ array_diff([]); --EXPECTF-- Warning: substr() expects at least 2 parameters, 1 given in %s -Warning: array_diff(): at least 2 parameters are required, 1 given in %s +Warning: array_diff(): at least 2 parameters are required, 1 given in %s
\ No newline at end of file diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt index 8775bece88..33748649da 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt @@ -15,4 +15,4 @@ array_diff([]); ArgumentCountError substr() expects at least 2 parameters, 1 given -Warning: array_diff(): at least 2 parameters are required, 1 given in %s +Warning: array_diff(): at least 2 parameters are required, 1 given in %s
\ No newline at end of file diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt index 94525c85b7..97faa4eb5c 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt @@ -41,4 +41,4 @@ Too few arguments to function bar(), 1 passed in %s and exactly 2 expected ArgumentCountError Too few arguments to function bat(), 1 passed in %s and exactly 2 expected ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
\ No newline at end of file diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt index 5698472f42..9029dc2625 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt @@ -51,4 +51,4 @@ Too few arguments to function bat(), 1 passed in %s and exactly 2 expected TypeError Argument 1 passed to bat() must be of the type integer, string given, called in %s TypeError -Argument 2 passed to bat() must be of the type string, integer given, called in %s +Argument 2 passed to bat() must be of the type string, integer given, called in %s
\ No newline at end of file diff --git a/Zend/tests/function_arguments_001.phpt b/Zend/tests/function_arguments_001.phpt index 14f71afc0e..8e3d34d31d 100644 --- a/Zend/tests/function_arguments_001.phpt +++ b/Zend/tests/function_arguments_001.phpt @@ -6,3 +6,4 @@ function foo($arg1 string) {} ?> --EXPECTF-- Parse error: %s error, %s)%s in %sfunction_arguments_001.php on line %d + diff --git a/Zend/tests/function_arguments_002.phpt b/Zend/tests/function_arguments_002.phpt index c9e5a6ec4a..1b5b7bd908 100644 --- a/Zend/tests/function_arguments_002.phpt +++ b/Zend/tests/function_arguments_002.phpt @@ -6,3 +6,4 @@ function foo($arg1/) {} ?> --EXPECTF-- Parse error: %s error, %s)%s in %sfunction_arguments_002.php on line %d + diff --git a/Zend/tests/function_exists_error.phpt b/Zend/tests/function_exists_error.phpt index f07ac53148..8ce8a92885 100644 --- a/Zend/tests/function_exists_error.phpt +++ b/Zend/tests/function_exists_error.phpt @@ -33,3 +33,4 @@ Too few arguments Warning: function_exists() expects exactly 1 parameter, 0 given in %s on line %d NULL ===Done=== + diff --git a/Zend/tests/function_exists_variation1.phpt b/Zend/tests/function_exists_variation1.phpt index bd74e2f762..fc26f1e80e 100644 --- a/Zend/tests/function_exists_variation1.phpt +++ b/Zend/tests/function_exists_variation1.phpt @@ -135,4 +135,4 @@ bool(false) -- Iteration 22 -- bool(false) ===Done=== - +
\ No newline at end of file diff --git a/Zend/tests/generators/basic_yield_from_exception_handling.phpt b/Zend/tests/generators/basic_yield_from_exception_handling.phpt index 6b622847cd..c696f6486d 100644 --- a/Zend/tests/generators/basic_yield_from_exception_handling.phpt +++ b/Zend/tests/generators/basic_yield_from_exception_handling.phpt @@ -56,3 +56,4 @@ Exception: 4 in %s:%d Stack trace: #0 {main} bool(false) + diff --git a/Zend/tests/generators/bug71013.phpt b/Zend/tests/generators/bug71013.phpt index 1b7bdd7935..6ede86e3ba 100644 --- a/Zend/tests/generators/bug71013.phpt +++ b/Zend/tests/generators/bug71013.phpt @@ -46,3 +46,4 @@ Destructing FooBar NULL Unsetting $x Finishing bar() + diff --git a/Zend/tests/generators/bug71441.phpt b/Zend/tests/generators/bug71441.phpt index 14395d2402..3a103888b0 100644 --- a/Zend/tests/generators/bug71441.phpt +++ b/Zend/tests/generators/bug71441.phpt @@ -26,3 +26,4 @@ var_dump($gen->getReturn()); int(2002) Ok string(7) "Success" + diff --git a/Zend/tests/generators/bug71601.phpt b/Zend/tests/generators/bug71601.phpt index 09da2a5077..e3f21692e7 100644 --- a/Zend/tests/generators/bug71601.phpt +++ b/Zend/tests/generators/bug71601.phpt @@ -37,3 +37,4 @@ int(1) Inner finally Finally Done + diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt new file mode 100644 index 0000000000..97e03e7d71 --- /dev/null +++ b/Zend/tests/generators/errors/count_error.phpt @@ -0,0 +1,18 @@ +--TEST-- +Generators can't be counted +--FILE-- +<?php + +function gen() { yield; } + +$gen = gen(); + +try { + count($gen); +} catch (Exception $e) { + echo $e; +} + +?> +--EXPECTF-- +Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d diff --git a/Zend/tests/generators/errors/non_ref_generator_iterated_by_ref_error.phpt b/Zend/tests/generators/errors/non_ref_generator_iterated_by_ref_error.phpt index e7fc2647be..4ea1b6505c 100644 --- a/Zend/tests/generators/errors/non_ref_generator_iterated_by_ref_error.phpt +++ b/Zend/tests/generators/errors/non_ref_generator_iterated_by_ref_error.phpt @@ -14,3 +14,4 @@ Fatal error: Uncaught Exception: You can only iterate a generator by-reference i Stack trace: #0 {main} thrown in %s on line %d + diff --git a/Zend/tests/generators/generator_closure_unused.phpt b/Zend/tests/generators/generator_closure_unused.phpt index 6466c4c2e9..9acf8f9d93 100644 --- a/Zend/tests/generators/generator_closure_unused.phpt +++ b/Zend/tests/generators/generator_closure_unused.phpt @@ -6,4 +6,4 @@ Closures can be unused generators echo "ok\n"; ?> --EXPECT-- -ok +ok
\ No newline at end of file diff --git a/Zend/tests/generators/generator_return_without_value.phpt b/Zend/tests/generators/generator_return_without_value.phpt index c507ebeb9c..dfea5aa78d 100644 --- a/Zend/tests/generators/generator_return_without_value.phpt +++ b/Zend/tests/generators/generator_return_without_value.phpt @@ -40,4 +40,4 @@ object(Generator)#%d (0) { object(Generator)#%d (0) { } object(Generator)#%d (0) { -} +}
\ No newline at end of file diff --git a/Zend/tests/generators/generator_throwing_in_foreach.phpt b/Zend/tests/generators/generator_throwing_in_foreach.phpt index a407b01920..44a867404f 100644 --- a/Zend/tests/generators/generator_throwing_in_foreach.phpt +++ b/Zend/tests/generators/generator_throwing_in_foreach.phpt @@ -17,3 +17,4 @@ Stack trace: #0 %s(%d): gen() #1 {main} thrown in %s on line %d + diff --git a/Zend/tests/generators/generator_with_arg_unpacking.phpt b/Zend/tests/generators/generator_with_arg_unpacking.phpt index 316fc490df..edf0bafd31 100644 --- a/Zend/tests/generators/generator_with_arg_unpacking.phpt +++ b/Zend/tests/generators/generator_with_arg_unpacking.phpt @@ -9,4 +9,4 @@ $g = call_user_func_array(function() { yield; }, range(1, 16384)); echo "OK\n"; ?> --EXPECT-- -OK +OK
\ No newline at end of file diff --git a/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt b/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt index 52dbea89b2..f56a325684 100644 --- a/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt +++ b/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt @@ -41,3 +41,4 @@ int(3) int(5) NULL bool(false) + diff --git a/Zend/tests/generators/recursive_yield_from.phpt b/Zend/tests/generators/recursive_yield_from.phpt index 2fc1e0a591..dbf2c948ea 100644 --- a/Zend/tests/generators/recursive_yield_from.phpt +++ b/Zend/tests/generators/recursive_yield_from.phpt @@ -31,3 +31,4 @@ int(5) int(7) int(8) int(2) + diff --git a/Zend/tests/generators/throw_rethrow.phpt b/Zend/tests/generators/throw_rethrow.phpt index 8fbc6743b8..f9e3f78f48 100644 --- a/Zend/tests/generators/throw_rethrow.phpt +++ b/Zend/tests/generators/throw_rethrow.phpt @@ -31,3 +31,4 @@ Stack trace: #1 %s(%d): Generator->throw(Object(RuntimeException)) #2 {main} thrown in %s on line %d + diff --git a/Zend/tests/generators/yield_from_backtrace.phpt b/Zend/tests/generators/yield_from_backtrace.phpt index e5d79723e7..18781e7551 100644 --- a/Zend/tests/generators/yield_from_backtrace.phpt +++ b/Zend/tests/generators/yield_from_backtrace.phpt @@ -46,3 +46,4 @@ int(2) int(3) #0 gen() #1 Generator->next() called at [%s:%d] + diff --git a/Zend/tests/generators/yield_from_multi_tree.phpt b/Zend/tests/generators/yield_from_multi_tree.phpt index 9bec138149..91ae80e909 100644 --- a/Zend/tests/generators/yield_from_multi_tree.phpt +++ b/Zend/tests/generators/yield_from_multi_tree.phpt @@ -329,3 +329,4 @@ int(125) int(126) int(127) int(128) + diff --git a/Zend/tests/generators/yield_from_multi_tree_exception.phpt b/Zend/tests/generators/yield_from_multi_tree_exception.phpt index 4ff2e4e41f..2bdeedba7d 100644 --- a/Zend/tests/generators/yield_from_multi_tree_exception.phpt +++ b/Zend/tests/generators/yield_from_multi_tree_exception.phpt @@ -75,3 +75,4 @@ Stack trace: #0 [internal function]: gen(Object(Generator), 1) #1 %s(%d): Generator->current() #2 {main} + diff --git a/Zend/tests/generators/yield_unary_precedence.phpt b/Zend/tests/generators/yield_unary_precedence.phpt index 54eb0feb5f..9357168c80 100644 --- a/Zend/tests/generators/yield_unary_precedence.phpt +++ b/Zend/tests/generators/yield_unary_precedence.phpt @@ -14,6 +14,7 @@ for ($gen = gen(); $gen->valid(); $gen->send(1)) { } ?> --EXPECT-- + int(1) int(1) @@ -22,3 +23,4 @@ int(1) NULL int(-1) + diff --git a/Zend/tests/grammar/regression_001.phpt b/Zend/tests/grammar/regression_001.phpt index 1de19c8216..73d5eacdf6 100644 --- a/Zend/tests/grammar/regression_001.phpt +++ b/Zend/tests/grammar/regression_001.phpt @@ -22,7 +22,9 @@ Foo:: ); echo "\nDone\n"; + --EXPECTF-- + Foo::function Foo::function Foo::function diff --git a/Zend/tests/grammar/regression_002.phpt b/Zend/tests/grammar/regression_002.phpt index 68091778dc..dd307c99d8 100644 --- a/Zend/tests/grammar/regression_002.phpt +++ b/Zend/tests/grammar/regression_002.phpt @@ -14,6 +14,7 @@ var_dump(Foo:: CLASS); var_dump(Foo:: CLASS); + --EXPECTF-- string(3) "Foo" string(3) "Foo" diff --git a/Zend/tests/grammar/regression_004.phpt b/Zend/tests/grammar/regression_004.phpt index f032fc882d..edb32032ea 100644 --- a/Zend/tests/grammar/regression_004.phpt +++ b/Zend/tests/grammar/regression_004.phpt @@ -10,5 +10,6 @@ class Obj } function echo(){} // not valid + --EXPECTF-- Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting %s in %s on line 9 diff --git a/Zend/tests/grammar/regression_005.phpt b/Zend/tests/grammar/regression_005.phpt index ad83ee717d..7704375d6e 100644 --- a/Zend/tests/grammar/regression_005.phpt +++ b/Zend/tests/grammar/regression_005.phpt @@ -9,5 +9,6 @@ class Obj } const return = 'nope'; + --EXPECTF-- Parse error: syntax error, unexpected 'return' (T_RETURN), expecting identifier (T_STRING) in %s on line 8 diff --git a/Zend/tests/grammar/regression_006.phpt b/Zend/tests/grammar/regression_006.phpt index fac02d2b87..6aae0ba24b 100644 --- a/Zend/tests/grammar/regression_006.phpt +++ b/Zend/tests/grammar/regression_006.phpt @@ -19,6 +19,7 @@ echo Obj:: USE, PHP_EOL; echo "\nDone\n"; + --EXPECTF-- declare return diff --git a/Zend/tests/grammar/regression_007.phpt b/Zend/tests/grammar/regression_007.phpt index 7773d8fc7e..92b22531a4 100644 --- a/Zend/tests/grammar/regression_007.phpt +++ b/Zend/tests/grammar/regression_007.phpt @@ -28,6 +28,7 @@ Foo::{'new'}(); var_dump(Foo::use); echo "\nDone\n"; + --EXPECTF-- Foo::new Foo::new diff --git a/Zend/tests/grammar/regression_008.phpt b/Zend/tests/grammar/regression_008.phpt index 52e14d2946..7741ed036c 100644 --- a/Zend/tests/grammar/regression_008.phpt +++ b/Zend/tests/grammar/regression_008.phpt @@ -12,7 +12,10 @@ $friday = new Friday; echo "$friday->require ($friday->require) {$friday->require}", PHP_EOL; echo "\nDone\n"; + + --EXPECTF-- + fun (fun) fun Done diff --git a/Zend/tests/grammar/regression_009.phpt b/Zend/tests/grammar/regression_009.phpt index c648c02a6c..589d90316b 100644 --- a/Zend/tests/grammar/regression_009.phpt +++ b/Zend/tests/grammar/regression_009.phpt @@ -12,5 +12,7 @@ class Foo } echo PHP_EOL, "Done", PHP_EOL; + --EXPECTF-- + Done diff --git a/Zend/tests/grammar/regression_010.phpt b/Zend/tests/grammar/regression_010.phpt index fa7fb18535..5dc90f288a 100644 --- a/Zend/tests/grammar/regression_010.phpt +++ b/Zend/tests/grammar/regression_010.phpt @@ -8,5 +8,7 @@ interface A{} class B implements\A {} echo "Done", PHP_EOL; + --EXPECTF-- + Done diff --git a/Zend/tests/grammar/regression_012.phpt b/Zend/tests/grammar/regression_012.phpt index 817f337a5c..3b4925afa6 100644 --- a/Zend/tests/grammar/regression_012.phpt +++ b/Zend/tests/grammar/regression_012.phpt @@ -9,4 +9,5 @@ class A { ?> --EXPECTF-- + Parse error: syntax error, unexpected 'FOREACH' (T_FOREACH), expecting ']' in %s on line %d diff --git a/Zend/tests/grammar/regression_013.phpt b/Zend/tests/grammar/regression_013.phpt index 369ff1c8ad..1c60ffc273 100644 --- a/Zend/tests/grammar/regression_013.phpt +++ b/Zend/tests/grammar/regression_013.phpt @@ -9,4 +9,5 @@ echo "Done", PHP_EOL; ?> --EXPECTF-- + Done diff --git a/Zend/tests/grammar/semi_reserved_001.phpt b/Zend/tests/grammar/semi_reserved_001.phpt index f74afcb6fe..48937de39e 100644 --- a/Zend/tests/grammar/semi_reserved_001.phpt +++ b/Zend/tests/grammar/semi_reserved_001.phpt @@ -161,6 +161,7 @@ $obj->__DIR__(); $obj->__NAMESPACE__(); echo "\nDone\n"; + --EXPECTF-- Obj::empty Obj::callable diff --git a/Zend/tests/grammar/semi_reserved_002.phpt b/Zend/tests/grammar/semi_reserved_002.phpt index 8eab9104ac..a082f9ddbb 100644 --- a/Zend/tests/grammar/semi_reserved_002.phpt +++ b/Zend/tests/grammar/semi_reserved_002.phpt @@ -159,6 +159,7 @@ Obj::__DIR__(); Obj::__NAMESPACE__(); echo "\nDone\n"; + --EXPECTF-- Obj::empty Obj::callable diff --git a/Zend/tests/grammar/semi_reserved_004.phpt b/Zend/tests/grammar/semi_reserved_004.phpt index f5c2915f1c..38963870a0 100644 --- a/Zend/tests/grammar/semi_reserved_004.phpt +++ b/Zend/tests/grammar/semi_reserved_004.phpt @@ -161,6 +161,7 @@ echo Obj::$__NAMESPACE__, PHP_EOL; echo Obj::$__halt_compiler, PHP_EOL; echo "\nDone\n"; + --EXPECTF-- empty callable diff --git a/Zend/tests/grammar/semi_reserved_005.phpt b/Zend/tests/grammar/semi_reserved_005.phpt index 6407597362..45d20ad0d8 100644 --- a/Zend/tests/grammar/semi_reserved_005.phpt +++ b/Zend/tests/grammar/semi_reserved_005.phpt @@ -157,6 +157,7 @@ echo Obj::__DIR__, PHP_EOL; echo Obj::__NAMESPACE__, PHP_EOL; echo "\nDone\n"; + --EXPECTF-- empty callable diff --git a/Zend/tests/grammar/semi_reserved_006.phpt b/Zend/tests/grammar/semi_reserved_006.phpt index 6657fd92cf..334d09ac36 100644 --- a/Zend/tests/grammar/semi_reserved_006.phpt +++ b/Zend/tests/grammar/semi_reserved_006.phpt @@ -58,6 +58,7 @@ Foo::byebye(); Foo::farewell(); echo "\nDone\n"; + --EXPECTF-- TraitA::catch TraitA::list diff --git a/Zend/tests/grammar/semi_reserved_007.phpt b/Zend/tests/grammar/semi_reserved_007.phpt index e712fdf304..5105629cbe 100644 --- a/Zend/tests/grammar/semi_reserved_007.phpt +++ b/Zend/tests/grammar/semi_reserved_007.phpt @@ -25,6 +25,7 @@ class Bar extends Foo { new Bar; echo "\nDone\n"; + --EXPECTF-- From Foo::__construct: self @@ -33,4 +34,4 @@ From Bar::__construct: self parent -Done +Done
\ No newline at end of file diff --git a/Zend/tests/grammar/semi_reserved_008.phpt b/Zend/tests/grammar/semi_reserved_008.phpt index f48c459671..059bb8192e 100644 --- a/Zend/tests/grammar/semi_reserved_008.phpt +++ b/Zend/tests/grammar/semi_reserved_008.phpt @@ -61,6 +61,7 @@ Foo /**/ attempt(); echo PHP_EOL, "Done", PHP_EOL; + --EXPECTF-- TraitB::try diff --git a/Zend/tests/grammar/semi_reserved_009.phpt b/Zend/tests/grammar/semi_reserved_009.phpt index 8200e95b35..1a7b0fc371 100644 --- a/Zend/tests/grammar/semi_reserved_009.phpt +++ b/Zend/tests/grammar/semi_reserved_009.phpt @@ -18,6 +18,7 @@ class Foo Foo::try(); echo PHP_EOL, "Done", PHP_EOL; + --EXPECTF-- TraitA::as diff --git a/Zend/tests/grammar/semi_reserved_010.phpt b/Zend/tests/grammar/semi_reserved_010.phpt index 5bfa8c605e..508a7867a4 100644 --- a/Zend/tests/grammar/semi_reserved_010.phpt +++ b/Zend/tests/grammar/semi_reserved_010.phpt @@ -24,6 +24,7 @@ class Foo Foo::insteadof(); echo PHP_EOL, "Done", PHP_EOL; + --EXPECTF-- TraitB::insteadof diff --git a/Zend/tests/halt_compiler1.phpt b/Zend/tests/halt_compiler1.phpt index 77b3696f22..4987b29b2c 100644 --- a/Zend/tests/halt_compiler1.phpt +++ b/Zend/tests/halt_compiler1.phpt @@ -5,4 +5,4 @@ __HALT_COMPILER(); ?> ===DONE=== --EXPECT-- -testint(73) +testint(73)
\ No newline at end of file diff --git a/Zend/tests/halt_compiler2.phpt b/Zend/tests/halt_compiler2.phpt index da8ac6cae9..0ced2142cd 100644 --- a/Zend/tests/halt_compiler2.phpt +++ b/Zend/tests/halt_compiler2.phpt @@ -20,4 +20,4 @@ unlink(dirname(__FILE__) . '/test2.php'); --EXPECT-- testint(73) test2int(74) -==DONE== +==DONE==
\ No newline at end of file diff --git a/Zend/tests/halt_compiler3.phpt b/Zend/tests/halt_compiler3.phpt index 7bd7410c73..6ee16f79b9 100644 --- a/Zend/tests/halt_compiler3.phpt +++ b/Zend/tests/halt_compiler3.phpt @@ -7,4 +7,4 @@ define ('__COMPILER_HALT_OFFSET__', 1); ==DONE== --EXPECTF-- Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d -==DONE== +==DONE==
\ No newline at end of file diff --git a/Zend/tests/halt_compiler4.phpt b/Zend/tests/halt_compiler4.phpt index 53a4fc76f9..43e532ce7d 100644 --- a/Zend/tests/halt_compiler4.phpt +++ b/Zend/tests/halt_compiler4.phpt @@ -7,4 +7,4 @@ __HALT_COMPILER(); ?> ==DONE== --EXPECTF-- -Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d +Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/indirect_call_array_003.phpt b/Zend/tests/indirect_call_array_003.phpt index b4b713ff64..f1dde491f6 100644 --- a/Zend/tests/indirect_call_array_003.phpt +++ b/Zend/tests/indirect_call_array_003.phpt @@ -36,3 +36,4 @@ From foo::__call: string(3) "abc" object(foo)#%d (0) { } + diff --git a/Zend/tests/instanceof.phpt b/Zend/tests/instanceof.phpt index 8bcbede999..97d67ff567 100644 --- a/Zend/tests/instanceof.phpt +++ b/Zend/tests/instanceof.phpt @@ -2,10 +2,10 @@ instanceof shouldn't call __autoload --FILE-- <?php -function __autoload($name) { +spl_autoload_register(function ($name) { echo("AUTOLOAD '$name'\n"); eval("class $name {}"); -} +}); class A { } diff --git a/Zend/tests/instanceof_001.phpt b/Zend/tests/instanceof_001.phpt index 02f5cc0a25..8c13a0478c 100644 --- a/Zend/tests/instanceof_001.phpt +++ b/Zend/tests/instanceof_001.phpt @@ -22,6 +22,8 @@ var_dump("$a" instanceof stdClass); --EXPECTF-- bool(true) bool(true) + +Deprecated: Function create_function() is deprecated in %s on line %d bool(true) bool(true) bool(false) diff --git a/Zend/tests/int_special_values.phpt b/Zend/tests/int_special_values.phpt index eedb9ab2c0..e1a50b6ecb 100644 --- a/Zend/tests/int_special_values.phpt +++ b/Zend/tests/int_special_values.phpt @@ -34,4 +34,4 @@ float(-0) int(0) float(NAN) -int(0) +int(0)
\ No newline at end of file diff --git a/Zend/tests/int_static_prop_name.phpt b/Zend/tests/int_static_prop_name.phpt index cb47bb6d0a..bfdfc42052 100644 --- a/Zend/tests/int_static_prop_name.phpt +++ b/Zend/tests/int_static_prop_name.phpt @@ -40,3 +40,4 @@ int(24) Access to undeclared static property: Foo::$42 Access to undeclared static property: Foo::$42 Access to undeclared static property: Foo::$42 + diff --git a/Zend/tests/is_a.phpt b/Zend/tests/is_a.phpt index f4161f2390..3714d50a62 100644 --- a/Zend/tests/is_a.phpt +++ b/Zend/tests/is_a.phpt @@ -4,10 +4,10 @@ is_a() and is_subclass_of() shouldn't call __autoload error_reporting=14335 --FILE-- <?php -function __autoload($name) { +spl_autoload_register(function ($name) { echo("AUTOLOAD '$name'\n"); eval("class $name {}"); -} +}); class BASE { } diff --git a/Zend/tests/isset_003.phpt b/Zend/tests/isset_003.phpt index 92225b5906..eac72f7e0a 100644 --- a/Zend/tests/isset_003.phpt +++ b/Zend/tests/isset_003.phpt @@ -33,7 +33,7 @@ Notice: Undefined variable: c in %s on line %d Notice: Undefined variable: d in %s on line %d -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property '' of non-object in %s on line %d bool(false) bool(true) bool(false) diff --git a/Zend/tests/isset_003_2_4.phpt b/Zend/tests/isset_003_2_4.phpt deleted file mode 100644 index 42d8cc6a08..0000000000 --- a/Zend/tests/isset_003_2_4.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Testing isset accessing undefined array itens and properties ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.4.0', '<')) die('skip ZendEngine 2.4 needed'); ?> ---FILE-- -<?php - -$a = 'foo'; -$b =& $a; - -var_dump(isset($b)); - -var_dump(isset($a[0], $b[1])); - -var_dump(isset($a[0]->a)); - -var_dump(isset($c[0][1][2]->a->b->c->d)); - -var_dump(isset(${$a}->{$b->{$c[$d]}})); - -var_dump(isset($GLOBALS)); - -var_dump(isset($GLOBALS[1])); - -var_dump(isset($GLOBALS[1]->$GLOBALS)); - -?> ---EXPECTF-- -bool(true) -bool(true) -bool(false) -bool(false) - -Notice: Undefined variable: c in %s on line %d - -Notice: Undefined variable: d in %s on line %d - -Notice: Trying to get property of non-object in %s on line %d -bool(false) -bool(true) -bool(false) -bool(false) diff --git a/Zend/tests/list_keyed_undefined.phpt b/Zend/tests/list_keyed_undefined.phpt index 3d1939c5ac..a18e3b4d20 100644 --- a/Zend/tests/list_keyed_undefined.phpt +++ b/Zend/tests/list_keyed_undefined.phpt @@ -14,6 +14,7 @@ var_dump($five, $duke); ?> --EXPECTF-- + Notice: Undefined offset: 5 in %s on line %d Notice: Undefined index: duke in %s on line %d diff --git a/Zend/tests/lsb_006.phpt b/Zend/tests/lsb_006.phpt index b10b742463..84cd22a995 100644 --- a/Zend/tests/lsb_006.phpt +++ b/Zend/tests/lsb_006.phpt @@ -10,3 +10,4 @@ class Foo extends static { ==DONE== --EXPECTF-- Parse error: %s error,%sexpecting %s in %s on line %d + diff --git a/Zend/tests/lsb_007.phpt b/Zend/tests/lsb_007.phpt index c28e815be0..607f8efeb4 100644 --- a/Zend/tests/lsb_007.phpt +++ b/Zend/tests/lsb_007.phpt @@ -10,3 +10,4 @@ class Foo implements static { ==DONE== --EXPECTF-- Parse error: %s error,%sexpecting %s in %s on line %d + diff --git a/Zend/tests/lsb_008.phpt b/Zend/tests/lsb_008.phpt index 79f906bd7e..b700e2df94 100644 --- a/Zend/tests/lsb_008.phpt +++ b/Zend/tests/lsb_008.phpt @@ -6,3 +6,4 @@ class static { } --EXPECTF-- Parse error: %s error,%sexpecting %s in %s on line %d + diff --git a/Zend/tests/lsb_009.phpt b/Zend/tests/lsb_009.phpt index 9b1686391b..d8d41817c8 100644 --- a/Zend/tests/lsb_009.phpt +++ b/Zend/tests/lsb_009.phpt @@ -6,3 +6,4 @@ interface static { } --EXPECTF-- Parse error: %s error,%sexpecting %s in %s on line %d + diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt index 027aa64c20..f76b7d43a0 100644 --- a/Zend/tests/methods-on-non-objects-call-user-func.phpt +++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt @@ -10,3 +10,4 @@ echo "Alive\n"; Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d NULL Alive + diff --git a/Zend/tests/methods-on-non-objects-catch.phpt b/Zend/tests/methods-on-non-objects-catch.phpt index a52d3a722a..083ae75e49 100644 --- a/Zend/tests/methods-on-non-objects-catch.phpt +++ b/Zend/tests/methods-on-non-objects-catch.phpt @@ -15,6 +15,7 @@ try { echo "Alive\n"; ?> --EXPECTF-- + int(0) string(%d) "Call to a member function method() on null" Alive diff --git a/Zend/tests/methods-on-non-objects.phpt b/Zend/tests/methods-on-non-objects.phpt index 0fd93fcecc..13002c94a3 100644 --- a/Zend/tests/methods-on-non-objects.phpt +++ b/Zend/tests/methods-on-non-objects.phpt @@ -8,6 +8,7 @@ $x->method(); echo "Should not get here!\n"; ?> --EXPECTF-- + Fatal error: Uncaught Error: Call to a member function method() on null in %s:%d Stack trace: #0 {main} diff --git a/Zend/tests/multibyte/multibyte_encoding_006.phpt b/Zend/tests/multibyte/multibyte_encoding_006.phpt Binary files differindex d518c29e3e..b87b434fe4 100644 --- a/Zend/tests/multibyte/multibyte_encoding_006.phpt +++ b/Zend/tests/multibyte/multibyte_encoding_006.phpt diff --git a/Zend/tests/nested_method_and_function.phpt b/Zend/tests/nested_method_and_function.phpt index c63c601eaf..3fa1b18da1 100644 --- a/Zend/tests/nested_method_and_function.phpt +++ b/Zend/tests/nested_method_and_function.phpt @@ -36,4 +36,4 @@ string(12) "Baz\Foo::bar" string(7) "Baz\Foo" string(13) "Baz\{closure}" string(13) "Baz\{closure}" -string(7) "Baz\Foo" +string(7) "Baz\Foo"
\ No newline at end of file diff --git a/Zend/tests/nowdoc_009.phpt b/Zend/tests/nowdoc_009.phpt index fdc6e4e21d..ec8b78f010 100644 --- a/Zend/tests/nowdoc_009.phpt +++ b/Zend/tests/nowdoc_009.phpt @@ -37,3 +37,4 @@ ENDOFNOWDOC ; ENDOFNOWDOC ENDOFNOWDOC $ENDOFNOWDOC; + diff --git a/Zend/tests/nowdoc_010.phpt b/Zend/tests/nowdoc_010.phpt index 49ec560aa0..6f288151ce 100644 --- a/Zend/tests/nowdoc_010.phpt +++ b/Zend/tests/nowdoc_010.phpt @@ -30,3 +30,4 @@ ENDOFNOWDOC{$fooledYou} {$fooledYou}ENDOFNOWDOC{$fooledYou} ENDOFNOWDOC{$fooledYou} {$fooledYou}ENDOFNOWDOC + diff --git a/Zend/tests/ns_004.phpt b/Zend/tests/ns_004.phpt index f04f662e0a..44b618cd70 100644 --- a/Zend/tests/ns_004.phpt +++ b/Zend/tests/ns_004.phpt @@ -9,4 +9,4 @@ echo get_class(new Exception()),"\n"; Fatal error: Uncaught Error: Class 'test\ns1\Exception' not found in %sns_004.php:%d Stack trace: #0 {main} - thrown in %sns_004.php on line %d + thrown in %sns_004.php on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_011.phpt b/Zend/tests/ns_011.phpt index 7aa6270a1c..9ee6888a65 100644 --- a/Zend/tests/ns_011.phpt +++ b/Zend/tests/ns_011.phpt @@ -16,6 +16,7 @@ bar(); function bar() { echo __FUNCTION__,"\n"; } + --EXPECT-- test\ns1\foo test\ns1\foo diff --git a/Zend/tests/ns_012.phpt b/Zend/tests/ns_012.phpt index 210cba9065..034f124924 100644 --- a/Zend/tests/ns_012.phpt +++ b/Zend/tests/ns_012.phpt @@ -23,6 +23,7 @@ ns3\ns1\bar(); function bar() { echo __FUNCTION__,"\n"; } + --EXPECT-- test\ns1\foo test\ns1\bar diff --git a/Zend/tests/ns_015.phpt b/Zend/tests/ns_015.phpt index 405d3e4518..ae2c818345 100644 --- a/Zend/tests/ns_015.phpt +++ b/Zend/tests/ns_015.phpt @@ -11,3 +11,4 @@ function strlen($x) { echo \strlen("Hello"),"\n"; --EXPECT-- 5 + diff --git a/Zend/tests/ns_017.phpt b/Zend/tests/ns_017.phpt index d48afd5f01..888d8e5ef4 100644 --- a/Zend/tests/ns_017.phpt +++ b/Zend/tests/ns_017.phpt @@ -11,4 +11,4 @@ function strlen($x) { $x = "strlen"; echo $x("Hello"),"\n"; --EXPECT-- -5 +5
\ No newline at end of file diff --git a/Zend/tests/ns_026.phpt b/Zend/tests/ns_026.phpt index 530e135230..b8f8c3f83d 100644 --- a/Zend/tests/ns_026.phpt +++ b/Zend/tests/ns_026.phpt @@ -35,4 +35,4 @@ Func - Foo\Bar Fatal error: Uncaught Error: Call to undefined function Foo\Foo\Bar() in %sns_026.php:%d Stack trace: #0 {main} - thrown in %sns_026.php on line %d + thrown in %sns_026.php on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_038.phpt b/Zend/tests/ns_038.phpt index f514de77c9..9cef33d82b 100644 --- a/Zend/tests/ns_038.phpt +++ b/Zend/tests/ns_038.phpt @@ -15,3 +15,4 @@ Fatal error: Uncaught Error: Call to undefined method Exception::bar() in %sns_0 Stack trace: #0 {main} thrown in %sns_038.php on line 7 + diff --git a/Zend/tests/ns_041.phpt b/Zend/tests/ns_041.phpt index 4ccafdcf3b..e1f0ba3a97 100644 --- a/Zend/tests/ns_041.phpt +++ b/Zend/tests/ns_041.phpt @@ -12,10 +12,11 @@ echo(\test\ns1\FOO); echo(BAR); const BAR = "ok\n"; + --EXPECTF-- ok ok ok -Notice: Use of undefined constant BAR - assumed 'BAR' in %sns_041.php on line 9 +Warning: Use of undefined constant BAR - assumed 'BAR' (this will throw an Error in a future version of PHP) in %sns_041.php on line 9 BAR diff --git a/Zend/tests/ns_053.phpt b/Zend/tests/ns_053.phpt index dd3ff76693..bc5ab12cdb 100644 --- a/Zend/tests/ns_053.phpt +++ b/Zend/tests/ns_053.phpt @@ -10,3 +10,4 @@ echo \test\ns1\NAME."\n"; --EXPECT-- ns_053.php ns_053.php + diff --git a/Zend/tests/ns_057.phpt b/Zend/tests/ns_057.phpt index 6c7a72f86e..639687ee0a 100644 --- a/Zend/tests/ns_057.phpt +++ b/Zend/tests/ns_057.phpt @@ -59,4 +59,4 @@ ok Fatal error: Uncaught Error: Undefined constant 'Test\ns1\unknown' in %sns_057.php:%d Stack trace: #0 {main} - thrown in %sns_057.php on line %d + thrown in %sns_057.php on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_068.phpt b/Zend/tests/ns_068.phpt index 09075f6c76..b6dc258fd3 100644 --- a/Zend/tests/ns_068.phpt +++ b/Zend/tests/ns_068.phpt @@ -10,4 +10,5 @@ echo __NAMESPACE__ . "\n"; ?> ===DONE=== --EXPECTF-- + Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_068.php on line %d diff --git a/Zend/tests/ns_069.inc b/Zend/tests/ns_069.inc index 4f186390ad..46d8f8f488 100644 --- a/Zend/tests/ns_069.inc +++ b/Zend/tests/ns_069.inc @@ -1,3 +1,3 @@ <?php -var_dump((binary)__NAMESPACE__); +var_dump(__NAMESPACE__); diff --git a/Zend/tests/ns_069.phpt b/Zend/tests/ns_069.phpt index 63269d0de7..cbfb927049 100644 --- a/Zend/tests/ns_069.phpt +++ b/Zend/tests/ns_069.phpt @@ -7,9 +7,9 @@ namespace foo; class Test { static function f() { - var_dump((binary)__NAMESPACE__); + var_dump(__NAMESPACE__); include __DIR__ . '/ns_069.inc'; - var_dump((binary)__NAMESPACE__); + var_dump(__NAMESPACE__); } } diff --git a/Zend/tests/ns_076.phpt b/Zend/tests/ns_076.phpt index 1468654d55..ea97e924b1 100644 --- a/Zend/tests/ns_076.phpt +++ b/Zend/tests/ns_076.phpt @@ -11,11 +11,11 @@ echo "\n"; var_dump($a); echo \unknown; --EXPECTF-- -Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d +Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d -Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d +Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d -Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d +Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d unknown array(1) { ["unknown"]=> diff --git a/Zend/tests/ns_080.phpt b/Zend/tests/ns_080.phpt index ce0ac07e7f..9c81c0d4c8 100644 --- a/Zend/tests/ns_080.phpt +++ b/Zend/tests/ns_080.phpt @@ -12,4 +12,4 @@ echo "should not echo\n"; ?> ===DONE=== --EXPECT-- -hi +hi
\ No newline at end of file diff --git a/Zend/tests/ns_082.phpt b/Zend/tests/ns_082.phpt index 7fa770576e..3220974047 100644 --- a/Zend/tests/ns_082.phpt +++ b/Zend/tests/ns_082.phpt @@ -9,4 +9,4 @@ echo "ok\n"; } ?> --EXPECT-- -ok +ok
\ No newline at end of file diff --git a/Zend/tests/ns_085.phpt b/Zend/tests/ns_085.phpt index 7755d809e3..377da6a8dc 100644 --- a/Zend/tests/ns_085.phpt +++ b/Zend/tests/ns_085.phpt @@ -24,4 +24,4 @@ foo::__construct foo\bar::__construct foo\bar::__construct foo::__construct -===DONE=== +===DONE===
\ No newline at end of file diff --git a/Zend/tests/ns_086.phpt b/Zend/tests/ns_086.phpt index ed4b8a238c..00657f6bde 100644 --- a/Zend/tests/ns_086.phpt +++ b/Zend/tests/ns_086.phpt @@ -33,4 +33,4 @@ foo::__construct foo\bar::__construct foo\bar::__construct foo::__construct -===DONE=== +===DONE===
\ No newline at end of file diff --git a/Zend/tests/ns_088.phpt b/Zend/tests/ns_088.phpt index 7af8dcc8d3..18210da6df 100644 --- a/Zend/tests/ns_088.phpt +++ b/Zend/tests/ns_088.phpt @@ -14,4 +14,4 @@ namespace Fiz\Biz\Buz { } ?> --EXPECTF-- -Parse error: syntax error, unexpected '{', expecting ',' or '}' in %sns_088.php on line 5 +Parse error: syntax error, unexpected '{', expecting '}' in %sns_088.php on line 5 diff --git a/Zend/tests/ns_089.phpt b/Zend/tests/ns_089.phpt index 8408dd00c1..c752eafb34 100644 --- a/Zend/tests/ns_089.phpt +++ b/Zend/tests/ns_089.phpt @@ -42,6 +42,7 @@ namespace Fiz\Biz\Buz { var_dump(BOZ); var_dump(BAR); } + --EXPECTF-- Foo\Bar\Baz\A::__construct Foo\Bar\Baz\B::__construct diff --git a/Zend/tests/ns_090.phpt b/Zend/tests/ns_090.phpt index c79dd4d5d7..608d3fcf8e 100644 --- a/Zend/tests/ns_090.phpt +++ b/Zend/tests/ns_090.phpt @@ -33,6 +33,7 @@ namespace Fiz\Biz\Buz { var_dump(BOZ); var_dump(BAR); } + --EXPECTF-- Foo\Bar\Baz\A::__construct Foo\Bar\Baz\B::__construct diff --git a/Zend/tests/ns_091.phpt b/Zend/tests/ns_091.phpt index fafd34afd7..b7eadeb10d 100644 --- a/Zend/tests/ns_091.phpt +++ b/Zend/tests/ns_091.phpt @@ -14,6 +14,7 @@ namespace Fiz\Biz\Buz { new A; new B; } + --EXPECTF-- Foo\Bar\A::__construct -Foo\Bar\Baz\B::__construct +Foo\Bar\Baz\B::__construct
\ No newline at end of file diff --git a/Zend/tests/ns_092.phpt b/Zend/tests/ns_092.phpt index 5618080022..21a1dd916a 100644 --- a/Zend/tests/ns_092.phpt +++ b/Zend/tests/ns_092.phpt @@ -47,6 +47,7 @@ namespace Fiz\Biz\Buz { boz(); A(); } + --EXPECTF-- ==== MIXED ==== Foo\Bar\A::__construct diff --git a/Zend/tests/ns_093.phpt b/Zend/tests/ns_093.phpt index 7ca7a035b3..e0b3e6a1d1 100644 --- a/Zend/tests/ns_093.phpt +++ b/Zend/tests/ns_093.phpt @@ -20,5 +20,8 @@ use Foo\Bar\ }; echo "\nDone\n"; + + --EXPECTF-- -Done + +Done
\ No newline at end of file diff --git a/Zend/tests/ns_094.phpt b/Zend/tests/ns_094.phpt index a67f823de5..f33bf560a9 100644 --- a/Zend/tests/ns_094.phpt +++ b/Zend/tests/ns_094.phpt @@ -10,5 +10,6 @@ use const Foo\Bar\{ const B, function C }; + --EXPECTF-- -Parse error: syntax error, unexpected 'const' (T_CONST), expecting identifier (T_STRING) in %s on line 7 +Parse error: syntax error, unexpected 'const' (T_CONST), expecting '}' in %s on line 7 diff --git a/Zend/tests/ns_095.phpt b/Zend/tests/ns_095.phpt index 90bfe80f2a..9c4496473d 100644 --- a/Zend/tests/ns_095.phpt +++ b/Zend/tests/ns_095.phpt @@ -37,6 +37,7 @@ namespace Baz { } ?> --EXPECTF-- + string(14) "Foo\Bar\ClassA" string(14) "Foo\Bar\ClassB" string(14) "Foo\Bar\ClassC" diff --git a/Zend/tests/ns_trailing_comma_01.phpt b/Zend/tests/ns_trailing_comma_01.phpt new file mode 100644 index 0000000000..cbd443f0f7 --- /dev/null +++ b/Zend/tests/ns_trailing_comma_01.phpt @@ -0,0 +1,30 @@ +--TEST-- +Mixed group use declaration can contain trailing comma +--FILE-- +<?php +namespace Foo { + const FOO_CONST = "Foo const\n"; + function foo_func() { + echo "Foo func\n"; + } + class FooClass { + function __construct() { + echo "Foo class\n"; + } + } +} +namespace { + use Foo\{ + const FOO_CONST, + function foo_func, + FooClass as BarClass, + }; + echo FOO_CONST; + foo_func(); + new BarClass; +} +?> +--EXPECT-- +Foo const +Foo func +Foo class diff --git a/Zend/tests/ns_trailing_comma_02.phpt b/Zend/tests/ns_trailing_comma_02.phpt new file mode 100644 index 0000000000..658a1734af --- /dev/null +++ b/Zend/tests/ns_trailing_comma_02.phpt @@ -0,0 +1,52 @@ +--TEST-- +Unmixed group use declaration can contain trailing comma +--FILE-- +<?php +namespace Foo { + const FOO_CONST_1 = "Foo const 1\n"; + const FOO_CONST_2 = "Foo const 2\n"; +} +namespace Bar { + function foo_func_1() { + echo "Bar func 1\n"; + } + function foo_func_2() { + echo "Bar func 2\n"; + } +} +namespace Baz { + class BazFooClass { + function __construct() { echo "BazFoo class\n"; } + } + class BazBarClass { + function __construct() { echo "BazBar class\n"; } + } +} +namespace { + use const Foo\{ + FOO_CONST_1, + FOO_CONST_2, + }; + use function Bar\{ + foo_func_1, + foo_func_2, + }; + use Baz\{ + BazFooClass, + BazBarClass, + }; + echo FOO_CONST_1; + echo FOO_CONST_2; + foo_func_1(); + foo_func_2(); + new BazFooClass; + new BazBarClass; +} +?> +--EXPECT-- +Foo const 1 +Foo const 2 +Bar func 1 +Bar func 2 +BazFoo class +BazBar class diff --git a/Zend/tests/ns_trailing_comma_error_01.phpt b/Zend/tests/ns_trailing_comma_error_01.phpt new file mode 100644 index 0000000000..6ada1f7bf2 --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_01.phpt @@ -0,0 +1,8 @@ +--TEST-- +Group use declarations mustn't be empty +--FILE-- +<?php +use Baz\{}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected '}', expecting identifier (T_STRING) or function (T_FUNCTION) or const (T_CONST) in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_02.phpt b/Zend/tests/ns_trailing_comma_error_02.phpt new file mode 100644 index 0000000000..c9d0d92dee --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_02.phpt @@ -0,0 +1,8 @@ +--TEST-- +Group use declarations mustn't contain just a comma +--FILE-- +<?php +use Baz\{,}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting identifier (T_STRING) or function (T_FUNCTION) or const (T_CONST) in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_03.phpt b/Zend/tests/ns_trailing_comma_error_03.phpt new file mode 100644 index 0000000000..9d10c47dcc --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_03.phpt @@ -0,0 +1,8 @@ +--TEST-- +Group use declarations mustn't allow more than one comma +--FILE-- +<?php +use Baz\{Foo,,}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting '}' in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_04.phpt b/Zend/tests/ns_trailing_comma_error_04.phpt new file mode 100644 index 0000000000..d04b1af272 --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_04.phpt @@ -0,0 +1,8 @@ +--TEST-- +Group use declarations mustn't begin with a comma +--FILE-- +<?php +use Baz\{,Foo}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting identifier (T_STRING) or function (T_FUNCTION) or const (T_CONST) in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_05.phpt b/Zend/tests/ns_trailing_comma_error_05.phpt new file mode 100644 index 0000000000..1d43e8fe32 --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_05.phpt @@ -0,0 +1,8 @@ +--TEST-- +Group use declarations mustn't contain two commas mid-list +--FILE-- +<?php +use Baz\{Foo,,Bar}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting '}' in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_06.phpt b/Zend/tests/ns_trailing_comma_error_06.phpt new file mode 100644 index 0000000000..2f2738e204 --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_06.phpt @@ -0,0 +1,8 @@ +--TEST-- +Unmixed group use declarations mustn't allow more than one comma +--FILE-- +<?php +use const Baz\{Foo,,}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting '}' in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_07.phpt b/Zend/tests/ns_trailing_comma_error_07.phpt new file mode 100644 index 0000000000..c60dd6a4b0 --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_07.phpt @@ -0,0 +1,8 @@ +--TEST-- +Unmixed group use declarations mustn't begin with a comma +--FILE-- +<?php +use function Baz\{,Foo}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting identifier (T_STRING) in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/ns_trailing_comma_error_08.phpt b/Zend/tests/ns_trailing_comma_error_08.phpt new file mode 100644 index 0000000000..b23446301d --- /dev/null +++ b/Zend/tests/ns_trailing_comma_error_08.phpt @@ -0,0 +1,8 @@ +--TEST-- +Unmixed group use declarations mustn't contain two commas mid-list +--FILE-- +<?php +use const Baz\{Foo,,Bar}; +?> +--EXPECTF-- +Parse error: syntax error, unexpected ',', expecting '}' in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/nullable_types/array.phpt b/Zend/tests/nullable_types/array.phpt index 6ee89b3962..7b0a2ed4d5 100644 --- a/Zend/tests/nullable_types/array.phpt +++ b/Zend/tests/nullable_types/array.phpt @@ -9,7 +9,9 @@ function _array_(?array $v): ?array { var_dump(_array_(null)); var_dump(_array_([])); + --EXPECT-- NULL array(0) { } + diff --git a/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt b/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt index a618ed2073..f4d1e315fc 100644 --- a/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt +++ b/Zend/tests/nullable_types/contravariant_nullable_param_succeeds.phpt @@ -1,5 +1,6 @@ --TEST-- Subtype can add nullability to a parameter (contravariance) + --FILE-- <?php @@ -13,4 +14,6 @@ class B implements A { $b = new B(); $b->method(null); + --EXPECT-- + diff --git a/Zend/tests/nullable_types/contravariant_nullable_return_fails.phpt b/Zend/tests/nullable_types/contravariant_nullable_return_fails.phpt index fe6ebc5654..c9be479ead 100644 --- a/Zend/tests/nullable_types/contravariant_nullable_return_fails.phpt +++ b/Zend/tests/nullable_types/contravariant_nullable_return_fails.phpt @@ -1,5 +1,6 @@ --TEST-- Return type cannot add nullability (contravariance) + --FILE-- <?php @@ -10,5 +11,7 @@ interface A { interface B extends A { function method(): ?int; } + --EXPECTF-- Fatal error: Declaration of B::method(): ?int must be compatible with A::method(): int in %s on line %d + diff --git a/Zend/tests/nullable_types/covariant_nullable_param_fails.phpt b/Zend/tests/nullable_types/covariant_nullable_param_fails.phpt index 015f540ac0..65b2858e6b 100644 --- a/Zend/tests/nullable_types/covariant_nullable_param_fails.phpt +++ b/Zend/tests/nullable_types/covariant_nullable_param_fails.phpt @@ -1,5 +1,6 @@ --TEST-- Subtype cannot remove nullable parameter (covariance) + --FILE-- <?php @@ -10,5 +11,7 @@ interface A { class B implements A { function method(int $p) { } } + --EXPECTF-- Fatal error: Declaration of B::method(int $p) must be compatible with A::method(?int $p) in %s on line %d + diff --git a/Zend/tests/nullable_types/covariant_nullable_return_succeds.phpt b/Zend/tests/nullable_types/covariant_nullable_return_succeds.phpt index 9251d3b4c1..5776f9b99d 100644 --- a/Zend/tests/nullable_types/covariant_nullable_return_succeds.phpt +++ b/Zend/tests/nullable_types/covariant_nullable_return_succeds.phpt @@ -1,5 +1,6 @@ --TEST-- Nullable covariant return types + --FILE-- <?php @@ -10,4 +11,6 @@ interface A { interface B extends A { function method(): int; } + --EXPECT-- + diff --git a/Zend/tests/nullable_types/float.phpt b/Zend/tests/nullable_types/float.phpt index 0c6602109f..8e44524cf0 100644 --- a/Zend/tests/nullable_types/float.phpt +++ b/Zend/tests/nullable_types/float.phpt @@ -9,6 +9,8 @@ function _float_(?float $v): ?float { var_dump(_float_(null)); var_dump(_float_(1.3)); + --EXPECT-- NULL float(1.3) + diff --git a/Zend/tests/nullable_types/int.phpt b/Zend/tests/nullable_types/int.phpt index b5bafb0956..ec75132edb 100644 --- a/Zend/tests/nullable_types/int.phpt +++ b/Zend/tests/nullable_types/int.phpt @@ -9,6 +9,8 @@ function _int_(?int $v): ?int { var_dump(_int_(null)); var_dump(_int_(1)); + --EXPECT-- NULL int(1) + diff --git a/Zend/tests/nullable_types/invariant_param_and_return_succeeds.phpt b/Zend/tests/nullable_types/invariant_param_and_return_succeeds.phpt index 6ddad67bb8..0542e52c0f 100644 --- a/Zend/tests/nullable_types/invariant_param_and_return_succeeds.phpt +++ b/Zend/tests/nullable_types/invariant_param_and_return_succeeds.phpt @@ -1,5 +1,6 @@ --TEST-- Invariant parameter and return types work with nullable types + --FILE-- <?php @@ -16,6 +17,8 @@ class B implements A { $b = new B(); var_dump($b->method(null)); var_dump($b->method(1)); + --EXPECT-- NULL int(1) + diff --git a/Zend/tests/nullable_types/nullable_type_parameters_do_not_have_default_value.phpt b/Zend/tests/nullable_types/nullable_type_parameters_do_not_have_default_value.phpt index 95442b96b4..3050feed53 100644 --- a/Zend/tests/nullable_types/nullable_type_parameters_do_not_have_default_value.phpt +++ b/Zend/tests/nullable_types/nullable_type_parameters_do_not_have_default_value.phpt @@ -1,14 +1,17 @@ --TEST-- Explicit nullable types do not imply a default value + --FILE-- <?php function f(?callable $p) {} f(); + --EXPECTF-- Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d Stack trace: #%d %s #%d %s thrown in %s on line %d + diff --git a/Zend/tests/nullable_types/string.phpt b/Zend/tests/nullable_types/string.phpt index ab469af808..ffc6591b6b 100644 --- a/Zend/tests/nullable_types/string.phpt +++ b/Zend/tests/nullable_types/string.phpt @@ -9,6 +9,8 @@ function _string_(?string $v): ?string { var_dump(_string_(null)); var_dump(_string_("php")); + --EXPECT-- NULL string(3) "php" + diff --git a/Zend/tests/numeric_string_errors.phpt b/Zend/tests/numeric_string_errors.phpt index 15dcd04461..e98c58dda7 100644 --- a/Zend/tests/numeric_string_errors.phpt +++ b/Zend/tests/numeric_string_errors.phpt @@ -52,6 +52,7 @@ var_dump(-"151 velit"); var_dump(-"esse"); ?> --EXPECTF-- + Notice: A non well formed numeric value encountered in %s on line %d Notice: A non well formed numeric value encountered in %s on line %d diff --git a/Zend/tests/numeric_string_errors_assign.phpt b/Zend/tests/numeric_string_errors_assign.phpt index b13a7ec717..31cc8a3631 100644 --- a/Zend/tests/numeric_string_errors_assign.phpt +++ b/Zend/tests/numeric_string_errors_assign.phpt @@ -107,6 +107,7 @@ $a ^= "reprehenderit"; var_dump($a); ?> --EXPECTF-- + Notice: A non well formed numeric value encountered in %s on line %d Notice: A non well formed numeric value encountered in %s on line %d diff --git a/Zend/tests/object_array_cast.phpt b/Zend/tests/object_array_cast.phpt index 1cf3dbbd9c..b1c12b579d 100644 --- a/Zend/tests/object_array_cast.phpt +++ b/Zend/tests/object_array_cast.phpt @@ -14,11 +14,11 @@ var_dump($obj); ?> --EXPECT-- object(stdClass)#1 (3) { - [0]=> + ["0"]=> int(1) - [1]=> + ["1"]=> int(2) - [2]=> + ["2"]=> int(3) } array(3) { @@ -38,10 +38,10 @@ array(3) { int(3) } object(stdClass)#1 (3) { - [0]=> + ["0"]=> int(1) - [1]=> + ["1"]=> int(2) - [2]=> + ["2"]=> int(3) } diff --git a/Zend/tests/object_types/invalid_default_value.phpt b/Zend/tests/object_types/invalid_default_value.phpt new file mode 100644 index 0000000000..2768e00e7d --- /dev/null +++ b/Zend/tests/object_types/invalid_default_value.phpt @@ -0,0 +1,10 @@ +--TEST-- +Object type can only default to null +--FILE-- +<?php + +function test(object $obj = 42) { } + +?> +--EXPECTF-- +Fatal error: Default value for parameters with an object type can only be NULL in %s on line %d diff --git a/Zend/tests/object_types/missing_return_type_inheritance_in_class.phpt b/Zend/tests/object_types/missing_return_type_inheritance_in_class.phpt new file mode 100644 index 0000000000..138ae1f5b5 --- /dev/null +++ b/Zend/tests/object_types/missing_return_type_inheritance_in_class.phpt @@ -0,0 +1,15 @@ +--TEST-- +Missing class method a object return type during inheritance +--FILE-- +<?php + +class One { + public function a() : object {} +} + +class Two extends One { + public function a() {} +} + +--EXPECTF-- +Fatal error: Declaration of Two::a() must be compatible with One::a(): object in %s on line 9
\ No newline at end of file diff --git a/Zend/tests/object_types/missing_return_type_inheritance_in_interface.phpt b/Zend/tests/object_types/missing_return_type_inheritance_in_interface.phpt new file mode 100644 index 0000000000..af9032949c --- /dev/null +++ b/Zend/tests/object_types/missing_return_type_inheritance_in_interface.phpt @@ -0,0 +1,15 @@ +--TEST-- +Missing interface method a object return type during inheritance +--FILE-- +<?php + +interface One { + public function a() : object; +} + +interface Two extends One { + public function a(); +} + +--EXPECTF-- +Fatal error: Declaration of Two::a() must be compatible with One::a(): object in %s on line %d diff --git a/Zend/tests/object_types/return_type_in_class.phpt b/Zend/tests/object_types/return_type_in_class.phpt new file mode 100644 index 0000000000..2d0f771106 --- /dev/null +++ b/Zend/tests/object_types/return_type_in_class.phpt @@ -0,0 +1,26 @@ +--TEST-- +Adding a class method object return type +--FILE-- +<?php + +interface One { + public function a() : object; +} + +class Two implements One { + public function a() : object {} +} + +$three = new class extends Two { + public function a() : object { + return 12345; + } +}; +$three->a(); +--EXPECTF-- + +Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, integer returned in %s:13 +Stack trace: +#0 %s(16): class@anonymous->a() +#1 {main} + thrown in %s on line 13 diff --git a/Zend/tests/object_types/return_type_in_function.phpt b/Zend/tests/object_types/return_type_in_function.phpt new file mode 100644 index 0000000000..e8ae75f490 --- /dev/null +++ b/Zend/tests/object_types/return_type_in_function.phpt @@ -0,0 +1,16 @@ +--TEST-- +Adding a function object return type +--FILE-- +<?php + +function a() : object { + return 12345; +} +a(); +--EXPECTF-- + +Fatal error: Uncaught TypeError: Return value of a() must be an object, integer returned in %s:4 +Stack trace: +#0 %s(6): a() +#1 {main} + thrown in %s on line 4
\ No newline at end of file diff --git a/Zend/tests/object_types/return_type_inheritance_in_class.phpt b/Zend/tests/object_types/return_type_inheritance_in_class.phpt new file mode 100644 index 0000000000..826758f326 --- /dev/null +++ b/Zend/tests/object_types/return_type_inheritance_in_class.phpt @@ -0,0 +1,26 @@ +--TEST-- +Adding class method a object return type during inheritance is allowed +--FILE-- +<?php + +class One { + public function a() {} +} + +class Two extends One { + public function a() : object {} +} + +$three = new class extends Two { + public function a() : object { + return 12345; + } +}; +$three->a(); + +--EXPECTF-- +Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, integer returned in %s:13 +Stack trace: +#0 %s(16): class@anonymous->a() +#1 {main} + thrown in %s on line 13 diff --git a/Zend/tests/object_types/return_type_inheritance_in_interface.phpt b/Zend/tests/object_types/return_type_inheritance_in_interface.phpt new file mode 100644 index 0000000000..fe1f6e6c0c --- /dev/null +++ b/Zend/tests/object_types/return_type_inheritance_in_interface.phpt @@ -0,0 +1,26 @@ +--TEST-- +Adding interface method a object return type during inheritance is allowed +--FILE-- +<?php + +interface One { + public function a(); +} + +interface Two extends One { + public function a() : object; +} + +$three = new class implements Two { + public function a() : object { + return 12345; + } +}; +$three->a(); + +--EXPECTF-- +Fatal error: Uncaught TypeError: Return value of class@anonymous::a() must be an object, integer returned in %s:13 +Stack trace: +#0 %s(16): class@anonymous->a() +#1 {main} + thrown in %s on line 13 diff --git a/Zend/tests/object_types/return_type_reflection.phpt b/Zend/tests/object_types/return_type_reflection.phpt new file mode 100644 index 0000000000..461199febe --- /dev/null +++ b/Zend/tests/object_types/return_type_reflection.phpt @@ -0,0 +1,31 @@ +--TEST-- +Reflecting object return type +--FILE-- +<?php + +interface One { + public function a() : object; +} + +class Two implements One { + public function a() : object {} +} + +function a() : object {} + +$returnTypeOne = (new ReflectionClass(One::class))->getMethod('a')->getReturnType(); +var_dump($returnTypeOne->isBuiltin(), (string)$returnTypeOne); + +$returnTypeTwo = (new ReflectionClass(Two::class))->getMethod('a')->getReturnType(); +var_dump($returnTypeTwo->isBuiltin(), (string)$returnTypeTwo); + +$returnTypea = (new ReflectionFunction('a'))->getReturnType(); +var_dump($returnTypea->isBuiltin(), (string)$returnTypea); + +--EXPECTF-- +bool(true) +string(6) "object" +bool(true) +string(6) "object" +bool(true) +string(6) "object"
\ No newline at end of file diff --git a/Zend/tests/object_types/type_hint_in_class_method.phpt b/Zend/tests/object_types/type_hint_in_class_method.phpt new file mode 100644 index 0000000000..e41caa0e70 --- /dev/null +++ b/Zend/tests/object_types/type_hint_in_class_method.phpt @@ -0,0 +1,19 @@ +--TEST-- +Adding a class method object type hint +--FILE-- +<?php + +class One { + public function a(object $obj) {} +} + +$one = new One(); +$one->a(new One()); +$one->a(123); +--EXPECTF-- + +Fatal error: Uncaught TypeError: Argument 1 passed to One::a() must be an object, integer given, called in %s:4 +Stack trace: +#0 %s(9): One->a(123) +#1 {main} + thrown in %s on line 4
\ No newline at end of file diff --git a/Zend/tests/object_types/type_hint_in_function.phpt b/Zend/tests/object_types/type_hint_in_function.phpt new file mode 100644 index 0000000000..917726ce2e --- /dev/null +++ b/Zend/tests/object_types/type_hint_in_function.phpt @@ -0,0 +1,17 @@ +--TEST-- +Adding a function object type hint +--FILE-- +<?php + +class A {} +function a(object $obj) {} + +a(new A()); +a(123); +--EXPECTF-- + +Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an object, integer given, called in %s.php on line 7 and defined in %s:4 +Stack trace: +#0 %s(7): a(123) +#1 {main} + thrown in %s on line 4
\ No newline at end of file diff --git a/Zend/tests/object_types/type_hint_reflection.phpt b/Zend/tests/object_types/type_hint_reflection.phpt new file mode 100644 index 0000000000..8968e35d6c --- /dev/null +++ b/Zend/tests/object_types/type_hint_reflection.phpt @@ -0,0 +1,31 @@ +--TEST-- +Reflecting object type hint +--FILE-- +<?php + +interface One { + public function a(object $obj); +} + +class Two implements One { + public function a(object $obj) {} +} + +function a(object $obj) {} + +$typeHintOne = (new ReflectionClass(One::class))->getMethod('a')->getParameters()[0]->getType(); +var_dump($typeHintOne->isBuiltin(), (string)$typeHintOne); + +$typeHintTwo = (new ReflectionClass(Two::class))->getMethod('a')->getParameters()[0]->getType(); +var_dump($typeHintTwo->isBuiltin(), (string)$typeHintTwo); + +$typeHinta = (new ReflectionFunction('a'))->getParameters()[0]->getType(); +var_dump($typeHinta->isBuiltin(), (string)$typeHinta); + +--EXPECTF-- +bool(true) +string(6) "object" +bool(true) +string(6) "object" +bool(true) +string(6) "object"
\ No newline at end of file diff --git a/Zend/tests/objects_009.phpt b/Zend/tests/objects_009.phpt index 4fcccf93e6..3c91b22742 100644 --- a/Zend/tests/objects_009.phpt +++ b/Zend/tests/objects_009.phpt @@ -19,6 +19,5 @@ class test3 extends test { echo "Done\n"; ?> ---EXPECTF-- -Warning: Declaration of test3::foo($arg) should be compatible with test::foo(Test $arg) in %s on line %d +--EXPECT-- Done diff --git a/Zend/tests/objects_024.phpt b/Zend/tests/objects_024.phpt index 50659f1604..cbdb1cc202 100644 --- a/Zend/tests/objects_024.phpt +++ b/Zend/tests/objects_024.phpt @@ -50,3 +50,4 @@ object(foo)#%d (0) { int(3) object(foo)#%d (0) { } + diff --git a/Zend/tests/objects_027.phpt b/Zend/tests/objects_027.phpt index 6ee7d5a491..1a13f2de0a 100644 --- a/Zend/tests/objects_027.phpt +++ b/Zend/tests/objects_027.phpt @@ -40,3 +40,5 @@ Deprecated: %son-static method foo::test() should not be called statically in %s Deprecated: Non-static method bar::show() should not be called statically in %s on line %d object(foo)#%d (0) { } + + diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt index 3ad48e7412..f7cb81bb20 100644 --- a/Zend/tests/offset_string.phpt +++ b/Zend/tests/offset_string.phpt @@ -62,4 +62,4 @@ string(1) "%s" Warning: Illegal offset type in %s on line %d string(1) "i" -Done +Done
\ No newline at end of file diff --git a/Zend/tests/overloaded_func_001.phpt b/Zend/tests/overloaded_func_001.phpt index 2702772a46..0b7360e8f9 100644 --- a/Zend/tests/overloaded_func_001.phpt +++ b/Zend/tests/overloaded_func_001.phpt @@ -2,7 +2,7 @@ Overloaded function 001 --SKIPIF-- <?php -if (!PHP_DEBUG) die("skip only run in debug version"); +if (!class_exists('_ZendTestClass')) die("skip needs class with overloaded function"); ?> --FILE-- <?php diff --git a/Zend/tests/overloaded_func_002.phpt b/Zend/tests/overloaded_func_002.phpt index 6c16965919..2762f41840 100644 --- a/Zend/tests/overloaded_func_002.phpt +++ b/Zend/tests/overloaded_func_002.phpt @@ -2,7 +2,7 @@ Overloaded function 002 --SKIPIF-- <?php -if (!PHP_DEBUG) die("skip only run in debug version"); +if (!class_exists('_ZendTestClass')) die("skip needs class with overloaded function"); ?> --FILE-- <?php diff --git a/Zend/tests/parent_class_name_without_parent.phpt b/Zend/tests/parent_class_name_without_parent.phpt index 033b5ad4ec..622aefeab0 100644 --- a/Zend/tests/parent_class_name_without_parent.phpt +++ b/Zend/tests/parent_class_name_without_parent.phpt @@ -22,3 +22,4 @@ Stack trace: #0 %s(%d): C->f() #1 {main} thrown in %s on line 5 + diff --git a/Zend/tests/parse_str_with_unpack.phpt b/Zend/tests/parse_str_with_unpack.phpt index 50b296d710..8daa711374 100644 --- a/Zend/tests/parse_str_with_unpack.phpt +++ b/Zend/tests/parse_str_with_unpack.phpt @@ -11,5 +11,6 @@ function test() { test(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d int(42) diff --git a/Zend/tests/php_errormsg_misoptimization.phpt b/Zend/tests/php_errormsg_misoptimization.phpt index c121c1021a..ae389db248 100644 --- a/Zend/tests/php_errormsg_misoptimization.phpt +++ b/Zend/tests/php_errormsg_misoptimization.phpt @@ -14,6 +14,8 @@ test(); ?> --EXPECTF-- +Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 + Notice: Undefined variable: undef in %s on line %d Warning: A non-numeric value encountered in %s on line %d diff --git a/Zend/tests/result_unused.phpt b/Zend/tests/result_unused.phpt index 12892e8415..0db744d089 100644 --- a/Zend/tests/result_unused.phpt +++ b/Zend/tests/result_unused.phpt @@ -26,3 +26,4 @@ echo "ok\n"; --EXPECTF-- Notice: Uninitialized string offset: 3 in %sresult_unused.php on line %d ok + diff --git a/Zend/tests/return_types/001.phpt b/Zend/tests/return_types/001.phpt index 2b87a562f6..13bf93f4df 100644 --- a/Zend/tests/return_types/001.phpt +++ b/Zend/tests/return_types/001.phpt @@ -1,11 +1,13 @@ --TEST-- Returned nothing, expected array + --FILE-- <?php function test1() : array { } test1(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, none returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/002.phpt b/Zend/tests/return_types/002.phpt index 615317cf83..5921634553 100644 --- a/Zend/tests/return_types/002.phpt +++ b/Zend/tests/return_types/002.phpt @@ -1,5 +1,6 @@ --TEST-- Returned null, expected array + --FILE-- <?php function test1() : array { @@ -7,6 +8,7 @@ function test1() : array { } test1(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, null returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/003.phpt b/Zend/tests/return_types/003.phpt index 676d668cb8..e12e215de2 100644 --- a/Zend/tests/return_types/003.phpt +++ b/Zend/tests/return_types/003.phpt @@ -1,11 +1,13 @@ --TEST-- Returned 1, expected array + --FILE-- <?php function test1() : array { return 1; } test1(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, integer returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/004.phpt b/Zend/tests/return_types/004.phpt index 6098d51334..7865eb9d4d 100644 --- a/Zend/tests/return_types/004.phpt +++ b/Zend/tests/return_types/004.phpt @@ -1,5 +1,6 @@ --TEST-- Returned string, expected array + --FILE-- <?php function test1() : array { @@ -7,6 +8,7 @@ function test1() : array { } test1(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, string returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/005.phpt b/Zend/tests/return_types/005.phpt index f8d666fae5..a114b3ee93 100644 --- a/Zend/tests/return_types/005.phpt +++ b/Zend/tests/return_types/005.phpt @@ -1,5 +1,6 @@ --TEST-- Return value fails inheritance check in method + --FILE-- <?php class foo {} @@ -12,6 +13,7 @@ class qux { $qux = new qux(); $qux->foo(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of qux::foo() must be an instance of foo, instance of qux returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/006.phpt b/Zend/tests/return_types/006.phpt index a4fcea1d25..359b25a28d 100644 --- a/Zend/tests/return_types/006.phpt +++ b/Zend/tests/return_types/006.phpt @@ -1,5 +1,6 @@ --TEST-- Return type allowed in child when parent does not have return type + --FILE-- <?php class Comment {} @@ -14,6 +15,7 @@ $comments = new CommentsIterator([new Comment]); foreach ($comments as $comment) { var_dump($comment); } + --EXPECTF-- object(Comment)#%d (%d) { } diff --git a/Zend/tests/return_types/007.phpt b/Zend/tests/return_types/007.phpt index 21f7023518..0bbfb9fbba 100644 --- a/Zend/tests/return_types/007.phpt +++ b/Zend/tests/return_types/007.phpt @@ -1,5 +1,6 @@ --TEST-- Return value is subclass of return type + --FILE-- <?php class foo {} @@ -12,6 +13,7 @@ class qux extends foo { $qux = new qux(); var_dump($qux->foo()); + --EXPECTF-- object(qux)#%d (%d) { } diff --git a/Zend/tests/return_types/008.phpt b/Zend/tests/return_types/008.phpt index f2e01299de..47343d0564 100644 --- a/Zend/tests/return_types/008.phpt +++ b/Zend/tests/return_types/008.phpt @@ -1,5 +1,6 @@ --TEST-- Return type covariance in interface implementation + --FILE-- <?php interface foo { @@ -15,5 +16,6 @@ class qux implements foo { $qux = new qux(); var_dump($qux->bar()); + --EXPECTF-- Fatal error: Declaration of qux::bar(): qux must be compatible with foo::bar(): foo in %s008.php on line 7 diff --git a/Zend/tests/return_types/009.phpt b/Zend/tests/return_types/009.phpt index 7eda8ce27b..b83703ede5 100644 --- a/Zend/tests/return_types/009.phpt +++ b/Zend/tests/return_types/009.phpt @@ -1,5 +1,6 @@ --TEST-- Return type covariance error + --FILE-- <?php interface foo { @@ -13,5 +14,6 @@ class qux implements foo { return $this; } } + --EXPECTF-- Fatal error: Declaration of qux::bar(): biz must be compatible with foo::bar(): foo in %s on line %d diff --git a/Zend/tests/return_types/010.phpt b/Zend/tests/return_types/010.phpt index 2cfe97dac2..1a117d0cbc 100644 --- a/Zend/tests/return_types/010.phpt +++ b/Zend/tests/return_types/010.phpt @@ -1,5 +1,6 @@ --TEST-- Returned null, expected array reference + --FILE-- <?php function &foo(array &$in) : array { @@ -8,6 +9,7 @@ function &foo(array &$in) : array { $array = [1, 2, 3]; var_dump(foo($array)); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, null returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/011.phpt b/Zend/tests/return_types/011.phpt index 23dbc1cfdb..f3b000a706 100644 --- a/Zend/tests/return_types/011.phpt +++ b/Zend/tests/return_types/011.phpt @@ -1,5 +1,6 @@ --TEST-- Function returned callable, expected callable + --FILE-- <?php function foo() : callable { @@ -7,6 +8,7 @@ function foo() : callable { } var_dump(foo()); + --EXPECTF-- object(Closure)#%d (%d) { } diff --git a/Zend/tests/return_types/012.phpt b/Zend/tests/return_types/012.phpt index b4c02a8ec1..39fa8e0ec6 100644 --- a/Zend/tests/return_types/012.phpt +++ b/Zend/tests/return_types/012.phpt @@ -1,5 +1,6 @@ --TEST-- Method returned callable, expected callable + --FILE-- <?php class foo { @@ -13,6 +14,7 @@ class foo { $baz = new foo(); var_dump($baz->bar()); + --EXPECT-- object(Closure)#2 (2) { ["static"]=> diff --git a/Zend/tests/return_types/013.phpt b/Zend/tests/return_types/013.phpt index 5b2c06748d..673a8f9dbc 100644 --- a/Zend/tests/return_types/013.phpt +++ b/Zend/tests/return_types/013.phpt @@ -1,5 +1,6 @@ --TEST-- Closure inside method returned null, expected array + --FILE-- <?php class foo { @@ -13,6 +14,7 @@ class foo { $baz = new foo(); var_dump($func=$baz->bar(), $func()); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of foo::{closure}() must be of the type array, null returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/014.phpt b/Zend/tests/return_types/014.phpt index 468979d5d9..abf8b1210b 100644 --- a/Zend/tests/return_types/014.phpt +++ b/Zend/tests/return_types/014.phpt @@ -1,10 +1,12 @@ --TEST-- Constructors cannot declare a return type + --FILE-- <?php class Foo { function __construct() : Foo {} } + --EXPECTF-- Fatal error: Constructor %s::%s() cannot declare a return type in %s on line %s diff --git a/Zend/tests/return_types/015.phpt b/Zend/tests/return_types/015.phpt index 973956b6bc..1c2cd564ff 100644 --- a/Zend/tests/return_types/015.phpt +++ b/Zend/tests/return_types/015.phpt @@ -1,5 +1,6 @@ --TEST-- Return types allowed in namespace + --FILE-- <?php @@ -17,6 +18,7 @@ class Vector implements Collection { $v = new Vector; var_dump($v->values()); + --EXPECTF-- object(Collections\Vector)#%d (%d) { } diff --git a/Zend/tests/return_types/016.phpt b/Zend/tests/return_types/016.phpt index cf31d96e6b..f3636751c1 100644 --- a/Zend/tests/return_types/016.phpt +++ b/Zend/tests/return_types/016.phpt @@ -1,5 +1,6 @@ --TEST-- Fully qualified classes are allowed in return types + --FILE-- <?php @@ -13,6 +14,7 @@ class Foo { $foo = new Foo; var_dump($foo->foo(new \EmptyIterator())); + --EXPECTF-- object(EmptyIterator)#%d (0) { } diff --git a/Zend/tests/return_types/017.phpt b/Zend/tests/return_types/017.phpt index d45cb55d45..d44b26fc04 100644 --- a/Zend/tests/return_types/017.phpt +++ b/Zend/tests/return_types/017.phpt @@ -1,5 +1,6 @@ --TEST-- Fully qualified classes in trait return types + --FILE-- <?php @@ -17,6 +18,7 @@ class Foo { $foo = new Foo; var_dump($foo->foo([])); + --EXPECTF-- object(EmptyIterator)#%d (%d) { } diff --git a/Zend/tests/return_types/018.phpt b/Zend/tests/return_types/018.phpt index 4e93e70ea1..6d6e0c7e73 100644 --- a/Zend/tests/return_types/018.phpt +++ b/Zend/tests/return_types/018.phpt @@ -1,10 +1,12 @@ --TEST-- Destructors cannot declare a return type + --FILE-- <?php class Foo { function __destruct() : Foo {} } + --EXPECTF-- Fatal error: Destructor %s::%s() cannot declare a return type in %s on line %s diff --git a/Zend/tests/return_types/019.phpt b/Zend/tests/return_types/019.phpt index f665ebde78..cebf483285 100644 --- a/Zend/tests/return_types/019.phpt +++ b/Zend/tests/return_types/019.phpt @@ -1,10 +1,12 @@ --TEST-- __clone cannot declare a return type + --FILE-- <?php class Foo { function __clone() : Foo {} } + --EXPECTF-- Fatal error: %s::%s() cannot declare a return type in %s on line %s diff --git a/Zend/tests/return_types/020.phpt b/Zend/tests/return_types/020.phpt index 57c93a8dcd..101de62dd7 100644 --- a/Zend/tests/return_types/020.phpt +++ b/Zend/tests/return_types/020.phpt @@ -1,5 +1,6 @@ --TEST-- Exception thrown from function with return type + --FILE-- <?php function test() : array { @@ -7,6 +8,7 @@ function test() : array { } test(); + --EXPECTF-- Fatal error: Uncaught Exception in %s:%d Stack trace: diff --git a/Zend/tests/return_types/021.phpt b/Zend/tests/return_types/021.phpt index bd37df68f3..051f7dce69 100644 --- a/Zend/tests/return_types/021.phpt +++ b/Zend/tests/return_types/021.phpt @@ -1,5 +1,6 @@ --TEST-- Return type allows self + --FILE-- <?php class Foo { @@ -12,6 +13,7 @@ class Bar extends Foo {} var_dump(Foo::getInstance()); var_dump(Bar::getInstance()); + --EXPECTF-- object(Foo)#%d (%d) { } diff --git a/Zend/tests/return_types/022.phpt b/Zend/tests/return_types/022.phpt index cf5bb4f672..47cbb791df 100644 --- a/Zend/tests/return_types/022.phpt +++ b/Zend/tests/return_types/022.phpt @@ -1,5 +1,6 @@ --TEST-- Hint on closure with lexical vars + --FILE-- <?php $foo = "bar"; @@ -11,5 +12,6 @@ $test = function() use($foo) : Closure { $callable = $test(); var_dump($callable()); + --EXPECTF-- string(3) "bar" diff --git a/Zend/tests/return_types/023.phpt b/Zend/tests/return_types/023.phpt index 70202bce58..9e36bf7c04 100644 --- a/Zend/tests/return_types/023.phpt +++ b/Zend/tests/return_types/023.phpt @@ -1,11 +1,13 @@ --TEST-- PHP 4 Constructors cannot declare a return type + --FILE-- <?php class Foo { function foo() : Foo {} } + --EXPECTF-- Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in %s on line %d diff --git a/Zend/tests/return_types/024.phpt b/Zend/tests/return_types/024.phpt index 45c8162335..0579973fbc 100644 --- a/Zend/tests/return_types/024.phpt +++ b/Zend/tests/return_types/024.phpt @@ -1,8 +1,10 @@ --TEST-- Return type of self is not allowed in function + --FILE-- <?php function test(): self {} + --EXPECTF-- Fatal error: Cannot use "self" when no class scope is active in %s on line 3 diff --git a/Zend/tests/return_types/025.phpt b/Zend/tests/return_types/025.phpt index c9f0ffef4a..148971250a 100644 --- a/Zend/tests/return_types/025.phpt +++ b/Zend/tests/return_types/025.phpt @@ -1,11 +1,13 @@ --TEST-- Return type of self is allowed in closure + --FILE-- <?php $c = function(): self { return $this; }; class Bar { } var_dump($c->call(new Bar)); + --EXPECT-- object(Bar)#2 (0) { } diff --git a/Zend/tests/return_types/026.phpt b/Zend/tests/return_types/026.phpt index f08c527512..5693e95c7e 100644 --- a/Zend/tests/return_types/026.phpt +++ b/Zend/tests/return_types/026.phpt @@ -4,5 +4,6 @@ Return type of parent is not allowed in function <?php function test(): parent {} + --EXPECTF-- Fatal error: Cannot use "parent" when no class scope is active in %s on line %d diff --git a/Zend/tests/return_types/027.phpt b/Zend/tests/return_types/027.phpt index 33a9c7f94d..a5d2c321bf 100644 --- a/Zend/tests/return_types/027.phpt +++ b/Zend/tests/return_types/027.phpt @@ -8,6 +8,7 @@ class B extends A {} $c = function(parent $x): parent { return $x; }; var_dump($c->bindTo(null, 'B')(new A)); + --EXPECTF-- object(A)#%d (0) { } diff --git a/Zend/tests/return_types/031.phpt b/Zend/tests/return_types/031.phpt index 6d0b71b23b..91ee2f8ce4 100644 --- a/Zend/tests/return_types/031.phpt +++ b/Zend/tests/return_types/031.phpt @@ -11,4 +11,4 @@ class B extends A { ?> DONE --EXPECTF-- -Fatal error: Declaration of B::foo(): ?int must be compatible with A::foo(): int in %s031.php on line 7 +Fatal error: Declaration of B::foo(): ?int must be compatible with A::foo(): int in %s031.php on line 7
\ No newline at end of file diff --git a/Zend/tests/return_types/generators001.phpt b/Zend/tests/return_types/generators001.phpt index 9f89d71102..f2ac88a7ad 100644 --- a/Zend/tests/return_types/generators001.phpt +++ b/Zend/tests/return_types/generators001.phpt @@ -1,5 +1,6 @@ --TEST-- Valid generator return types + --FILE-- <?php function test1() : Generator { @@ -19,6 +20,7 @@ var_dump( test2(), test3() ); + --EXPECTF-- object(Generator)#%d (%d) { } diff --git a/Zend/tests/return_types/generators002.phpt b/Zend/tests/return_types/generators002.phpt index 90bada714b..519c97a962 100644 --- a/Zend/tests/return_types/generators002.phpt +++ b/Zend/tests/return_types/generators002.phpt @@ -1,9 +1,11 @@ --TEST-- Generator return type must be Generator, Iterator or Traversable + --FILE-- <?php function test1() : StdClass { yield 1; } + --EXPECTF-- Fatal error: Generators may only declare a return type of Generator, Iterator, Traversable, or iterable, StdClass is not permitted in %s on line %d diff --git a/Zend/tests/return_types/generators003.phpt b/Zend/tests/return_types/generators003.phpt index 5502318e98..0ff2524f47 100644 --- a/Zend/tests/return_types/generators003.phpt +++ b/Zend/tests/return_types/generators003.phpt @@ -1,5 +1,6 @@ --TEST-- Return type covariance works with generators + --FILE-- <?php interface Collection extends IteratorAggregate { @@ -16,5 +17,6 @@ class SomeCollection implements Collection { $some = new SomeCollection(); var_dump($some->getIterator()); + --EXPECTF-- Fatal error: Declaration of SomeCollection::getIterator(): Generator must be compatible with Collection::getIterator(): Iterator in %sgenerators003.php on line 6 diff --git a/Zend/tests/return_types/generators004.phpt b/Zend/tests/return_types/generators004.phpt index 4e9aa07f42..74aa801638 100644 --- a/Zend/tests/return_types/generators004.phpt +++ b/Zend/tests/return_types/generators004.phpt @@ -1,5 +1,6 @@ --TEST-- Generator with return type does not fail with empty return + --FILE-- <?php @@ -11,5 +12,6 @@ $a = function(): \Iterator { foreach($a() as $value) { echo $value; } + --EXPECT-- 1 diff --git a/Zend/tests/return_types/generators005.phpt b/Zend/tests/return_types/generators005.phpt index a7e3bda042..21e6c4bef1 100644 --- a/Zend/tests/return_types/generators005.phpt +++ b/Zend/tests/return_types/generators005.phpt @@ -1,5 +1,6 @@ --TEST-- Return type covariance works with generators + --FILE-- <?php interface Collection extends IteratorAggregate { @@ -16,6 +17,7 @@ class SomeCollection implements Collection { $some = new SomeCollection(); var_dump($some->getIterator()); + --EXPECTF-- object(Generator)#%d (%d) { } diff --git a/Zend/tests/return_types/inheritance001.phpt b/Zend/tests/return_types/inheritance001.phpt index 5e154d0482..8e0523eb70 100644 --- a/Zend/tests/return_types/inheritance001.phpt +++ b/Zend/tests/return_types/inheritance001.phpt @@ -1,5 +1,6 @@ --TEST-- Return type covariance; extends class + --FILE-- <?php @@ -10,5 +11,6 @@ class A { class B extends A { function foo(): StdClass {} } + --EXPECTF-- Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d diff --git a/Zend/tests/return_types/inheritance002.phpt b/Zend/tests/return_types/inheritance002.phpt index bb00b7e243..8cb63b6fc8 100644 --- a/Zend/tests/return_types/inheritance002.phpt +++ b/Zend/tests/return_types/inheritance002.phpt @@ -1,5 +1,6 @@ --TEST-- Return type covariance; extends abstract class + --FILE-- <?php @@ -10,5 +11,6 @@ abstract class A { class B extends A { function foo(): StdClass {} } + --EXPECTF-- Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d diff --git a/Zend/tests/return_types/inheritance003.phpt b/Zend/tests/return_types/inheritance003.phpt index e8ebe90cd1..0b22dd55d4 100644 --- a/Zend/tests/return_types/inheritance003.phpt +++ b/Zend/tests/return_types/inheritance003.phpt @@ -1,5 +1,6 @@ --TEST-- Return type mismatch; implements interface + --FILE-- <?php @@ -10,5 +11,6 @@ interface A { class B implements A { function foo(): StdClass {} } + --EXPECTF-- Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d diff --git a/Zend/tests/return_types/inheritance004.phpt b/Zend/tests/return_types/inheritance004.phpt index 1c8d685a63..66d35564f7 100644 --- a/Zend/tests/return_types/inheritance004.phpt +++ b/Zend/tests/return_types/inheritance004.phpt @@ -1,5 +1,6 @@ --TEST-- Internal covariant return type of self + --FILE-- <?php class Foo { @@ -16,6 +17,7 @@ class Bar extends Foo { var_dump(Bar::test()); var_dump(Foo::test()); + --EXPECTF-- object(Bar)#%d (0) { } diff --git a/Zend/tests/return_types/inheritance005.phpt b/Zend/tests/return_types/inheritance005.phpt index 7415a72b9f..31e0e11dd8 100644 --- a/Zend/tests/return_types/inheritance005.phpt +++ b/Zend/tests/return_types/inheritance005.phpt @@ -1,5 +1,6 @@ --TEST-- Internal covariant return type of self + --FILE-- <?php class Foo { @@ -13,5 +14,6 @@ class Bar extends Foo { return new Bar; } } + --EXPECTF-- Fatal error: Declaration of Bar::test(): Bar must be compatible with Foo::test(): Foo in %sinheritance005.php on line 12 diff --git a/Zend/tests/return_types/inheritance006.phpt b/Zend/tests/return_types/inheritance006.phpt index 7d4bcbe57b..86c11aa57a 100644 --- a/Zend/tests/return_types/inheritance006.phpt +++ b/Zend/tests/return_types/inheritance006.phpt @@ -1,7 +1,9 @@ --TEST-- External covariant return type of self + --INI-- opcache.enable_cli=1 + --FILE-- <?php require __DIR__ . "/classes.php.inc"; @@ -17,5 +19,6 @@ class Bar extends Foo { return new B; } } + --EXPECTF-- Fatal error: Declaration of Bar::test(): B must be compatible with Foo::test(): A in %sinheritance006.php on line 14 diff --git a/Zend/tests/return_types/inheritance007.phpt b/Zend/tests/return_types/inheritance007.phpt index af1738f807..86d0bd9d69 100644 --- a/Zend/tests/return_types/inheritance007.phpt +++ b/Zend/tests/return_types/inheritance007.phpt @@ -1,7 +1,9 @@ --TEST-- Inheritance Hinting Compile Checking Failure Internal Classes + --INI-- opcache.enable_cli=1 + --FILE-- <?php class Foo { @@ -15,5 +17,6 @@ class Bar extends Foo { return new ArrayObject([1, 2]); } } + --EXPECTF-- Fatal error: Declaration of Bar::test(): ArrayObject must be compatible with Foo::test(): Traversable in %sinheritance007.php on line 12 diff --git a/Zend/tests/return_types/inheritance008.phpt b/Zend/tests/return_types/inheritance008.phpt index df353cda05..242c50dcf0 100644 --- a/Zend/tests/return_types/inheritance008.phpt +++ b/Zend/tests/return_types/inheritance008.phpt @@ -1,7 +1,9 @@ --TEST-- External covariant return type of self + --INI-- opcache.enable_cli=1 + --FILE-- <?php require __DIR__ . "/classes.php.inc"; @@ -20,6 +22,7 @@ class Bar extends Foo { var_dump(Bar::test()); var_dump(Foo::test()); + --EXPECTF-- object(B)#%d (0) { } diff --git a/Zend/tests/return_types/inheritance009.phpt b/Zend/tests/return_types/inheritance009.phpt index b7d5628e8d..382007e8f0 100644 --- a/Zend/tests/return_types/inheritance009.phpt +++ b/Zend/tests/return_types/inheritance009.phpt @@ -1,7 +1,9 @@ --TEST-- Inheritance Hinting Compile Checking Failure Internal Classes + --INI-- opcache.enable_cli=1 + --FILE-- <?php class Foo { @@ -18,6 +20,7 @@ class Bar extends Foo { var_dump(Bar::test()); var_dump(Foo::test()); + --EXPECTF-- object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> diff --git a/Zend/tests/return_types/internal_functions001.phpt b/Zend/tests/return_types/internal_functions001.phpt index 9be119361a..5dfd2784da 100644 --- a/Zend/tests/return_types/internal_functions001.phpt +++ b/Zend/tests/return_types/internal_functions001.phpt @@ -2,12 +2,13 @@ Return type for internal functions --SKIPIF-- <?php -if (!function_exists('zend_test_func')) { - print 'skip'; -} +if (!function_exists('zend_test_array_return')) die('skip'); +// Internal function return types are only checked in debug builds +if (!PHP_DEBUG) die('skip requires debug build'); +?> --FILE-- <?php -zend_test_func(); +zend_test_array_return(); ?> --EXPECTF-- -Fatal error: Return value of zend_test_func() must be of the type array, null returned in %s on line %d +Fatal error: Return value of zend_test_array_return() must be of the type array, null returned in %s on line %d diff --git a/Zend/tests/return_types/internal_functions002.phpt b/Zend/tests/return_types/internal_functions002.phpt index 177833717b..0daf3481c8 100644 --- a/Zend/tests/return_types/internal_functions002.phpt +++ b/Zend/tests/return_types/internal_functions002.phpt @@ -2,13 +2,11 @@ Return type for internal functions 2 --SKIPIF-- <?php -if (!function_exists('zend_test_func2')) { - print 'skip'; -} +if (!function_exists('zend_test_nullable_array_return')) die('skip'); --FILE-- <?php -zend_test_func2(); -echo "==DONE==\n" +zend_test_nullable_array_return(); ?> ---EXPECTF-- +==DONE== +--EXPECT-- ==DONE== diff --git a/Zend/tests/return_types/reflection001.phpt b/Zend/tests/return_types/reflection001.phpt index 6d5b894206..c95f7292b5 100644 --- a/Zend/tests/return_types/reflection001.phpt +++ b/Zend/tests/return_types/reflection001.phpt @@ -2,9 +2,8 @@ Return type and Reflection::export() --SKIPIF-- <?php -if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70000) { - print 'skip'; -} +if (!extension_loaded('reflection')) print 'skip'; +?> --FILE-- <?php @@ -42,3 +41,4 @@ Class [ <user> class A ] { } } } + diff --git a/Zend/tests/return_types/return_reference_separation.phpt b/Zend/tests/return_types/return_reference_separation.phpt index ae7312b591..2ec0939088 100644 --- a/Zend/tests/return_types/return_reference_separation.phpt +++ b/Zend/tests/return_types/return_reference_separation.phpt @@ -1,5 +1,6 @@ --TEST-- Return value separation + --FILE-- <?php function test1(&$abc) : string { @@ -30,4 +31,4 @@ int(123) string(3) "123" int(123) string(3) "123" -string(3) "123" +string(3) "123"
\ No newline at end of file diff --git a/Zend/tests/return_types/rfc001.phpt b/Zend/tests/return_types/rfc001.phpt index 6a17525b72..5a1d42b446 100644 --- a/Zend/tests/return_types/rfc001.phpt +++ b/Zend/tests/return_types/rfc001.phpt @@ -1,5 +1,6 @@ --TEST-- RFC example: returned type does not match the type declaration + --FILE-- <?php @@ -8,6 +9,7 @@ function get_config(): array { } get_config(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of get_config() must be of the type array, integer returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/rfc002.phpt b/Zend/tests/return_types/rfc002.phpt index d7c7d28fd0..2f3ff02b1c 100644 --- a/Zend/tests/return_types/rfc002.phpt +++ b/Zend/tests/return_types/rfc002.phpt @@ -1,5 +1,6 @@ --TEST-- RFC example: Scalar Types + --FILE-- <?php function answer(): int { @@ -7,5 +8,6 @@ function answer(): int { } var_dump(answer()); + --EXPECTF-- int(42) diff --git a/Zend/tests/return_types/rfc003.phpt b/Zend/tests/return_types/rfc003.phpt index 6b9cc81c69..ae4c5b7f60 100644 --- a/Zend/tests/return_types/rfc003.phpt +++ b/Zend/tests/return_types/rfc003.phpt @@ -1,5 +1,6 @@ --TEST-- RFC example: cannot return null with a return type declaration + --FILE-- <?php function foo(): DateTime { @@ -7,6 +8,7 @@ function foo(): DateTime { } foo(); + --EXPECTF-- Fatal error: Uncaught TypeError: Return value of foo() must be an instance of DateTime, null returned in %s:%d Stack trace: diff --git a/Zend/tests/return_types/rfc004.phpt b/Zend/tests/return_types/rfc004.phpt index ed40e41b09..654fb92321 100644 --- a/Zend/tests/return_types/rfc004.phpt +++ b/Zend/tests/return_types/rfc004.phpt @@ -1,5 +1,6 @@ --TEST-- RFC example: missing return type on override + --FILE-- <?php @@ -15,5 +16,6 @@ class UserGateway_MySql implements UserGateway { return new User; } } + --EXPECTF-- Fatal error: Declaration of UserGateway_MySql::find($id) must be compatible with UserGateway::find($id): User in %s on line 9 diff --git a/Zend/tests/self_in_eval.phpt b/Zend/tests/self_in_eval.phpt index efd81ad266..41c2654062 100644 --- a/Zend/tests/self_in_eval.phpt +++ b/Zend/tests/self_in_eval.phpt @@ -25,3 +25,4 @@ int(1) int(2) string(1) "C" string(1) "C" + diff --git a/Zend/tests/settype_object.phpt b/Zend/tests/settype_object.phpt Binary files differindex b4a0f596f8..be2694c312 100644 --- a/Zend/tests/settype_object.phpt +++ b/Zend/tests/settype_object.phpt diff --git a/Zend/tests/switch_on_numeric_strings.phpt b/Zend/tests/switch_on_numeric_strings.phpt new file mode 100644 index 0000000000..b436cefe41 --- /dev/null +++ b/Zend/tests/switch_on_numeric_strings.phpt @@ -0,0 +1,29 @@ +--TEST-- +Switch on numeric strings +--FILE-- +<?php + +function test($value) { + switch ($value) { + case "01": return "01"; + case "1": return "1"; + + case " 2": return " 2"; + case "2": return "2"; + + case "10.0": return "10.0"; + case "1e1": return "1e1"; + + default: return "default"; + } +} + +var_dump(test("1")); +var_dump(test("2")); +var_dump(test("1e1")); + +?> +--EXPECT-- +string(2) "01" +string(2) " 2" +string(4) "10.0" diff --git a/Zend/tests/temporary_cleaning_013.phpt b/Zend/tests/temporary_cleaning_013.phpt new file mode 100644 index 0000000000..34e4080f56 --- /dev/null +++ b/Zend/tests/temporary_cleaning_013.phpt @@ -0,0 +1,311 @@ +--TEST-- +Exceptions thrown in operand cleaning must cause leak of return value +--FILE-- +<?php + +try { + var_dump(new class { + function __toString() { return "a"; } + function __destruct() { throw new Exception; } + } . "foo"); +} catch (Exception $e) { print "caught Exception 1\n"; } + +try { + var_dump([0] + [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 2\n"; } + +try { + $foo = [0]; + var_dump($foo += [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 3\n"; } + +try { + $foo = (object)["foo" => [0]]; + var_dump($foo->foo += [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 4\n"; } + +try { + $foo = new class { + function __get($x) { return [0]; } + function __set($x, $y) {} + }; + var_dump($foo->foo += [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 5\n"; } + +try { + $foo = new class { + public $bar = [0]; + function &__get($x) { return $this->bar; } + }; + var_dump($foo->foo += [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 6\n"; } + +try { + $foo = new class implements ArrayAccess { + function offsetGet($x) { return [0]; } + function offsetSet($x, $y) {} + function offsetExists($x) { return true; } + function offsetUnset($x) {} + }; + var_dump($foo[0] += [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 7\n"; } + +try { + $foo = new class implements ArrayAccess { + public $foo = [0]; + function &offsetGet($x) { return $this->foo; } + function offsetSet($x, $y) {} + function offsetExists($x) { return true; } + function offsetUnset($x) {} + }; + var_dump($foo[0] += [new class { + function __destruct() { throw new Exception; } + }]); +} catch (Exception $e) { print "caught Exception 8\n"; } + +try { + var_dump((function() { return new class { + function __construct() { $this->foo = new stdClass; } + function __destruct() { throw new Exception; } + }; })()->foo++); +} catch (Exception $e) { print "caught Exception 9\n"; } + +try { + var_dump((function() { return new class { + function __get($x) { return new stdClass; } + function __set($x, $y) {} + function __destruct() { throw new Exception; } + }; })()->foo++); +} catch (Exception $e) { print "caught Exception 10\n"; } + +try { + var_dump((function() { return new class { + function __construct() { $this->bar = new stdClass; } + function &__get($x) { return $this->bar; } + function __destruct() { throw new Exception; } + }; })()->foo++); +} catch (Exception $e) { print "caught Exception 11\n"; } + +try { + var_dump(++(function() { return new class { + function __construct() { $this->foo = new stdClass; } + function __destruct() { throw new Exception; } + }; })()->foo); +} catch (Exception $e) { print "caught Exception 12\n"; } + +try { + var_dump(++(function() { return new class { + function __get($x) { return new stdClass; } + function __set($x, $y) {} + function __destruct() { throw new Exception; } + }; })()->foo); +} catch (Exception $e) { print "caught Exception 13\n"; } + +try { + var_dump(++(function() { return new class { + function __construct() { $this->bar = new stdClass; } + function &__get($x) { return $this->bar; } + function __destruct() { throw new Exception; } + }; })()->foo); +} catch (Exception $e) { print "caught Exception 14\n"; } + +try { + var_dump((function() { return new class implements ArrayAccess { + function offsetGet($x) { return [new stdClass]; } + function offsetSet($x, $y) {} + function offsetExists($x) { return true; } + function offsetUnset($x) {} + function __destruct() { throw new Exception; } + }; })()[0]++); +} catch (Exception $e) { print "caught Exception 15\n"; } + +try { + var_dump(++(function() { return new class implements ArrayAccess { + function offsetGet($x) { return [new stdClass]; } + function offsetSet($x, $y) {} + function offsetExists($x) { return true; } + function offsetUnset($x) {} + function __destruct() { throw new Exception; } + }; })()[0]); +} catch (Exception $e) { print "caught Exception 16\n"; } + +try { + var_dump((new class { + function __construct() { $this->foo = new stdClass; } + function __destruct() { throw new Exception; } + })->foo); +} catch (Exception $e) { print "caught Exception 17\n"; } + +try { + var_dump((new class { + function __get($x) { return new stdClass; } + function __set($x, $y) {} + function __destruct() { throw new Exception; } + })->foo); +} catch (Exception $e) { print "caught Exception 18\n"; } + +try { + var_dump((new class implements ArrayAccess { + function offsetGet($x) { return [new stdClass]; } + function offsetSet($x, $y) {} + function offsetExists($x) { return true; } + function offsetUnset($x) {} + function __destruct() { throw new Exception; } + })[0]); +} catch (Exception $e) { print "caught Exception 19\n"; } + +try { + var_dump(isset((new class { + function __construct() { $this->foo = new stdClass; } + function __destruct() { throw new Exception; } + })->foo->bar)); +} catch (Exception $e) { print "caught Exception 20\n"; } + +try { + var_dump(isset((new class { + function __get($x) { return new stdClass; } + function __set($x, $y) {} + function __destruct() { throw new Exception; } + })->foo->bar)); +} catch (Exception $e) { print "caught Exception 21\n"; } + +try { + var_dump(isset((new class implements ArrayAccess { + function offsetGet($x) { return [new stdClass]; } + function offsetSet($x, $y) {} + function offsetExists($x) { return true; } + function offsetUnset($x) {} + function __destruct() { throw new Exception; } + })[0]->bar)); +} catch (Exception $e) { print "caught Exception 22\n"; } + +try { + $foo = new class { + function __destruct() { throw new Exception; } + }; + var_dump($foo = new stdClass); +} catch (Exception $e) { print "caught Exception 23\n"; } + +try { + $foo = [new class { + function __destruct() { throw new Exception; } + }]; + var_dump($foo[0] = new stdClass); +} catch (Exception $e) { print "caught Exception 24\n"; } + +try { + $foo = (object) ["foo" => new class { + function __destruct() { throw new Exception; } + }]; + var_dump($foo->foo = new stdClass); +} catch (Exception $e) { print "caught Exception 25\n"; } + +try { + $foo = new class { + function __get($x) {} + function __set($x, $y) { throw new Exception; } + }; + var_dump($foo->foo = new stdClass); +} catch (Exception $e) { print "caught Exception 26\n"; } + +try { + $foo = new class implements ArrayAccess { + function offsetGet($x) {} + function offsetSet($x, $y) { throw new Exception; } + function offsetExists($x) { return true; } + function offsetUnset($x) {} + }; + var_dump($foo[0] = new stdClass); +} catch (Exception $e) { print "caught Exception 27\n"; } + +try { + $foo = new class { + function __destruct() { throw new Exception; } + }; + $bar = new stdClass; + var_dump($foo = &$bar); +} catch (Exception $e) { print "caught Exception 28\n"; } + +try { + $f = function() { + return new class { + function __toString() { return "a"; } + function __destruct() { throw new Exception; } + }; + }; + var_dump("{$f()}foo"); +} catch (Exception $e) { print "caught Exception 29\n"; } + +try { + $f = function() { + return new class { + function __toString() { return "a"; } + function __destruct() { throw new Exception; } + }; + }; + var_dump("bar{$f()}foo"); +} catch (Exception $e) { print "caught Exception 30\n"; } + +try { + var_dump((string) new class { + function __toString() { $x = "Z"; return ++$x; } + function __destruct() { throw new Exception; } + }); +} catch (Exception $e) { print "caught Exception 31\n"; } + +try { + var_dump(clone (new class { + function __clone() { throw new Exception; } + })); +} catch (Exception $e) { print "caught Exception 32\n"; } + +?> +--EXPECTF-- +caught Exception 1 +caught Exception 2 +caught Exception 3 +caught Exception 4 +caught Exception 5 +caught Exception 6 +caught Exception 7 +caught Exception 8 +caught Exception 9 +caught Exception 10 +caught Exception 11 +caught Exception 12 +caught Exception 13 +caught Exception 14 + +Notice: Indirect modification of overloaded element of class@anonymous has no effect in %s on line %d +caught Exception 15 + +Notice: Indirect modification of overloaded element of class@anonymous has no effect in %s on line %d +caught Exception 16 +caught Exception 17 +caught Exception 18 +caught Exception 19 +caught Exception 20 +caught Exception 21 +caught Exception 22 +caught Exception 23 +caught Exception 24 +caught Exception 25 +caught Exception 26 +caught Exception 27 +caught Exception 28 +caught Exception 29 +caught Exception 30 +caught Exception 31 +caught Exception 32 diff --git a/Zend/tests/temporary_cleaning_014.phpt b/Zend/tests/temporary_cleaning_014.phpt new file mode 100644 index 0000000000..39effae18a --- /dev/null +++ b/Zend/tests/temporary_cleaning_014.phpt @@ -0,0 +1,15 @@ +--TEST-- +Leak in JMP_SET +--SKIPIF-- +<?php if (!extension_loaded("gmp")) print "skip"; ?> +--FILE-- +<?php +set_error_handler(function() { throw new Exception; }); +try { + new GMP ?: null; +} catch (Exception $e) { +} +?> +DONE +--EXPECT-- +DONE diff --git a/Zend/tests/temporary_cleaning_015.phpt b/Zend/tests/temporary_cleaning_015.phpt new file mode 100644 index 0000000000..7690abba76 --- /dev/null +++ b/Zend/tests/temporary_cleaning_015.phpt @@ -0,0 +1,17 @@ +--TEST-- +Attempt to free invalid structure (result of ROPE_INIT is not a zval) +--FILE-- +<?php +set_error_handler(function () { + throw new Exception(); +}); +$a = []; +$b = ""; +try { + echo "$a$b\n"; +} catch (Exception $ex) { +} +?> +DONE +--EXPECT-- +DONE diff --git a/Zend/tests/temporary_cleaning_016.phpt b/Zend/tests/temporary_cleaning_016.phpt new file mode 100644 index 0000000000..d7be78e1ff --- /dev/null +++ b/Zend/tests/temporary_cleaning_016.phpt @@ -0,0 +1,16 @@ +--TEST-- +Live ranges should be ordered according to "start" position +--FILE-- +<?php +set_error_handler(function($no, $msg) { throw new Exception; }); + +try { + $a = []; + $str = "$a${"y$a$a"}y"; +} catch (Exception $e) { +} +?> +DONE +--EXPECT-- +DONE + diff --git a/Zend/tests/this_in_eval.phpt b/Zend/tests/this_in_eval.phpt index 8da70b76a3..ed3926cd66 100644 --- a/Zend/tests/this_in_eval.phpt +++ b/Zend/tests/this_in_eval.phpt @@ -15,3 +15,4 @@ object(C)#1 (0) { } object(C)#1 (0) { } + diff --git a/Zend/tests/this_in_mb_parse_str.phpt b/Zend/tests/this_in_mb_parse_str.phpt index 8dfac94722..2d5af4794e 100644 --- a/Zend/tests/this_in_mb_parse_str.phpt +++ b/Zend/tests/this_in_mb_parse_str.phpt @@ -11,6 +11,8 @@ function foo() { foo(); ?> --EXPECTF-- +Deprecated: mb_parse_str(): Calling mb_parse_str() without the result argument is deprecated in %s on line %d + Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_mb_parse_str.php:3 Stack trace: #0 %sthis_in_mb_parse_str.php(3): mb_parse_str('this=42') diff --git a/Zend/tests/this_in_parse_str.phpt b/Zend/tests/this_in_parse_str.phpt index 4540d282cc..0bd9064d60 100644 --- a/Zend/tests/this_in_parse_str.phpt +++ b/Zend/tests/this_in_parse_str.phpt @@ -9,6 +9,8 @@ function foo() { foo(); ?> --EXPECTF-- +Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in %s on line %d + Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_parse_str.php:3 Stack trace: #0 %sthis_in_parse_str.php(3): parse_str('this=42') diff --git a/Zend/tests/throwable_001.phpt b/Zend/tests/throwable_001.phpt index 306ed13784..afcdd7224c 100644 --- a/Zend/tests/throwable_001.phpt +++ b/Zend/tests/throwable_001.phpt @@ -7,6 +7,7 @@ Aaron Piotrowski <aaron@icicle.io> throw new Exception('Exception message', 0, new Error('Error message')); ?> --EXPECTF-- + Fatal error: Uncaught Error: Error message in %s:%d Stack trace: #0 {main} diff --git a/Zend/tests/throwable_002.phpt b/Zend/tests/throwable_002.phpt index f51969c6c5..10fd82bea5 100644 --- a/Zend/tests/throwable_002.phpt +++ b/Zend/tests/throwable_002.phpt @@ -7,6 +7,7 @@ Aaron Piotrowski <aaron@icicle.io> throw new Error('Error message', 0, new Exception('Exception message')); ?> --EXPECTF-- + Fatal error: Uncaught Exception: Exception message in %s:%d Stack trace: #0 {main} diff --git a/Zend/tests/throwable_003.phpt b/Zend/tests/throwable_003.phpt index 3e65027c79..19626a3186 100644 --- a/Zend/tests/throwable_003.phpt +++ b/Zend/tests/throwable_003.phpt @@ -7,4 +7,5 @@ Aaron Piotrowski <aaron@icicle.io> class Failure implements Throwable {} ?> --EXPECTF-- + Fatal error: Class Failure cannot implement interface Throwable, extend Exception or Error instead in %s on line %d diff --git a/Zend/tests/traits/bug55554a.phpt b/Zend/tests/traits/bug55554a.phpt index dd844ba661..b92a81f54f 100644 --- a/Zend/tests/traits/bug55554a.phpt +++ b/Zend/tests/traits/bug55554a.phpt @@ -28,6 +28,7 @@ $o = new NewConstructor; echo "Legacy constructor: "; $o = new LegacyConstructor; + --EXPECT-- New constructor: ctor executed Legacy constructor: ctor executed diff --git a/Zend/tests/traits/bug55554b.phpt b/Zend/tests/traits/bug55554b.phpt index 65ecb7adaf..cf2eadf2f8 100644 --- a/Zend/tests/traits/bug55554b.phpt +++ b/Zend/tests/traits/bug55554b.phpt @@ -46,6 +46,8 @@ class ReportCollision { echo "ReportCollision: "; $o = new ReportCollision; + + --EXPECTF-- OverridingIsSilent1 __construct @@ -53,3 +55,4 @@ Deprecated: Methods with the same name as their class will not be constructors i OverridingIsSilent2 OverridingIsSilent2 Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d + diff --git a/Zend/tests/traits/bug55554c.phpt b/Zend/tests/traits/bug55554c.phpt index ddb6e66d19..dd224675bc 100644 --- a/Zend/tests/traits/bug55554c.phpt +++ b/Zend/tests/traits/bug55554c.phpt @@ -40,5 +40,7 @@ class ReportCollision { echo "ReportCollision: "; $o = new ReportCollision; + + --EXPECTF-- ReportCollision: New constructor executed diff --git a/Zend/tests/traits/bug55554d.phpt b/Zend/tests/traits/bug55554d.phpt index 88564a83c1..10f2e2952d 100644 --- a/Zend/tests/traits/bug55554d.phpt +++ b/Zend/tests/traits/bug55554d.phpt @@ -25,5 +25,8 @@ class ReportCollision { } $o = new ReportCollision; + --EXPECTF-- + Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d + diff --git a/Zend/tests/traits/bug55554e.phpt b/Zend/tests/traits/bug55554e.phpt index ed1c324831..5db508fc85 100644 --- a/Zend/tests/traits/bug55554e.phpt +++ b/Zend/tests/traits/bug55554e.phpt @@ -24,5 +24,7 @@ class ReportCollision { echo "ReportCollision: "; $o = new ReportCollision; + + --EXPECTF-- -Fatal error: Trait method ReportCollision has not been applied, because there are collisions with other trait methods on ReportCollision in %s on line %d +Fatal error: Trait method ReportCollision has not been applied, because there are collisions with other trait methods on ReportCollision in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/bug55554f.phpt b/Zend/tests/traits/bug55554f.phpt index d7d4fc007d..31f5f534c5 100644 --- a/Zend/tests/traits/bug55554f.phpt +++ b/Zend/tests/traits/bug55554f.phpt @@ -23,5 +23,7 @@ class ReportCollision { echo "ReportCollision: "; $o = new ReportCollision; + + --EXPECTF-- -Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d +Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/bug55554g.phpt b/Zend/tests/traits/bug55554g.phpt index d7de8216b0..662140cec0 100644 --- a/Zend/tests/traits/bug55554g.phpt +++ b/Zend/tests/traits/bug55554g.phpt @@ -23,5 +23,7 @@ class ReportCollision { echo "ReportCollision: "; $o = new ReportCollision; + + --EXPECTF-- -Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d +Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/bug60153.phpt b/Zend/tests/traits/bug60153.phpt index 5dcc78a878..8f01e72c2d 100644 --- a/Zend/tests/traits/bug60153.phpt +++ b/Zend/tests/traits/bug60153.phpt @@ -14,5 +14,6 @@ trait TFoo { class C implements IFoo { use TFoo; } + --EXPECTF-- Fatal error: Declaration of C::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d diff --git a/Zend/tests/traits/bug60165a.phpt b/Zend/tests/traits/bug60165a.phpt index 6bc3352e21..245bb94e97 100644 --- a/Zend/tests/traits/bug60165a.phpt +++ b/Zend/tests/traits/bug60165a.phpt @@ -12,5 +12,6 @@ class MyClass { nonExistent as barA; } } + --EXPECTF-- Fatal error: An alias (barA) was defined for method nonExistent(), but this method does not exist in %s on line %d diff --git a/Zend/tests/traits/bug60165b.phpt b/Zend/tests/traits/bug60165b.phpt index ac3f070bd8..7b4855a646 100644 --- a/Zend/tests/traits/bug60165b.phpt +++ b/Zend/tests/traits/bug60165b.phpt @@ -12,5 +12,6 @@ class MyClass { A::nonExistent as barA; } } + --EXPECTF-- Fatal error: An alias was defined for A::nonExistent but this method does not exist in %s on line %d diff --git a/Zend/tests/traits/bug60165c.phpt b/Zend/tests/traits/bug60165c.phpt index 9a8458d65d..d72491f030 100644 --- a/Zend/tests/traits/bug60165c.phpt +++ b/Zend/tests/traits/bug60165c.phpt @@ -17,5 +17,6 @@ class MyClass { baz as foobar; } } + --EXPECTF-- Fatal error: An alias (foobar) was defined for method baz(), but this method does not exist in %s on line %d diff --git a/Zend/tests/traits/bug60165d.phpt b/Zend/tests/traits/bug60165d.phpt index 6b4a09d059..26ac927a81 100644 --- a/Zend/tests/traits/bug60165d.phpt +++ b/Zend/tests/traits/bug60165d.phpt @@ -16,5 +16,6 @@ class MyClass { A::bar insteadof B; } } + --EXPECTF-- Fatal error: A precedence rule was defined for A::bar but this method does not exist in %s on line %d diff --git a/Zend/tests/traits/bug60173.phpt b/Zend/tests/traits/bug60173.phpt index d4683a9921..f525a66aee 100644 --- a/Zend/tests/traits/bug60173.phpt +++ b/Zend/tests/traits/bug60173.phpt @@ -7,6 +7,7 @@ trait foo { } $rc = new ReflectionClass('foo'); $rc->newInstance(); + --EXPECTF-- Fatal error: Uncaught Error: Cannot instantiate trait foo in %s:%d Stack trace: diff --git a/Zend/tests/traits/bug60217a.phpt b/Zend/tests/traits/bug60217a.phpt index 2eb191c45e..62a3515955 100644 --- a/Zend/tests/traits/bug60217a.phpt +++ b/Zend/tests/traits/bug60217a.phpt @@ -21,5 +21,6 @@ class C { $o = new C; $o->foo(); + --EXPECTF-- C::foo() works. diff --git a/Zend/tests/traits/bug60217b.phpt b/Zend/tests/traits/bug60217b.phpt index 8a7ac38a9d..8b2b64e534 100644 --- a/Zend/tests/traits/bug60217b.phpt +++ b/Zend/tests/traits/bug60217b.phpt @@ -21,5 +21,6 @@ class CBroken { $o = new CBroken; $o->foo(1); + --EXPECTF-- -Fatal error: Declaration of TBroken2::foo($a, $b = 0) must be compatible with TBroken1::foo($a) in %s on line %d +Fatal error: Declaration of TBroken1::foo($a) must be compatible with TBroken2::foo($a, $b = 0) in %s diff --git a/Zend/tests/traits/bug60217c.phpt b/Zend/tests/traits/bug60217c.phpt index 401444e978..baa4314a61 100644 --- a/Zend/tests/traits/bug60217c.phpt +++ b/Zend/tests/traits/bug60217c.phpt @@ -21,5 +21,6 @@ class CBroken { $o = new CBroken; $o->foo(1); + --EXPECTF-- Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d diff --git a/Zend/tests/traits/bug60369.phpt b/Zend/tests/traits/bug60369.phpt index 77a7067232..bfc1ee303f 100644 --- a/Zend/tests/traits/bug60369.phpt +++ b/Zend/tests/traits/bug60369.phpt @@ -14,4 +14,4 @@ class Properties { ?> --EXPECTF-- -Fatal error: Properties and PropertiesTrait define the same property ($same) in the composition of Properties. However, the definition differs and is considered incompatible. Class was composed in %s on line %d +Fatal error: Properties and PropertiesTrait define the same property ($same) in the composition of Properties. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/bug60717.phpt b/Zend/tests/traits/bug60717.phpt index d38b1c0c24..d4bf7ea6de 100644 --- a/Zend/tests/traits/bug60717.phpt +++ b/Zend/tests/traits/bug60717.phpt @@ -68,5 +68,6 @@ namespace HTML $o = new HTMLHelper6; echo 'Done'; } + --EXPECT-- Done diff --git a/Zend/tests/traits/bug65576a.phpt b/Zend/tests/traits/bug65576a.phpt index 5f2e3c5076..49b2ba0c96 100644 --- a/Zend/tests/traits/bug65576a.phpt +++ b/Zend/tests/traits/bug65576a.phpt @@ -25,5 +25,7 @@ class B extends A } new B(); + --EXPECT-- Trait contructor + diff --git a/Zend/tests/traits/bug65576b.phpt b/Zend/tests/traits/bug65576b.phpt index 772196c481..3be52ba7c9 100644 --- a/Zend/tests/traits/bug65576b.phpt +++ b/Zend/tests/traits/bug65576b.phpt @@ -26,6 +26,8 @@ class B extends A } new B(); + --EXPECT-- Parent constructor Trait contructor + diff --git a/Zend/tests/traits/bug69579.phpt b/Zend/tests/traits/bug69579.phpt index 421734e74e..009bddadca 100644 --- a/Zend/tests/traits/bug69579.phpt +++ b/Zend/tests/traits/bug69579.phpt @@ -2,7 +2,7 @@ Bug #69579 (Internal trait double-free) --SKIPIF-- <?php -if (!PHP_DEBUG) die("skip only run in debug version"); +if (!trait_exists('_ZendTestTrait')) die("skip requires internal trait"); ?> --FILE-- <?php diff --git a/Zend/tests/traits/bug74607.phpt b/Zend/tests/traits/bug74607.phpt new file mode 100644 index 0000000000..12b0b376f0 --- /dev/null +++ b/Zend/tests/traits/bug74607.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #74607 (Traits enforce different inheritance rules - return types) +--FILE-- +<?php + +abstract class L1{ +abstract function m3($x); +} + +trait L2t{ +function m3($x): int{} +} + +class L2 extends L1{ +use L2t; +} + +echo "DONE"; + +?> +--EXPECT-- +DONE diff --git a/Zend/tests/traits/bug74607a.phpt b/Zend/tests/traits/bug74607a.phpt new file mode 100644 index 0000000000..8ef3076fd6 --- /dev/null +++ b/Zend/tests/traits/bug74607a.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #74607 (Traits enforce different inheritance rules - number of required parameters) +--FILE-- +<?php + +abstract class L1{ +abstract function m3($x); +} + +trait L2t{ +function m3($x, $y = 0){} +} + +class L2 extends L1{ +use L2t; +} + +echo "DONE"; + +?> +--EXPECT-- +DONE diff --git a/Zend/tests/traits/bug75607.phpt b/Zend/tests/traits/bug75607.phpt new file mode 100644 index 0000000000..a3a10425f4 --- /dev/null +++ b/Zend/tests/traits/bug75607.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #75607 (Comparision of initial static properties failing) +--FILE-- +<?php + +trait T1 +{ + public static $prop1 = 1; +} + +class Base +{ + public static $prop1 = 1; +} + +class Child extends base +{ + use T1; +} + +echo "DONE"; + +?> +--EXPECT-- +DONE diff --git a/Zend/tests/traits/bug75607a.phpt b/Zend/tests/traits/bug75607a.phpt new file mode 100644 index 0000000000..2989814f39 --- /dev/null +++ b/Zend/tests/traits/bug75607a.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #75607 (Comparision of initial static properties failing) +--FILE-- +<?php + +trait T1 +{ + public static $prop1 = 1; +} + +trait T2 +{ + public static $prop1 = 1; +} + +class Base +{ + use T1; +} + +class Child extends base +{ + +} + +class Grand extends Child +{ + use T2; +} + +$c = new Grand(); +var_dump($c::$prop1); + +?> +--EXPECT-- +int(1) diff --git a/Zend/tests/traits/bugs/abstract-methods01.phpt b/Zend/tests/traits/bugs/abstract-methods01.phpt index 23cdef3a89..5b90ae0f3d 100644 --- a/Zend/tests/traits/bugs/abstract-methods01.phpt +++ b/Zend/tests/traits/bugs/abstract-methods01.phpt @@ -16,4 +16,4 @@ $test = new TraitsTest(); $test->hello(); ?> --EXPECTF-- -Fatal error: Class %s contains %d abstract method and must therefore be declared abstract or implement the remaining methods (%s) in %s on line %d +Fatal error: Class %s contains %d abstract method and must therefore be declared abstract or implement the remaining methods (%s) in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/abstract-methods02.phpt b/Zend/tests/traits/bugs/abstract-methods02.phpt index 75acda45ba..df12f9b554 100644 --- a/Zend/tests/traits/bugs/abstract-methods02.phpt +++ b/Zend/tests/traits/bugs/abstract-methods02.phpt @@ -23,4 +23,4 @@ $test = new TraitsTest(); $test->hello(); ?> --EXPECTF-- -Hello +Hello
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/abstract-methods03.phpt b/Zend/tests/traits/bugs/abstract-methods03.phpt index 6d791e07dc..0914cbf3d7 100644 --- a/Zend/tests/traits/bugs/abstract-methods03.phpt +++ b/Zend/tests/traits/bugs/abstract-methods03.phpt @@ -19,4 +19,4 @@ $test = new TraitsTest(); $test->hello(); ?> --EXPECTF-- -Hello +Hello
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/abstract-methods04.phpt b/Zend/tests/traits/bugs/abstract-methods04.phpt index d80e3dcdce..00068e8cc7 100644 --- a/Zend/tests/traits/bugs/abstract-methods04.phpt +++ b/Zend/tests/traits/bugs/abstract-methods04.phpt @@ -33,4 +33,4 @@ $test->hello(); ?> --EXPECTF-- -HelloHello +HelloHello
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/abstract-methods05.phpt b/Zend/tests/traits/bugs/abstract-methods05.phpt index 6a901bb601..b40cbe30a6 100644 --- a/Zend/tests/traits/bugs/abstract-methods05.phpt +++ b/Zend/tests/traits/bugs/abstract-methods05.phpt @@ -22,4 +22,4 @@ class TraitsTest1 { ?> --EXPECTF-- -Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d +Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d diff --git a/Zend/tests/traits/bugs/alias-semantics.phpt b/Zend/tests/traits/bugs/alias-semantics.phpt index 272050788a..39eb82cbbd 100644 --- a/Zend/tests/traits/bugs/alias-semantics.phpt +++ b/Zend/tests/traits/bugs/alias-semantics.phpt @@ -20,4 +20,4 @@ $test->b(); ?> --EXPECTF-- -AA +AA
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/alias-semantics02.phpt b/Zend/tests/traits/bugs/alias-semantics02.phpt index 250aacafdf..d814dd3999 100644 --- a/Zend/tests/traits/bugs/alias-semantics02.phpt +++ b/Zend/tests/traits/bugs/alias-semantics02.phpt @@ -22,4 +22,4 @@ $test->b(); ?> --EXPECTF-- -AA +AA
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/missing-trait.phpt b/Zend/tests/traits/bugs/missing-trait.phpt index d8ede9dfa7..1cdd4f1cc6 100644 --- a/Zend/tests/traits/bugs/missing-trait.phpt +++ b/Zend/tests/traits/bugs/missing-trait.phpt @@ -12,4 +12,4 @@ $test = new TraitsTest(); ?> --EXPECTF-- -Fatal error: Trait 'THello' not found in %s on line %d +Fatal error: Trait 'THello' not found in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt b/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt index 5d82220671..387c016492 100644 --- a/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt +++ b/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt @@ -28,4 +28,4 @@ $test = new TraitsTest(); $test->hello(); ?> --EXPECTF-- -Hello +Hello
\ No newline at end of file diff --git a/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt b/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt index 5c54f0027a..b289651a9b 100644 --- a/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt +++ b/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt @@ -20,4 +20,4 @@ $obj = new baz(); echo $obj->zoo, "\n"; ?> --EXPECTF-- -Fatal error: baz and foo define the same property ($zoo) in the composition of baz. However, the definition differs and is considered incompatible. Class was composed in %s on line %d +Fatal error: baz and foo define the same property ($zoo) in the composition of baz. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/conflict001.phpt b/Zend/tests/traits/conflict001.phpt index 11dababdb5..dfc9456853 100644 --- a/Zend/tests/traits/conflict001.phpt +++ b/Zend/tests/traits/conflict001.phpt @@ -22,4 +22,4 @@ class TraitsTest { } ?> --EXPECTF-- -Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on TraitsTest in %s on line %d +Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on TraitsTest in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/conflict002.phpt b/Zend/tests/traits/conflict002.phpt index 23270c3da3..db4386fbd9 100644 --- a/Zend/tests/traits/conflict002.phpt +++ b/Zend/tests/traits/conflict002.phpt @@ -29,4 +29,4 @@ $o = new TheWorldIsNotEnough(); $o->sayHello(); // echos Hello Universe! ?> --EXPECTF-- -Hello Universe! +Hello Universe!
\ No newline at end of file diff --git a/Zend/tests/traits/conflict003.phpt b/Zend/tests/traits/conflict003.phpt index e274063a6f..577f5c73c3 100644 --- a/Zend/tests/traits/conflict003.phpt +++ b/Zend/tests/traits/conflict003.phpt @@ -28,4 +28,4 @@ class Talker { ?> --EXPECTF-- -Fatal error: Trait method smallTalk has not been applied, because there are collisions with other trait methods on Talker in %s on line %d +Fatal error: Trait method smallTalk has not been applied, because there are collisions with other trait methods on Talker in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/flattening001.phpt b/Zend/tests/traits/flattening001.phpt index 3b17833a31..e493430d16 100644 --- a/Zend/tests/traits/flattening001.phpt +++ b/Zend/tests/traits/flattening001.phpt @@ -39,4 +39,4 @@ var_dump($o->getText()); --EXPECTF-- string(4) "test" string(3) "foo" -string(3) "bar" +string(3) "bar"
\ No newline at end of file diff --git a/Zend/tests/traits/flattening002.phpt b/Zend/tests/traits/flattening002.phpt index 56621a4a21..71ec4b1450 100644 --- a/Zend/tests/traits/flattening002.phpt +++ b/Zend/tests/traits/flattening002.phpt @@ -25,4 +25,4 @@ $o = new MyHelloWorld(); $o->sayHello(); ?> --EXPECTF-- -Hello World! +Hello World!
\ No newline at end of file diff --git a/Zend/tests/traits/flattening003.phpt b/Zend/tests/traits/flattening003.phpt index 53e0043a7b..0e131a7792 100644 --- a/Zend/tests/traits/flattening003.phpt +++ b/Zend/tests/traits/flattening003.phpt @@ -29,4 +29,4 @@ $o->sayHello(); $o->sayWorld(); ?> --EXPECTF-- -Hello World! +Hello World!
\ No newline at end of file diff --git a/Zend/tests/traits/inheritance001.phpt b/Zend/tests/traits/inheritance001.phpt index d5f64c9a35..22d4ba666a 100644 --- a/Zend/tests/traits/inheritance001.phpt +++ b/Zend/tests/traits/inheritance001.phpt @@ -21,4 +21,4 @@ $o = new TheWorldIsNotEnough(); $o->sayHello(); // echos Hello Universe! ?> --EXPECTF-- -Hello Universe! +Hello Universe!
\ No newline at end of file diff --git a/Zend/tests/traits/inheritance002.phpt b/Zend/tests/traits/inheritance002.phpt index 89bfef0826..20c2afe1f4 100644 --- a/Zend/tests/traits/inheritance002.phpt +++ b/Zend/tests/traits/inheritance002.phpt @@ -24,4 +24,4 @@ $o = new MyHelloWorld(); $o->sayHello(); ?> --EXPECTF-- -World! +World!
\ No newline at end of file diff --git a/Zend/tests/traits/language002.phpt b/Zend/tests/traits/language002.phpt index 0093d88735..2c20133ebd 100644 --- a/Zend/tests/traits/language002.phpt +++ b/Zend/tests/traits/language002.phpt @@ -29,4 +29,4 @@ $o->sayWorld(); $o->sayExclamationMark(); ?> --EXPECTF-- -Hello World! +Hello World!
\ No newline at end of file diff --git a/Zend/tests/traits/language003.phpt b/Zend/tests/traits/language003.phpt index 0dc095f8e1..8324179265 100644 --- a/Zend/tests/traits/language003.phpt +++ b/Zend/tests/traits/language003.phpt @@ -26,4 +26,4 @@ $o = new MyHelloWorld(); $o->saySomething(); ?> --EXPECTF-- -Hello +Hello
\ No newline at end of file diff --git a/Zend/tests/traits/language004.phpt b/Zend/tests/traits/language004.phpt index cd4f03a1df..98673f14dc 100644 --- a/Zend/tests/traits/language004.phpt +++ b/Zend/tests/traits/language004.phpt @@ -28,4 +28,4 @@ $o->saySomething(); $o->sayWorld(); ?> --EXPECTF-- -Hello World +Hello World
\ No newline at end of file diff --git a/Zend/tests/traits/language005.phpt b/Zend/tests/traits/language005.phpt index 5cd519f621..11e28af6e6 100644 --- a/Zend/tests/traits/language005.phpt +++ b/Zend/tests/traits/language005.phpt @@ -37,4 +37,4 @@ $t->talk(); ?> --EXPECTF-- -bAB +bAB
\ No newline at end of file diff --git a/Zend/tests/traits/language006.phpt b/Zend/tests/traits/language006.phpt index 6afd75ee89..6dc6ba9c98 100644 --- a/Zend/tests/traits/language006.phpt +++ b/Zend/tests/traits/language006.phpt @@ -28,4 +28,4 @@ $o->sayHelloWorld(); ?> --EXPECTF-- -Hello World! +Hello World!
\ No newline at end of file diff --git a/Zend/tests/traits/language007.phpt b/Zend/tests/traits/language007.phpt index 860d829b75..3ccbc85929 100644 --- a/Zend/tests/traits/language007.phpt +++ b/Zend/tests/traits/language007.phpt @@ -27,4 +27,4 @@ $o->sayWorld(); ?> --EXPECTF-- -Hello World! +Hello World!
\ No newline at end of file diff --git a/Zend/tests/traits/language008a.phpt b/Zend/tests/traits/language008a.phpt index 2d87de92e8..65a792faac 100644 --- a/Zend/tests/traits/language008a.phpt +++ b/Zend/tests/traits/language008a.phpt @@ -23,4 +23,4 @@ $o->sayHello(); Fatal error: Uncaught Error: Call to protected method MyClass::sayHello() from context '' in %s:%d Stack trace: #0 {main} - thrown in %s on line %d + thrown in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/language008b.phpt b/Zend/tests/traits/language008b.phpt index e40ff59282..c1a0d2629f 100644 --- a/Zend/tests/traits/language008b.phpt +++ b/Zend/tests/traits/language008b.phpt @@ -30,4 +30,4 @@ Hello World!Hello World! Fatal error: Uncaught Error: Call to private method MyClass::sayHelloWorld() from context '' in %s:%d Stack trace: #0 {main} - thrown in %s on line %d + thrown in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/language009.phpt b/Zend/tests/traits/language009.phpt index b44dfa661a..db19eddc90 100644 --- a/Zend/tests/traits/language009.phpt +++ b/Zend/tests/traits/language009.phpt @@ -33,4 +33,4 @@ $t->foo(); ?> --EXPECTF-- -b +b
\ No newline at end of file diff --git a/Zend/tests/traits/language010.phpt b/Zend/tests/traits/language010.phpt index cd518f43e2..ac3ab2e29e 100644 --- a/Zend/tests/traits/language010.phpt +++ b/Zend/tests/traits/language010.phpt @@ -27,4 +27,4 @@ $o->world(); ?> --EXPECTF-- -Fatal error: Trait method world has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d +Fatal error: Trait method world has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/property002.phpt b/Zend/tests/traits/property002.phpt index d33c3199a4..4234484d95 100644 --- a/Zend/tests/traits/property002.phpt +++ b/Zend/tests/traits/property002.phpt @@ -29,4 +29,4 @@ $t->test(); --EXPECTF-- bool(true) bool(true) -hello World! +hello World!
\ No newline at end of file diff --git a/Zend/tests/traits/property003.phpt b/Zend/tests/traits/property003.phpt index cf64d4d370..dc88ce3178 100644 --- a/Zend/tests/traits/property003.phpt +++ b/Zend/tests/traits/property003.phpt @@ -27,4 +27,4 @@ $t->hello = "foo"; --EXPECTF-- PRE-CLASS-GUARD -Fatal error: THello1 and THello2 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d +Fatal error: THello1 and THello2 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/property004.phpt b/Zend/tests/traits/property004.phpt index 9d7d0aa72c..483108dfb0 100644 --- a/Zend/tests/traits/property004.phpt +++ b/Zend/tests/traits/property004.phpt @@ -27,4 +27,4 @@ $t = new TraitsTest; --EXPECTF-- PRE-CLASS-GUARD -Fatal error: THello1 and THello2 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d +Fatal error: THello1 and THello2 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/traits/property008.phpt b/Zend/tests/traits/property008.phpt index c81ab3c001..5c463b596c 100644 --- a/Zend/tests/traits/property008.phpt +++ b/Zend/tests/traits/property008.phpt @@ -59,4 +59,4 @@ object(SubclassB)#3 (2) { int(0) ["hello":"BaseWithTPropB":private]=> int(0) -} +}
\ No newline at end of file diff --git a/Zend/tests/traits/property009.phpt b/Zend/tests/traits/property009.phpt index 26eca0b940..590a5e9b7d 100644 --- a/Zend/tests/traits/property009.phpt +++ b/Zend/tests/traits/property009.phpt @@ -42,6 +42,7 @@ var_dump($b); ?> --EXPECTF-- + object(SubclassClassicInheritance)#1 (1) { ["hello"]=> int(0) @@ -53,4 +54,4 @@ object(SubclassA)#2 (1) { object(SubclassB)#3 (1) { ["hello"]=> int(0) -} +}
\ No newline at end of file diff --git a/Zend/tests/traits/static_001.phpt b/Zend/tests/traits/static_001.phpt index 326481c779..5953c008d5 100644 --- a/Zend/tests/traits/static_001.phpt +++ b/Zend/tests/traits/static_001.phpt @@ -19,4 +19,4 @@ Simas Toleikis simast@gmail.com ?> --EXPECT-- -Test +Test
\ No newline at end of file diff --git a/Zend/tests/traits/static_002.phpt b/Zend/tests/traits/static_002.phpt index 5c1a92a806..64ebf6bf14 100644 --- a/Zend/tests/traits/static_002.phpt +++ b/Zend/tests/traits/static_002.phpt @@ -20,4 +20,4 @@ Simas Toleikis simast@gmail.com ?> --EXPECT-- -Test +Test
\ No newline at end of file diff --git a/Zend/tests/traits/static_003.phpt b/Zend/tests/traits/static_003.phpt index 7417083f69..01953cf724 100644 --- a/Zend/tests/traits/static_003.phpt +++ b/Zend/tests/traits/static_003.phpt @@ -24,4 +24,4 @@ Simas Toleikis simast@gmail.com ?> --EXPECT-- -Test B +Test B
\ No newline at end of file diff --git a/Zend/tests/traits/static_004.phpt b/Zend/tests/traits/static_004.phpt index ca02a85e80..3c3f380908 100644 --- a/Zend/tests/traits/static_004.phpt +++ b/Zend/tests/traits/static_004.phpt @@ -19,4 +19,4 @@ Simas Toleikis simast@gmail.com ?> --EXPECT-- -Test +Test
\ No newline at end of file diff --git a/Zend/tests/traits/static_forward_static_call.phpt b/Zend/tests/traits/static_forward_static_call.phpt index 9ba53bf08a..9cda8aee1d 100644 --- a/Zend/tests/traits/static_forward_static_call.phpt +++ b/Zend/tests/traits/static_forward_static_call.phpt @@ -25,4 +25,4 @@ Simas Toleikis simast@gmail.com ?> --EXPECT-- -Forwarded Test A +Forwarded Test A
\ No newline at end of file diff --git a/Zend/tests/traits/static_get_called_class.phpt b/Zend/tests/traits/static_get_called_class.phpt index b1d8fa3d1e..bd7a603712 100644 --- a/Zend/tests/traits/static_get_called_class.phpt +++ b/Zend/tests/traits/static_get_called_class.phpt @@ -21,4 +21,4 @@ Simas Toleikis simast@gmail.com ?> --EXPECT-- -B +B
\ No newline at end of file diff --git a/Zend/tests/traits/trait_constant_002.phpt b/Zend/tests/traits/trait_constant_002.phpt index ebd75094e6..ece3f61f9d 100644 --- a/Zend/tests/traits/trait_constant_002.phpt +++ b/Zend/tests/traits/trait_constant_002.phpt @@ -24,4 +24,4 @@ __TRAIT__: Use outside of traits. --EXPECT-- string(0) "" string(0) "" -string(0) "" +string(0) ""
\ No newline at end of file diff --git a/Zend/tests/try/bug72629.phpt b/Zend/tests/try/bug72629.phpt index 034a63b306..2d596c78f8 100644 --- a/Zend/tests/try/bug72629.phpt +++ b/Zend/tests/try/bug72629.phpt @@ -11,5 +11,6 @@ try { } catch (Exception $e) { } var_dump($var === $e); + --EXPECT-- bool(true) diff --git a/Zend/tests/try/bug74444.phpt b/Zend/tests/try/bug74444.phpt index 74e0c9d46f..838d12ef03 100644 --- a/Zend/tests/try/bug74444.phpt +++ b/Zend/tests/try/bug74444.phpt @@ -72,5 +72,6 @@ function foo() } foo(); + --EXPECT-- 12 diff --git a/Zend/tests/try/try_finally_012.phpt b/Zend/tests/try/try_finally_012.phpt index a099ed3d6b..32fec7ab29 100644 --- a/Zend/tests/try/try_finally_012.phpt +++ b/Zend/tests/try/try_finally_012.phpt @@ -29,3 +29,4 @@ try { --EXPECT-- finally exception in main + diff --git a/Zend/tests/try/try_finally_022.phpt b/Zend/tests/try/try_finally_022.phpt index ff10dead42..51f6a26419 100644 --- a/Zend/tests/try/try_finally_022.phpt +++ b/Zend/tests/try/try_finally_022.phpt @@ -38,3 +38,4 @@ try{ ?> --EXPECT-- exception2 + diff --git a/Zend/tests/try/try_multicatch_006.phpt b/Zend/tests/try/try_multicatch_006.phpt index 440e06593c..e4505f1b24 100644 --- a/Zend/tests/try/try_multicatch_006.phpt +++ b/Zend/tests/try/try_multicatch_006.phpt @@ -19,3 +19,4 @@ try { TRY Exception3 FINALLY + diff --git a/Zend/tests/try/try_multicatch_007.phpt b/Zend/tests/try/try_multicatch_007.phpt index 40784108a0..aa073b0592 100644 --- a/Zend/tests/try/try_multicatch_007.phpt +++ b/Zend/tests/try/try_multicatch_007.phpt @@ -19,3 +19,4 @@ try { TRY Exception4 FINALLY + diff --git a/Zend/tests/type_declarations/callable_001.phpt b/Zend/tests/type_declarations/callable_001.phpt index 3113bedcf0..0466288d59 100644 --- a/Zend/tests/type_declarations/callable_001.phpt +++ b/Zend/tests/type_declarations/callable_001.phpt @@ -36,3 +36,4 @@ array(2) { } object(Closure)#%d (0) { } + diff --git a/Zend/tests/type_declarations/callable_002.phpt b/Zend/tests/type_declarations/callable_002.phpt index 35564ff1af..01b6945755 100644 --- a/Zend/tests/type_declarations/callable_002.phpt +++ b/Zend/tests/type_declarations/callable_002.phpt @@ -24,3 +24,4 @@ var_dump($rc->getParameters()[0]->isCallable()); bool(true) bool(true) bool(true) + diff --git a/Zend/tests/type_declarations/callable_003.phpt b/Zend/tests/type_declarations/callable_003.phpt index 3489c32d37..b5e722cae3 100644 --- a/Zend/tests/type_declarations/callable_003.phpt +++ b/Zend/tests/type_declarations/callable_003.phpt @@ -18,3 +18,4 @@ string(6) "strpos" int(123) string(6) "strpos" string(6) "substr" + diff --git a/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt b/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt index 8aec0c009f..2f6c881017 100644 --- a/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt +++ b/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt @@ -13,3 +13,4 @@ Stack trace: #0 %s(%d): foo(NULL) #1 {main} thrown in %s on line %d + diff --git a/Zend/tests/type_declarations/iterable_001.phpt b/Zend/tests/type_declarations/iterable_001.phpt index c6f2a0765d..f0c8bba610 100644 --- a/Zend/tests/type_declarations/iterable_001.phpt +++ b/Zend/tests/type_declarations/iterable_001.phpt @@ -22,6 +22,7 @@ try { } catch (Throwable $e) { echo $e->getMessage(); } + --EXPECTF-- array(3) { [0]=> diff --git a/Zend/tests/type_declarations/iterable_002.phpt b/Zend/tests/type_declarations/iterable_002.phpt index b9e02e40cd..74f6d83f1e 100644 --- a/Zend/tests/type_declarations/iterable_002.phpt +++ b/Zend/tests/type_declarations/iterable_002.phpt @@ -17,4 +17,5 @@ function baz(iterable $iterable = 1) { ?> --EXPECTF-- + Fatal error: Default value for parameters with iterable type can only be an array or NULL in %s on line %d diff --git a/Zend/tests/type_declarations/iterable_004.phpt b/Zend/tests/type_declarations/iterable_004.phpt index 58b3f67f40..47e79fa6b3 100644 --- a/Zend/tests/type_declarations/iterable_004.phpt +++ b/Zend/tests/type_declarations/iterable_004.phpt @@ -21,4 +21,5 @@ class Bar extends Foo { ?> --EXPECTF-- + Warning: Declaration of Bar::testScalar(iterable $iterable) should be compatible with Foo::testScalar(int $int) in %s on line %d diff --git a/Zend/tests/type_declarations/iterable_005.phpt b/Zend/tests/type_declarations/iterable_005.phpt index 39dede3b5c..9c0584b51a 100644 --- a/Zend/tests/type_declarations/iterable_005.phpt +++ b/Zend/tests/type_declarations/iterable_005.phpt @@ -29,4 +29,5 @@ class TestScalar extends Test { ?> --EXPECTF-- + Fatal error: Declaration of TestScalar::method(): int must be compatible with Test::method(): iterable in %s on line %d diff --git a/Zend/tests/type_declarations/nullable_null.phpt b/Zend/tests/type_declarations/nullable_null.phpt new file mode 100644 index 0000000000..61b05e995b --- /dev/null +++ b/Zend/tests/type_declarations/nullable_null.phpt @@ -0,0 +1,11 @@ +--TEST-- +nullable class +--FILE-- +<?php +function test(Foo $a = null) { + echo "ok\n"; +} +test(null); +?> +--EXPECT-- +ok diff --git a/Zend/tests/type_declarations/parameter_type_variance.phpt b/Zend/tests/type_declarations/parameter_type_variance.phpt new file mode 100644 index 0000000000..61915a2e6c --- /dev/null +++ b/Zend/tests/type_declarations/parameter_type_variance.phpt @@ -0,0 +1,34 @@ +--TEST-- +Parameter variance with no type +--FILE-- +<?php + +class Foo { + function testParentClass(Foo $foo) {} + function testBothClass(Foo $foo) {} + function testChildClass($foo) {} + function testNoneClass($foo) {} + + function testParentBuiltin(int $foo) {} + function testBothBuiltin(int $foo) {} + function testChildBuiltin($foo) {} + function testNoneBuiltin($foo) {} +} + +class Bar extends Foo { + function testParentClass($foo) {} + function testBothClass(Foo $foo) {} + function testChildClass(Foo $foo) {} + function testNoneClass($foo) {} + + function testParentBuiltin($foo) {} + function testBothBuiltin(int $foo) {} + function testChildBuiltin(int $foo) {} + function testNoneBuiltin($foo) {} +} + +?> +--EXPECTF-- +Warning: Declaration of Bar::testChildClass(Foo $foo) should be compatible with Foo::testChildClass($foo) in %s on line %d + +Warning: Declaration of Bar::testChildBuiltin(int $foo) should be compatible with Foo::testChildBuiltin($foo) in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt index a8dc4818ed..51c3664737 100644 --- a/Zend/tests/type_declarations/scalar_basic.phpt +++ b/Zend/tests/type_declarations/scalar_basic.phpt @@ -59,6 +59,7 @@ foreach ($functions as $type => $function) { echo PHP_EOL . "Done"; ?> --EXPECTF-- + Testing 'int' type: *** Trying int(1) diff --git a/Zend/tests/type_declarations/scalar_float_with_invalid_default.phpt b/Zend/tests/type_declarations/scalar_float_with_invalid_default.phpt index fd7f96ab95..7bc2fda2b9 100644 --- a/Zend/tests/type_declarations/scalar_float_with_invalid_default.phpt +++ b/Zend/tests/type_declarations/scalar_float_with_invalid_default.phpt @@ -12,4 +12,5 @@ test(); ?> --EXPECTF-- + Fatal error: Default value for parameters with a float type can only be float, integer, or NULL in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_strict_declaration_placement_005.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_005.phpt index 3228c03fe5..8611a205cf 100644 --- a/Zend/tests/type_declarations/scalar_strict_declaration_placement_005.phpt +++ b/Zend/tests/type_declarations/scalar_strict_declaration_placement_005.phpt @@ -11,4 +11,4 @@ var_dump(strlen("abc")); ?> --EXPECTF-- -int(3) +int(3)
\ No newline at end of file diff --git a/Zend/tests/type_declarations/scalar_strict_declaration_placement_006.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_006.phpt index 69e7775eed..2af05b6c65 100644 --- a/Zend/tests/type_declarations/scalar_strict_declaration_placement_006.phpt +++ b/Zend/tests/type_declarations/scalar_strict_declaration_placement_006.phpt @@ -22,4 +22,4 @@ var_dump(strlen("abc")); ?> --EXPECTF-- -int(3) +int(3)
\ No newline at end of file diff --git a/Zend/tests/type_declarations/scalar_strict_declaration_placement_007.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_007.phpt index 519d75dde1..3e4c693afb 100644 --- a/Zend/tests/type_declarations/scalar_strict_declaration_placement_007.phpt +++ b/Zend/tests/type_declarations/scalar_strict_declaration_placement_007.phpt @@ -22,4 +22,4 @@ var_dump(strlen("abc")); ?> --EXPECTF-- -int(3) +int(3)
\ No newline at end of file diff --git a/Zend/tests/type_declarations/scalar_strict_declaration_placement_008.phpt b/Zend/tests/type_declarations/scalar_strict_declaration_placement_008.phpt index b5ddc9f0d3..87a09af96c 100644 --- a/Zend/tests/type_declarations/scalar_strict_declaration_placement_008.phpt +++ b/Zend/tests/type_declarations/scalar_strict_declaration_placement_008.phpt @@ -8,4 +8,4 @@ declare(strict_types=1) { ?> --EXPECTF-- -Fatal error: strict_types declaration must not use block mode in %s on line %d +Fatal error: strict_types declaration must not use block mode in %s on line %d
\ No newline at end of file diff --git a/Zend/tests/type_declarations/strict_call_weak.phpt b/Zend/tests/type_declarations/strict_call_weak.phpt index aa0530b9ae..e3a606ec12 100644 --- a/Zend/tests/type_declarations/strict_call_weak.phpt +++ b/Zend/tests/type_declarations/strict_call_weak.phpt @@ -18,3 +18,4 @@ Stack trace: #0 %s(%d): function_declared_in_weak_mode(1) #1 {main} thrown in %sstrict_call_weak_2.inc on line 5 + diff --git a/Zend/tests/type_declarations/strict_call_weak_explicit.phpt b/Zend/tests/type_declarations/strict_call_weak_explicit.phpt index 1e234ab32d..22c5b4319c 100644 --- a/Zend/tests/type_declarations/strict_call_weak_explicit.phpt +++ b/Zend/tests/type_declarations/strict_call_weak_explicit.phpt @@ -18,3 +18,4 @@ Stack trace: #0 %s(%d): function_declared_in_weak_mode(1) #1 {main} thrown in %sstrict_call_weak_explicit_2.inc on line 5 + diff --git a/Zend/tests/unset_cast_deprecated.phpt b/Zend/tests/unset_cast_deprecated.phpt new file mode 100644 index 0000000000..6744c85f02 --- /dev/null +++ b/Zend/tests/unset_cast_deprecated.phpt @@ -0,0 +1,14 @@ +--TEST-- +The (unset) cast is deprecated +--FILE-- +<?php + +$x = 1; +var_dump((unset) $x); +var_dump($x); + +?> +--EXPECTF-- +Deprecated: The (unset) cast is deprecated in %s on line %d +NULL +int(1) diff --git a/Zend/tests/unset_cv05.phpt b/Zend/tests/unset_cv05.phpt index 936f0fb2a8..f7a2736bc6 100644 --- a/Zend/tests/unset_cv05.phpt +++ b/Zend/tests/unset_cv05.phpt @@ -12,18 +12,11 @@ include(dirname(__FILE__).'/../../ext/session/tests/skipif.inc'); --FILE-- <?php $_SESSION = "ok\n"; -echo $_SESSION; session_start(); echo $_SESSION; echo "\nok\n"; ?> --EXPECTF-- -ok - -Warning: session_start(): Cannot send session cookie - headers already sent by (output started at %sunset_cv05.php on line %d - -Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at %sunset_cv05.php:%d) in %sunset_cv05.php on line %d - Notice: Array to string conversion in %sunset_cv05.php on line %d Array ok diff --git a/Zend/tests/unset_cv07.phpt b/Zend/tests/unset_cv07.phpt deleted file mode 100644 index 3f893ca235..0000000000 --- a/Zend/tests/unset_cv07.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -unset() CV 7 (indirect unset() of global variable in import_request_variables()) ---SKIPIF-- -<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?> ---GET-- -x=2 ---FILE-- -<?php -$_x = "1\n"; -echo $_x; -import_request_variables("g","_"); -echo $_x; -echo "\nok\n"; -?> ---EXPECTF-- -1 -2 -ok diff --git a/Zend/tests/unused_shared_static_variables.phpt b/Zend/tests/unused_shared_static_variables.phpt new file mode 100644 index 0000000000..fc87a19f6a --- /dev/null +++ b/Zend/tests/unused_shared_static_variables.phpt @@ -0,0 +1,16 @@ +--TEST-- +Cleanup of shared static variables HT that has never been used should not assert +--FILE-- +<?php + +class A { + public function test() { + static $x; + } +} +class B extends A {} + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/tests/use_function/conditional_function_declaration.phpt b/Zend/tests/use_function/conditional_function_declaration.phpt index ccfb96103a..02ac0803f0 100644 --- a/Zend/tests/use_function/conditional_function_declaration.phpt +++ b/Zend/tests/use_function/conditional_function_declaration.phpt @@ -1,5 +1,5 @@ --TEST-- -function that is conditionally defined at runtime should not cause compiler error +function that is conditionally defined is subject to symbol use checks --FILE-- <?php @@ -13,5 +13,5 @@ use function bar\foo; echo "Done"; ?> ---EXPECT-- -Done +--EXPECTF-- +Fatal error: Cannot use function bar\foo as foo because the name is already in use in %s on line %d diff --git a/Zend/tests/use_late_binding_conflict.phpt b/Zend/tests/use_late_binding_conflict.phpt new file mode 100644 index 0000000000..c8514d0b1a --- /dev/null +++ b/Zend/tests/use_late_binding_conflict.phpt @@ -0,0 +1,13 @@ +--TEST-- +Use conflicts are detected for late-bound classes +--FILE-- +<?php + +/* Reverse declaration order disables early-binding */ +class B extends A {} +class A {} +use Foo\B; + +?> +--EXPECTF-- +Fatal error: Cannot use Foo\B as B because the name is already in use in %s on line %d diff --git a/Zend/tests/use_no_eval_conflict.phpt b/Zend/tests/use_no_eval_conflict.phpt new file mode 100644 index 0000000000..cf9014b77d --- /dev/null +++ b/Zend/tests/use_no_eval_conflict.phpt @@ -0,0 +1,13 @@ +--TEST-- +Use conflicts should not occur across eval()s +--FILE-- +<?php + +/* It is important that these two eval()s occur on the same line, + * as this forces them to have the same filename. */ +eval("class A {}"); eval("use Foo\A;"); + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/tests/varSyntax/constClassMemberAccess.phpt b/Zend/tests/varSyntax/constClassMemberAccess.phpt index 6df485b5c9..41d871abb3 100644 --- a/Zend/tests/varSyntax/constClassMemberAccess.phpt +++ b/Zend/tests/varSyntax/constClassMemberAccess.phpt @@ -24,4 +24,4 @@ array(1) { ["b"]=> string(1) "c" } -string(1) "c" +string(1) "c"
\ No newline at end of file diff --git a/Zend/tests/varSyntax/propertyOfStringError.phpt b/Zend/tests/varSyntax/propertyOfStringError.phpt index 85abc5849a..4fa50e7df0 100644 --- a/Zend/tests/varSyntax/propertyOfStringError.phpt +++ b/Zend/tests/varSyntax/propertyOfStringError.phpt @@ -7,4 +7,4 @@ Cannot take property of a string ?> --EXPECTF-- -Notice: Trying to get property of non-object in %s on line %d +Notice: Trying to get property 'bar' of non-object in %s on line %d diff --git a/Zend/tests/zend_signed_multiply-64bit-2.phpt b/Zend/tests/zend_signed_multiply-64bit-2.phpt new file mode 100644 index 0000000000..f0a3bafa5e --- /dev/null +++ b/Zend/tests/zend_signed_multiply-64bit-2.phpt @@ -0,0 +1,149 @@ +--TEST-- +Zend signed multiply 64-bit, variation 2 +--SKIPIF-- +<?php if ((1 << 31) < 0) print "skip Running on 32-bit target"; ?> +--FILE-- +<?php +for($c = -16; $c < 0; $c++) { + var_dump($c, intdiv(PHP_INT_MIN, 10), intdiv(PHP_INT_MIN, 10) * $c); + echo "-----------\n"; +} +for($c = 0; $c <= 16; $c++) { + var_dump($c, intdiv(PHP_INT_MAX, 10), intdiv(PHP_INT_MAX, 10) * $c); + echo "-----------\n"; +} +?> +--EXPECTF-- +int(-16) +int(-922337203685477580) +float(1.4757395258968E+19) +----------- +int(-15) +int(-922337203685477580) +float(1.3835058055282E+19) +----------- +int(-14) +int(-922337203685477580) +float(1.2912720851597E+19) +----------- +int(-13) +int(-922337203685477580) +float(1.1990383647911E+19) +----------- +int(-12) +int(-922337203685477580) +float(1.1068046444226E+19) +----------- +int(-11) +int(-922337203685477580) +float(1.014570924054E+19) +----------- +int(-10) +int(-922337203685477580) +int(9223372036854775800) +----------- +int(-9) +int(-922337203685477580) +int(8301034833169298220) +----------- +int(-8) +int(-922337203685477580) +int(7378697629483820640) +----------- +int(-7) +int(-922337203685477580) +int(6456360425798343060) +----------- +int(-6) +int(-922337203685477580) +int(5534023222112865480) +----------- +int(-5) +int(-922337203685477580) +int(4611686018427387900) +----------- +int(-4) +int(-922337203685477580) +int(3689348814741910320) +----------- +int(-3) +int(-922337203685477580) +int(2767011611056432740) +----------- +int(-2) +int(-922337203685477580) +int(1844674407370955160) +----------- +int(-1) +int(-922337203685477580) +int(922337203685477580) +----------- +int(0) +int(922337203685477580) +int(0) +----------- +int(1) +int(922337203685477580) +int(922337203685477580) +----------- +int(2) +int(922337203685477580) +int(1844674407370955160) +----------- +int(3) +int(922337203685477580) +int(2767011611056432740) +----------- +int(4) +int(922337203685477580) +int(3689348814741910320) +----------- +int(5) +int(922337203685477580) +int(4611686018427387900) +----------- +int(6) +int(922337203685477580) +int(5534023222112865480) +----------- +int(7) +int(922337203685477580) +int(6456360425798343060) +----------- +int(8) +int(922337203685477580) +int(7378697629483820640) +----------- +int(9) +int(922337203685477580) +int(8301034833169298220) +----------- +int(10) +int(922337203685477580) +int(9223372036854775800) +----------- +int(11) +int(922337203685477580) +float(1.014570924054E+19) +----------- +int(12) +int(922337203685477580) +float(1.1068046444226E+19) +----------- +int(13) +int(922337203685477580) +float(1.1990383647911E+19) +----------- +int(14) +int(922337203685477580) +float(1.2912720851597E+19) +----------- +int(15) +int(922337203685477580) +float(1.3835058055282E+19) +----------- +int(16) +int(922337203685477580) +float(1.4757395258968E+19) +----------- + diff --git a/Zend/tests/zend_signed_multiply-64bit.phpt b/Zend/tests/zend_signed_multiply-64bit.phpt index 94a6e035fa..d392b2e78a 100644 --- a/Zend/tests/zend_signed_multiply-64bit.phpt +++ b/Zend/tests/zend_signed_multiply-64bit.phpt @@ -1,5 +1,5 @@ --TEST-- -Zend signed multiply 64-bit +Zend signed multiply 64-bit, variation 1 --SKIPIF-- <?php if ((1 << 31) < 0) print "skip Running on 32-bit target"; ?> --FILE-- |