Skip to content

Commit 2f0881e

Browse files
committed
Avoid static call to non-static method
1 parent 231e649 commit 2f0881e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/traits/traits.phpt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ trait T7
238238
}
239239
}
240240

241-
T7::f(); // calls f like a static function with class name being the trait name
241+
// T7::f(); // Static call to non-static method is not allowed
242242

243-
echo "-------\n";
244243
T7::g();
245244

246245
/*
@@ -336,10 +335,6 @@ $v = 1
336335
Inside T6::f
337336
$v = 2
338337
===================== Using a Trait without a Class =========================
339-
%AInside T7
340-
Inside T7
341-
Inside T7::f
342-
-------
343338
Inside T7
344339
Inside T7
345340
Inside T7::g

0 commit comments

Comments
 (0)