1. Backward Incompatible Changes
========================================
+- Core:
+ . Referencing parent:: inside a class that does not have a parent will now
+ generate a compile-time error. Previously the error was only emitted at
+ run-time.
+
- Curl:
. Attempting to serialize a CURLFile class will now generate an exception.
Previously the exception was only thrown on unserialization.
class A
{
var $_stdObject;
- function initialize($properties = FALSE) {
- $this->_stdObject = $properties ? (object) $properties : new stdClass();
- parent::initialize();
- }
function &__get($property)
{
if (isset($this->_stdObject->{$property})) {
class B extends A
{
- function initialize($properties = array())
- {
- parent::initialize($properties);
- }
function &__get($property)
{
if (isset($this->settings) && isset($this->settings[$property])) {
static void zend_ensure_valid_class_fetch_type(uint32_t fetch_type) /* {{{ */
{
- if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && !CG(active_class_entry) && zend_is_scope_known()) {
- zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"%s\" when no class scope is active",
- fetch_type == ZEND_FETCH_CLASS_SELF ? "self" :
- fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static");
+ if (fetch_type != ZEND_FETCH_CLASS_DEFAULT && zend_is_scope_known()) {
+ zend_class_entry *ce = CG(active_class_entry);
+ if (!ce) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use \"%s\" when no class scope is active",
+ fetch_type == ZEND_FETCH_CLASS_SELF ? "self" :
+ fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static");
+ } else if (fetch_type == ZEND_FETCH_CLASS_PARENT && !ce->parent_name) {
+ zend_error_noreturn(E_COMPILE_ERROR,
+ "Cannot use \"parent\" when current class scope has no parent");
+ }
}
}
/* }}} */