|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-08-30 08:44 UTC] kosy_denis at yahoo dot com
<?php
$ar = array(1,2,3,4,5,6,7,8);
$q = count($ar);
function test()
{
echo "<br>in";
static $max = 0;
static $exit_flag = FALSE;
if ( $max < 4 )
{
++$max;
}
else
{
$exit_flag = TRUE;
}
if ($exit_flag)
{
return;
}
global $ar, $q;
$i = 0;
foreach($ar as $a)
//for( $i = 0; $i < $q; ++$i )
{
++$i;
echo "<br> $max - $exit_flag - $i";
if ( $i == ( $q / 2 ) )
{
test();
}
}
echo "<br>---------------";
}
test();
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 11:00:01 2026 UTC |
<?php $ar = array(1,2,3,4,5,6,7,8); $q = count($ar); function test() { global $ar, $q; echo "<br>in"; static $max = 0; $exit_flag = FALSE; if ( $max < 4 ) { ++$max; } else { $exit_flag = TRUE; } if ($exit_flag == true) { return; } $i = 0; foreach($ar as $a) //for( $i = 0; $i < $q; ++$i ) { ++$i; echo "<br> $max - $exit_flag - $i"; if ( $i == ( $q / 2 ) ) { test(); } } echo "<br>---------------"; } test(); ?> Works..