pear-core: Remove calls with incompatible Context

revision 4fed1aa2dba6e1d0c092b8c81fe30c9c01f3e8f4

raw

phork0.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
 * https://github.com/php/php-src/pull/1026
 * https://wiki.php.net/rfc/incompat_ctx
 */
class A
{
    function bNon()
    {
        //i'm not interested in this
        echo "A::bNon\n";
    }
 
    static function cStat()
    {
        if (isset($this)) {
            //static method has been called non-statically
            //$this is instance of A
            echo '$a->cStat' . "\n";
        } else {
            //static method has been called statically
            echo "A::cStat\n";
        }
    }
 
 
    static function dStaticVarHack()
    {
        $his = 'this';
        if (isset($$his)) {
            //static method has been called non-statically
            //$this is instance of A
            echo '$a->dStaticVarHack' . "\n";
        } else {
            //static method has been called statically
            echo "A::dStaticVarHack\n";
        }
    }
}
 
//this should fail, that's fine
A::bNon();
 
//but this should work both:
A::cStat();
$a = new A();
$a->cStat();
 
//but this should work both:
A::dStaticVarHack();
$a = new A();
$a->dStaticVarHack();
?>

History