summaryrefslogtreecommitdiff
path: root/tests/php/phpt/variables/018-calling-php-functions.phpt
blob: 1b8bfebdb90ce2bd89757266345367980d2f2c2e (plain)
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
--TEST--
calling-php-callable
--DESCRIPTION--
call callable object of class from user space
call method of class from user space
--SKIPIF--
<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
--FILEEOF--
<?php


class CallableClass {
    public function __construct($a){ $this->a = $a;}
    public function __invoke($b){ echo "CallableClass({$this->a})::__invoke($b)";}
    private $a = "";
}

class usrspClass {
  function __construct($a){ $this->a = $a;}
  function someMethod($b) {echo "usrspClass({$this->a})::someMethod($b)";}
  private $a = "";
}


TestVariables\fnFromUserSpace2();


--EXPECT--
2014-03-28 21:22:15
2014-03-28 21:22:15
usrspClass(Mount Meru)::someMethod(is in the Arctics)
CallableClass(Arctics around mount Meru)::__invoke(is the birthplace of the Hyperboreans)