source: src/router/php7/Zend/tests/closures/closure_from_callable_non_static_statically.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 3 months ago

update php

File size: 403 bytes
Line 
1--TEST--
2Testing Closure::fromCallable() functionality: Getting non-static method statically
3--FILE--
4<?php
5
6class A {
7    public function method() {
8    }
9}
10
11try {
12    $fn = Closure::fromCallable(['A', 'method']);
13    $fn();
14} catch (TypeError $e) {
15    echo $e->getMessage(), "\n";
16}
17
18?>
19--EXPECT--
20Failed to create closure from callable: non-static method A::method() should not be called statically
Note: See TracBrowser for help on using the repository browser.