--- /dev/null
+--TEST--
+Don't statically bind arguments for self:: calls in traits
+--FILE--
+<?php
+
+trait T {
+ public static function method($arg) {
+ }
+ public static function call() {
+ $i = 0;
+ self::method($i);
+ var_dump($i);
+ }
+}
+
+class C {
+ use T;
+
+ public static function method(&$arg) {
+ $arg++;
+ }
+}
+
+C::call();
+
+?>
+--EXPECT--
+int(1)
zend_string *class_name = Z_STR_P(&ZEND_OP1_LITERAL(opline) + 1);
ce = zend_hash_find_ptr(&ctx->script->class_table, class_name);
} else if (opline->op1_type == IS_UNUSED && op_array->scope
+ && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)
&& (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) {
ce = op_array->scope;
}