Fork me on GitHub
a Sensio Labs Product

15 Keys (v3.52.1) edition

Rule no_mixed_echo_print

Either language construct print or echo should be used.

Configuration

use

The desired language construct.

Allowed values: 'echo' and 'print'

Default value: 'echo'

Examples

Example #1

Default configuration.

--- Original
+++ New
-<?php print 'example';
+<?php echo 'example';

Example #2

With configuration: ['use' => 'print'].

--- Original
+++ New
-<?php echo('example');
+<?php print('example');

Rule sets

The rule is part of the following rule sets:

References

The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.