C:\xampp\php\docs\examples\checkPHP5.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
/**
 * Test tokens that appeared in PHP 5
 *    T_ABSTRACT
 *    T_CATCH
 *    T_FINAL
 *    T_INSTANCEOF
 *    T_PRIVATE
 *    T_PROTECTED
 *    T_PUBLIC
 *    T_THROW
 *    T_TRY
 *    T_CLONE
 *    T_INTERFACE
 *    T_IMPLEMENTS
 *
 * PHP versions 4 and 5
 *
 * @category PHP
 * @package  PHP_CompatInfo
 * @author   Laurent Laville <pear@laurent-laville.org>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD
 * @version  CVS: $Id: checkPHP5.php,v 1.7 2008/07/22 21:13:14 farell Exp $
 * @link     http://pear.php.net/package/PHP_CompatInfo
 * @ignore
 */

require_once 'PHP/CompatInfo.php';

/**
 * @ignore
 */
abstract class AbstractClass
{
    abstract protected function 
getValue();
}
/**
 * @ignore
 */
interface ITemplate
{
    public function 
setVariable($name$var);
    public function 
getHtml($template);
}
/**
 * @ignore
 */
class Template implements ITemplate
{
    private 
$vars = array();

    public function 
setVariable($name$var)
    {
        
$this->vars[$name] = $var;
    }

    public function 
getHtml($template)
    {
        foreach (
$this->vars as $name => $value) {
            
$template str_replace('{' $name '}'$value$template);
        }
        return 
$template;
    }
}
/**
 * @ignore
 */
class BaseClass
{
    public 
$objet1;
    public 
$objet2;

    public function 
__construct()
    {
    }

    public function 
__clone()
    {
        
$this->object1 = clone($this->object1);
    }

    private function 
foo()
    {
    }

    protected function 
bar()
    {
        if (
$this->object1 instanceof BaseClass) {
            return;
        }

        try {
            
$error 'my error';
            throw new 
Exception($error);

        } catch(
Exception $__bar_exception) {

        }
    }

    final public function 
moreTesting()
    {
        echo 
"BaseClass::moreTesting() called \n";
    }
}

$info = new PHP_CompatInfo();

$file    __FILE__;
$options = array('debug' => true);

$r $info->parseFile($file$options);
/*
   To keep backward compatibility, result is also return (here in $r)
   but you don't need to print it, it's the default behavior of API 1.8.0
 */
//var_export($r);
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586