Fortunately, Eelco Dolstra had some time to migrate php-front, php-sat and php-tools to Hydra, the new Nix-based continuous build system. After some tweaking we now again have access to unstable build for all PSAT-projects. Go Hydra!
<?phpThe default configuration for echo requires a parameter to have both the level EscapedHTML as well as EscapedSlashes. Furthermore, the default configuration defines the return-type of the functions as:
echo addslashes(htmlentities($_GET['name']));
?>
function: addslashes level: escaped-slashesSo this piece of code should not be flagged by php-sat. Unfortunately, previous revisions did flag this piece of code!
function: htmlentities level: escaped-html
function: addslashes level: escaped-slashes +the example above is not flagged anymore because the call to addslashes is annotated with its own safety-level (EscapedSlashes), as well as the safety-level of its parameter (EscapedHTML). A pretty useful feature I would say.
function: htmlentities level: escaped-html +
<?phpIn this case, echo $bar will be flagged by the latest php-sat.
$foo = $_GET['asdf'];
$bar = 1;
$bar =& $foo;
echo $bar;
?>
add-php-simple-value(|val):This works perfectly, the annotations are matched as a list by the *-syntax, and a list is added as an annotation to the term again. The only problem with this is that the second time this rule is applied it matches the annotations as a list of a list of annotations, which was not the behavior I desired. This problem is easily solved by also adding a * to build the term:
t{a*} -> t{annos}
where b* :=a*
; annos := [PHPSimpleValue(val) | b*]
add-php-simple-value(|val):Now the list of annotations is not wrapped in an actual list anymore. I know it is documented somewhere, but this little explanation might save some others from an headache or a long debug-session.
t{a*} -> t{annos*}
where b* :=a*
; annos* := [PHPSimpleValue(val) | b*]
$foo = array(1,2);When we consider the constant-propagation we first assign the values 1 and 2 to the first two indexes of the array. The value of $_GET['foo'] is then assigned to the third index of the array which is the parameter to echo in the last statement. We know that the value is assigned to the third index because PHP-Front keeps track of the internal index-count of arrays.
$foo[] = $_GET['bar'];
echo $foo[2];
...which is not only tedious, but also a complete violation of the DRY principle.
echo "Type of 5/2 = ", gettype(5/2), "<br />";
...
foreach($types2 as $key2 => $val2){
$code = 'return ' . $val1 .' '.$op.' '.$val2. ';' ;
$result = eval($code);
echo ''. gettype($result) . ' (' . showval($result) . ') ';
}
<?php
function foo($param1, $param2){
$param1 + $param2;
}
$result = foo(1,2);
echo $result;
?>
The creation of the PHP-Sat logo is based
upon the following:
Develop a conceptually strong logo that
uses modern illustration techniques to
make a simple, yet strong ideograph.
This results in a "Bug" stopped by a
imaginary (debug)-filter, the conceptual
base principal behind PHP-Sat.
The logo consists of many complex items
with gradient mesh and three tints, but
together they still form the basis for
this strong and modern ideograph.
Bij de creatie van het PHP-SAT logo is
uitgegaan van het volgende:
Een conceptueel sterk logo neerzetten
dat door middel van moderne
illustratietechnieken een modern maar
toch simpel en sterk beeldmerk is.
Dit resulteert in een Bug die door een
denkbeeldig (debug)-filter vliegt, het
conceptuele basisprincipe achter PHP-SAT.
Het logo bestaat uit veel complexe items
met verloopnetten en 3 kleurtinten, maar
toch vormen zij samen de basis voor dit
sterke en aanwezige, moderne beeldmerk.