Skip to content

Instantly share code, notes, and snippets.

@devosc
Created December 1, 2017 04:50
Show Gist options
  • Save devosc/8e8b7d16af0871a60e4d7317312ed989 to your computer and use it in GitHub Desktop.
Save devosc/8e8b7d16af0871a60e4d7317312ed989 to your computer and use it in GitHub Desktop.
<?php
trait base_trait
{
protected $prop = [];
function __construct()
{
var_dump($this->prop);
}
}
class base_class
{
use base_trait;
}
class test_class_property
extends base_class
{
protected $prop = ['a' => 'b'];
}
trait overlay_trait
{
protected $prop = ['a' => 'b'];
}
class test_class_overlay
extends base_class
{
use overlay_trait;
}
new base_class;
new test_class_property;
new test_class_overlay;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment