Reference - Single functions - nums


App: manual - Page: fragments/expressions_12
PHP
HTML
fragments/expressions_12.pad
Result
{data 'colors'}["red", "green", "blue"]{/data}
{set $nums = [4, 8, 15]}
{set $title = 'Prefixes'}
<p>{echo constant:PHP_INT_SIZE}</p>
<p>{echo php:count(data:colors)}</p>
<p>{echo php:count(array:nums)} numbers, together {echo array:nums + 0}</p>
<p>{echo php:str_repeat('=', 5)}</p>
<p>{echo field:title | upper}</p>


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

$t
= 1;
$f = 0;
$rows = [ [ 'a' => 1 ], [ 'a' => 2 ] ];
$nums = [ 0, 0 ];
$none = [];

?>
{if array:rows and $t}T{else}F{/if}{if array:rows or $t}T{else}F{/if}{if $t and array:rows}T{else}F{/if}{if array:nums and $t}T{else}F{/if}{if array:none or $f}T{else}F{/if}{if array:none xor $t}T{else}F{/if}{if $f and array:rows}T{else}F{/if}