Reference - Parms functions - intdiv


App: manual - Page: fragments/expressions_44


App: regression/framework - Page: lenient/a_php_function_refusing_its_arguments_answers_empty
PHP
lenient/a_php_function_refusing_its_arguments_answers_empty.php
HTML
lenient/a_php_function_refusing_its_arguments_answers_empty.pad
Result
<?php

// The lenient walk under test: with the syntax check off, what cannot run passes the
// value through or yields empty, and the walk carries on.

$padCheckSyntax = FALSE;

?>
[{echo php:str_repeat('x', -1)}][{echo 'ab' | php:str_pad(8, '*')}][{echo php:intdiv(1, 0)}]


App: regression/framework - Page: tags/an_ifchanged_inside_a_condition_or_a_snippet_remembers_the_rows_of_the_loop
PHP
tags/an_ifchanged_inside_a_condition_or_a_snippet_remembers_the_rows_of_the_loop.php
HTML
tags/an_ifchanged_inside_a_condition_or_a_snippet_remembers_the_rows_of_the_loop.pad
Result
<?php

$items
= [ [ 'n' => 1, 'g' => 'x' ], [ 'n' => 2, 'g' => 'x' ], [ 'n' => 3, 'g' => 'y' ], [ 'n' => 4, 'g' => 'y' ] ];

?>
[{items}{guest}{ifchanged $g}<{$g}>{/ifchanged}{/guest}{$n} {/items}]
[{items}{true}{ifchanged $g}<{$g}>{/ifchanged}{/true}{$n} {/items}]
[{items}{notFirst@items}{ifchanged $g}|{/ifchanged}{/notFirst@items}{$n} {/items}]
[{define 'heading'}{ifchanged $g}<{$g}>{/ifchanged}{/define}{items}{heading}{$n} {/items}]
[{set $i = 0}{while $i lt 5}{increment $i}{guest}{ifchanged php:intdiv($i,2)}<h>{/ifchanged}{/guest}{$i}{/while}]