php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63253
Patch instance_invoke_003.phpt revision 2012-10-12 04:25 UTC by laruence@php.net
Patch instance_invoke_002.phpt revision 2012-10-12 04:25 UTC by laruence@php.net
Patch instance_invoke_001.phpt revision 2012-10-12 04:24 UTC by laruence@php.net
Patch bug63253.patch revision 2012-10-12 04:15 UTC by laruence@php.net
revision 2012-10-12 04:08 UTC by laruence@php.net

Patch instance_invoke_001.phpt for Scripting Engine problem Bug #63253

Patch version 2012-10-12 04:24 UTC

Return to Bug #63253 | Download this patch
Patch Revisions:

Developer: laruence@php.net

--TEST--
Instance invoke 
--FILE--
<?php

class Foo
{
    public function __invoke() {
        echo "okey";
    }
}

(new Foo())();

class Bar
{
    public function __invoke($name) {
        return $name;
    }
}

var_dump((new Bar())());
var_dump((new Bar())("okey"));

--EXPECTF--
okey
Warning: Missing argument 1 for Bar::__invoke(), called in %sinstance_invoke_001.php on line %d and defined in %sinstance_invoke_001.php on line %d

Notice: Undefined variable: name in %sinstance_invoke_001.php on line %d
NULL
string(4) "okey"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 00:01:33 2024 UTC