source: src/router/php7/ext/opcache/tests/wrong_inlining_002.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 677 bytes
Line 
1--TEST--
2$this not in object context
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9--FILE--
10<?php
11class Foo {
12    private function getConst() {
13        return 42;
14    }
15    public function test() {
16        var_dump($this->getConst());
17    }
18}
19
20Foo::test();
21?>
22--EXPECTF--
23Deprecated: Non-static method Foo::test() should not be called statically in %swrong_inlining_002.php on line 11
24
25Fatal error: Uncaught Error: Using $this when not in object context in %swrong_inlining_002.php:7
26Stack trace:
27#0 %swrong_inlining_002.php(11): Foo::test()
28#1 {main}
29  thrown in %swrong_inlining_002.php on line 7
Note: See TracBrowser for help on using the repository browser.