Changes between Initial Version and Version 1 of Ticket #45374, comment 5
- Timestamp:
- 12/06/2018 07:33:34 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #45374, comment 5
initial v1 19 19 // Somehow the &$this does not work. 20 20 apply_filters_ref_array('testFilter', ['test', &$this]); 21 apply_filters_ref_array('testFilter', array('Test', &$this));21 apply_filters_ref_array('testFilter', array('Test', $this)); 22 22 23 23 // It seems to be limited to filter. … … 27 27 (new Test())->run(); 28 28 29 $object = new Test(); 30 apply_filters_ref_array('testFilter', ['test', $object]); 29 31 /** 30 * Th ese donot throw.32 * This does not throw. 31 33 */ 32 $object = new Test(); 33 apply_filters_ref_array('posts_clauses2', ['test', $object]); 34 apply_filters_ref_array('posts_clauses2', ['test', &$object]); 34 apply_filters_ref_array('testFilter', ['test', &$object]); 35 35 }}} 36 36 … … 44 44 45 45 As you can see, here `$this` is not referenced, although I do ''not'' change the `$args`. Also noteworthy, in this example I can change `$args[0]` without having another problem (except for the PHP 7.1.25). 46 47 ''Edit: I edited my code example for clarification, but it didn't change my outcomes.''