[ create a new paste ] login | about

Link: http://codepad.org/2ZeswUVO    [ raw code | output | fork ]

PHP, pasted on Feb 18:
1
2
3
4
5
6
7
8
9
<?php

function count2($a){
echo 'called'."\n";
return count($a);
}

$array=array(1,2,3,4);
for($i = 0; $i < count2($array); ++$i) {echo 'for'."\n";}


Output:
1
2
3
4
5
6
7
8
9
called
for
called
for
called
for
called
for
called


Create a new paste based on this one


Comments: