parent
739152ba14
commit
fb10132b6c
6 changed files with 121 additions and 27 deletions
@ -0,0 +1,9 @@ |
|||||||
|
--TEST-- |
||||||
|
static calls |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
$cls = 'DateTime'; |
||||||
|
$method = 'createFromFormat'; |
||||||
|
$now = $cls::$method('U', time()); |
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
--TEST-- |
||||||
|
Testing dynamic call with invalid value for method name |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$a = new stdClass; |
||||||
|
|
||||||
|
$a::$a(); |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
Fatal error: Uncaught Error: %s |
||||||
|
Stack trace: |
||||||
|
#0 {main} |
||||||
|
thrown in %s on line %d |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
--TEST-- |
||||||
|
Testing dynamic call with invalid method name |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$a = new stdClass; |
||||||
|
$b = 1; |
||||||
|
|
||||||
|
$a::$b(); |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
Fatal error: Uncaught Error: %s |
||||||
|
Stack trace: |
||||||
|
#0 {main} |
||||||
|
thrown in %s on line %d |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
--TEST-- |
||||||
|
Testing dynamic call with undefined variables |
||||||
|
--SKIPIF-- |
||||||
|
<?php die("skip");?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
$a::$b(); |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
Warning: Undefined variable $a in %s on line %d |
||||||
|
|
||||||
|
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d |
||||||
|
Stack trace: |
||||||
|
#0 {main} |
||||||
|
thrown in %s on line %d |
||||||
Loading…
Reference in new issue