note 127482 added to function.print

From: Date: Thu, 11 Aug 2022 14:43:06 +0000
Subject: note 127482 added to function.print
Groups: php.notes 
Request: Send a blank email to php-notes+get-219420@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 not with echo? <?php array_walk($heroes, fn($hero) => print $hero);?> ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.133 (proxied: 2003:ed:8f22:af38:4144:38d5:40b5:1045) ---- Manual Page -- https://php.net/manual/en/function.print.php Edit -- https://main.php.net/note/edit/127482 Del: integrated -- https://main.php.net/note/delete/127482/integrated Del: useless -- https://main.php.net/note/delete/127482/useless Del: bad code -- https://main.php.net/note/delete/127482/bad+code Del: spam -- https://main.php.net/note/delete/127482/spam Del: non-english -- https://main.php.net/note/delete/127482/non-english Del: in docs -- https://main.php.net/note/delete/127482/in+docs Del: other reasons-- https://main.php.net/note/delete/127482 Reject -- https://main.php.net/note/reject/127482 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219420) next »