Beispiel #1
0
?>
--FILE--
<?php 
class pass
{
    private static function show()
    {
        echo "Call show()\n";
    }
    public static function do_show()
    {
        pass::show();
    }
}
class fail extends pass
{
    static function do_show()
    {
        pass::show();
    }
}
pass::do_show();
fail::do_show();
echo "Done\n";
// shouldn't be displayed
?>
--EXPECTF--
Call show()

Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d, position %d
Beispiel #2
0
<?php 
class pass
{
    private function show()
    {
        echo "Call show()\n";
    }
    public function do_show()
    {
        $this->show();
    }
}
class fail extends pass
{
    function do_show()
    {
        $this->show();
    }
}
$t = new pass();
$t->do_show();
$t2 = new fail();
$t2->do_show();
echo "Done\n";
// shouldn't be displayed
?>
--EXPECTF--
Call show()

Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d, position %d
Beispiel #3
0
 static function do_show()
 {
     fail::show();
 }
Beispiel #4
0
--SKIPIF--
<?php 
if (version_compare(zend_version(), '2.0.0-dev', '<')) {
    die('skip ZendEngine 2 needed');
}
?>
--FILE--
<?php 
abstract class fail
{
    abstract function show();
}
class pass extends fail
{
    function show()
    {
        echo "Call to function show()\n";
    }
}
$t2 = new pass();
$t2->show();
$t = new fail();
$t->show();
echo "Done\n";
// shouldn't be displayed
?>
--EXPECTF--
Call to function show()

Fatal error: Cannot instantiate abstract class fail in %s on line %d, position %d
Beispiel #5
0
<?php

interface showable
{
    static function show();
}
class pass implements showable
{
    static function show()
    {
        echo "Call to function show()\n";
    }
}
pass::show();
eval('
class fail
{
	abstract static function func();
}
');
fail::show();
echo "Done\n";
// shouldn't be displayed
Beispiel #6
0
[file]
<?php 
error_reporting(0);
class pass
{
    private function show()
    {
        echo "Call show()\n";
    }
    protected function good()
    {
        $this->show();
    }
}
class fail extends pass
{
    public function ok()
    {
        $this->good();
    }
    public function not_ok()
    {
        $this->show();
    }
}
$t = new fail();
$t->ok();
$t->not_ok();
// calling a private function
echo "Done\n";
// shouldn't be displayed
Beispiel #7
0
 function error()
 {
     parent::show();
 }
Beispiel #8
0
[expect ct-error]
[file]
<?php 
error_reporting(0);
class pass
{
    private static function show()
    {
        echo "Call show()\n";
    }
    protected static function good()
    {
        pass::show();
    }
}
class fail extends pass
{
    static function ok()
    {
        pass::good();
    }
    static function not_ok()
    {
        pass::show();
    }
}
fail::ok();
fail::not_ok();
// calling a private function
echo "Done\n";
// shouldn't be displayed
 public function dbQuery($inst, $query, $last = 0)
 {
     mysqli_query($this->instances[$inst], 'SET NAMES UTF8');
     $this->logq .= $query . "\n";
     $this->dbQuery = $query;
     if ($this->instances[$inst] == '') {
         return -1;
     }
     $_SESSION['logg'][] = 'Zapytanie: ' . $query . ' w instancji: ' . $inst . $_SESSION['nl'];
     $this->dbQueryRet[$inst] = mysqli_query($this->instances[$inst], $query);
     if ($last == 'LAST_INSERT_ID') {
         $this->lastInsertId[$inst] = mysqli_insert_id($this->instances[$inst]);
     }
     if (mysqli_error($this->instances[$inst])) {
         $this->config['all_ok'] = false;
         if ($this->config['send_errors'] == 'true') {
             $fail = new fail();
             $fail->fill_data('Query: ', $query);
             $fail->fill_data('Error: ', mysql_error($this->instances[$inst]));
             $fail->send();
         }
         if ($this->config['debug'] == 'true') {
             echo "<BR><BR>Query: " . $query;
             echo "<BR><BR>";
             echo mysql_error($this->instances[$inst]);
             echo "<BR><BR>";
         }
         return -1;
     }
     return $this->dbQueryRet[$inst];
 }