function my_class_wrapper()
{
    $gen = my_class::my_member_generator();
    $gen->next();
    $gen->send(null);
}
Exemple #2
0
<?php

trait my_trait
{
    abstract function foo();
    public function bar()
    {
        echo "I am bar\n";
        self::foo();
    }
}
class my_class
{
    use my_trait;
    private function foo()
    {
        echo "I am foo\n";
    }
}
$o = new my_class();
$o->bar();
Exemple #3
0
//class my_extended_class extends my_class
//{
//    public function myMethod($val)
//    {
//        echo($this->a."\n");
//        echo($this->b."\n");
//        echo("hoi\n");
//
//        parent::myMethod($val);
//    }
//
//}
//
//$x = new my_extended_class();
//$x->myMethod(123);
$x = new my_class();
$x->myMethod();
//echo(my_plus(1,2,3,4)."\n");
$array = array();
for ($i = 0; $i < 10000; $i++) {
    $array[] = rand();
}
//$array = array(1,2,3);
//print_r($array);
//bubblesort($array);
//print_r($array);
//echo("my_class::a = ".$x->a."\n");
//echo("my_class::b = ".$x->b."\n");
//
//unset($x);
//
{
    printf("%d%d", $var, $var);
}
my_func_without_ret($my_func_without_ret_var);
// WARN LINE 62
my_func_without_ret($_GET['my_func_without_ret_spec_var']);
// ALERT LINE 62
my_func_without_ret(htmlspecialchars($_GET['my_func_without_ret_spec_var']));
// NONE
function my_func_with_ret($var)
{
    return $var;
}
$my_func_with_ret_var = "my_func_with_ret_var";
echo my_func_with_ret($my_func_with_ret_var);
// WARN LINE 72
my_func($_GET['my_func_spec_var']);
// ALERT INCLUDE_FILE LINE 7 & 8
$my_func_spec_var = $_GET['my_func_spec_var'];
my_func($_GET['my_func_spec_var']);
// ALERT INCLUDE_FILE LINE 7 & 8
my_func(addslashes($_GET['my_func_spec_var']));
// WARN INCLUDE_FILE LINE 8
my_func($my_func_spec_var);
// WARN INCLUDE_FILE LINE 7 & 8
$my_static_func_spec_var = $_GET['my_static_func_spec_var'];
my_class::my_static_func($my_static_func_spec_var);
// ALERT INCLUDE_FILE LINE 16 & 17 & 18
$my_class_instance = new my_class();
$my_class_instance->my_func();
// WARN INCLUDE_FILE LINE 22 & 23 & 24
Exemple #5
0
    public $my_value = array();
    function __construct($host, $user, $password, $value)
    {
        $mysqlcon1 = mysql_connect($host, $user, $password);
        if (!$mysqlcon1) {
            return false;
            //die('Could not connect: '.mysql_error());
            echo "h";
        }
        $this->my_value[] = $mysqlcon1;
        echo $this->my_value[0];
        echo $mysqlcon1;
    }
    function set_value($value)
    {
        if (!is_array($value)) {
            throw new Exception("Illegal argument");
        }
        $this->my_value = $value;
        echo $this->my_value[0];
    }
    function add_value($value)
    {
        $this->my_value = $value;
        echo $this->my_value[0];
    }
}
$a = new my_class("localhost", "user_info", "mLR7ZV7HnDsPQ4ts", 'a');
$a->my_value[] = 'b';
$a->add_value('c');
$a->set_value(array('d'));