note 127469 added to function.print
| From: | MarkusZeller at main dot php dot net | Date: | Tue, 09 Aug 2022 09:52:56 +0000 |
| Subject: | note 127469 added to function.print | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219408@lists.php.net to get a copy of this message | ||
<?php $heroes = ['Superman', 'Batman', 'Flash'];?>
Does not work work, because echo is no function
<?php array_walk($heroes, 'echo');?>
Does not work, because unexpected token "echo"
<?php array_walk($heroes, fn($hero) => echo $hero);?>
Does not work work, because print is no function
<?php array_walk($heroes, 'print');?>
DOES WORK, but why?
<?php array_walk($heroes, fn($hero) => print $hero);?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.133 (proxied: 2003:ed:8f3c:2c91:390a:ca35:b255:1446)
----
Manual Page -- https://php.net/manual/en/function.print.php
Edit -- https://main.php.net/note/edit/127469
Del: integrated -- https://main.php.net/note/delete/127469/integrated
Del: useless -- https://main.php.net/note/delete/127469/useless
Del: bad code -- https://main.php.net/note/delete/127469/bad+code
Del: spam -- https://main.php.net/note/delete/127469/spam
Del: non-english -- https://main.php.net/note/delete/127469/non-english
Del: in docs -- https://main.php.net/note/delete/127469/in+docs
Del: other reasons-- https://main.php.net/note/delete/127469
Reject -- https://main.php.net/note/reject/127469
Search -- https://main.php.net/manage/user-notes.php