Reference - Parms functions - branchCount


App: regression/framework - Page: expressions/only_the_branch_and_the_side_a_condition_wants_is_worked_out
PHP
expressions/only_the_branch_and_the_side_a_condition_wants_is_worked_out.php
HTML
expressions/only_the_branch_and_the_side_a_condition_wants_is_worked_out.pad
Result
<?php

// Counts its calls, and sets $later, so a field read after it shows whether it was read
// before the call or after.

$branchCalls = 0;
$later = 'before';

function
branchCount ( $value = '' ) {
$GLOBALS ['branchCalls']++;
$GLOBALS ['later'] = 'after';
return
$value;
}

?>
[{echo 1 ? 'yes' : $missing}][{echo 0 ? $missing : 'no'}][{echo 'x' ?: $missing . '!'}][{echo 0 and $missing}][{echo 1 or 7 / 0}][{echo 'ok' ?? (7 / 0)}][{echo 0 and php:branchCount(1)}][{echo 1 || php:branchCount(1)}][{echo 'ok' ?? php:branchCount('e')}][{$branchCalls}][{echo 1 and php:branchCount(1)}][{echo '' ?? php:branchCount('e')}][{$branchCalls}][{echo 'v' | php:branchCount | $later}]